diff mbox series

[3/4] PM / devfreq: Kconfig: add DEVFREQ_DELAYED_TIMER option

Message ID 20191209144425.13321-4-k.konieczny@samsung.com (mailing list archive)
State New, archived
Headers show
Series PM / devfreq: add possibility for delayed work | expand

Commit Message

Kamil Konieczny Dec. 9, 2019, 2:44 p.m. UTC
Add Kconfig option DEVFREQ_DELAYED_TIMER. If set, devfreq workqueue
will use delayed timer from its start.

Signed-off-by: Kamil Konieczny <k.konieczny@samsung.com>
---
 drivers/devfreq/Kconfig | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Matthias Kaehlcke Dec. 9, 2019, 7:34 p.m. UTC | #1
On Mon, Dec 09, 2019 at 03:44:24PM +0100, Kamil Konieczny wrote:
> Add Kconfig option DEVFREQ_DELAYED_TIMER. If set, devfreq workqueue
> will use delayed timer from its start.

s/from its start/by default/

> 
> Signed-off-by: Kamil Konieczny <k.konieczny@samsung.com>
> ---
>  drivers/devfreq/Kconfig | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
> index 38a94df749a2..c799917c34c9 100644
> --- a/drivers/devfreq/Kconfig
> +++ b/drivers/devfreq/Kconfig
> @@ -74,6 +74,18 @@ config DEVFREQ_GOV_PASSIVE
>  	  through sysfs entries. The passive governor recommends that
>  	  devfreq device uses the OPP table to get the frequency/voltage.
>  
> +comment "DEVFREQ Options"
> +
> +config DEVFREQ_DELAYED_TIMER
> +	bool "Use delayed timer in Simple Ondemand Governor"

Is the use really limited to the Simple Ondemand Governor? I don't think
so, at least the Tegra devfreq driver also does monitoring and others
might follow.


> +	default false
> +	help
> +	  Simple Ondemand Governor uses polling for reading buses counters.
> +	  A default timer used is deferred, which saves power, but can
> +	  miss increased demand for higher bus frequency if timer was
> +	  assigned to idle cpu. If you want to change this to delayed
> +	  timer at the cost of more power used, say Yes here.
> +
>  comment "DEVFREQ Drivers"
>  
>  config ARM_EXYNOS_BUS_DEVFREQ


This patch on it's own does nothing. Squash it with '[4/4] PM / devfreq:
use delayed work if DEVFREQ_DELAYED_TIMER set'.
Chanwoo Choi Dec. 10, 2019, 1:54 a.m. UTC | #2
On 12/9/19 11:44 PM, Kamil Konieczny wrote:
> Add Kconfig option DEVFREQ_DELAYED_TIMER. If set, devfreq workqueue
> will use delayed timer from its start.
> 
> Signed-off-by: Kamil Konieczny <k.konieczny@samsung.com>
> ---
>  drivers/devfreq/Kconfig | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
> index 38a94df749a2..c799917c34c9 100644
> --- a/drivers/devfreq/Kconfig
> +++ b/drivers/devfreq/Kconfig
> @@ -74,6 +74,18 @@ config DEVFREQ_GOV_PASSIVE
>  	  through sysfs entries. The passive governor recommends that
>  	  devfreq device uses the OPP table to get the frequency/voltage.
>  
> +comment "DEVFREQ Options"
> +
> +config DEVFREQ_DELAYED_TIMER
> +	bool "Use delayed timer in Simple Ondemand Governor"
> +	default false
> +	help
> +	  Simple Ondemand Governor uses polling for reading buses counters.
> +	  A default timer used is deferred, which saves power, but can
> +	  miss increased demand for higher bus frequency if timer was
> +	  assigned to idle cpu. If you want to change this to delayed
> +	  timer at the cost of more power used, say Yes here.
> +
>  comment "DEVFREQ Drivers"

I don't think that we cannot choice the all options in Kconfig
at the build time. If we add something like this patch,

we can choice the any options in Kconfig as following:
- polling time (millisecond)
- up threshold
- down threshold
- type of workqueue
- etc ...

Also, there are too much optional value and selectable value 
in the linux kernel. 

As I said, If you suggest the reasonable data with test result,
I will add the new flag to 'struct devfreq_dev_profile'.

>  
>  config ARM_EXYNOS_BUS_DEVFREQ
>
Kamil Konieczny Dec. 10, 2019, 9:39 a.m. UTC | #3
Hi,

On 09.12.2019 20:34, Matthias Kaehlcke wrote:
> On Mon, Dec 09, 2019 at 03:44:24PM +0100, Kamil Konieczny wrote:
>> Add Kconfig option DEVFREQ_DELAYED_TIMER. If set, devfreq workqueue
>> will use delayed timer from its start.
> 
> s/from its start/by default/
> 

thank you for review, I will correct this

>>
>> Signed-off-by: Kamil Konieczny <k.konieczny@samsung.com>
>> ---
>>  drivers/devfreq/Kconfig | 12 ++++++++++++
>>  1 file changed, 12 insertions(+)
>>
>> diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
>> index 38a94df749a2..c799917c34c9 100644
>> --- a/drivers/devfreq/Kconfig
>> +++ b/drivers/devfreq/Kconfig
>> @@ -74,6 +74,18 @@ config DEVFREQ_GOV_PASSIVE
>>  	  through sysfs entries. The passive governor recommends that
>>  	  devfreq device uses the OPP table to get the frequency/voltage.
>>  
>> +comment "DEVFREQ Options"
>> +
>> +config DEVFREQ_DELAYED_TIMER
>> +	bool "Use delayed timer in Simple Ondemand Governor"
> 
> Is the use really limited to the Simple Ondemand Governor? I don't think
> so, at least the Tegra devfreq driver also does monitoring and others
> might follow.

There are currently:

simple_ondemand
performance
powersave
userspace
passive

From them perfomance, powersave and userspace are fixed max, min or user provided,
so only left simple_ondemand and passive which could benefit from change.

>> +	default false
>> +	help
>> +	  Simple Ondemand Governor uses polling for reading buses counters.
>> +	  A default timer used is deferred, which saves power, but can
>> +	  miss increased demand for higher bus frequency if timer was
>> +	  assigned to idle cpu. If you want to change this to delayed
>> +	  timer at the cost of more power used, say Yes here.
>> +
>>  comment "DEVFREQ Drivers"
>>  
>>  config ARM_EXYNOS_BUS_DEVFREQ
> 
> 
> This patch on it's own does nothing. Squash it with '[4/4] PM / devfreq:
> use delayed work if DEVFREQ_DELAYED_TIMER set'.
> 
>
diff mbox series

Patch

diff --git a/drivers/devfreq/Kconfig b/drivers/devfreq/Kconfig
index 38a94df749a2..c799917c34c9 100644
--- a/drivers/devfreq/Kconfig
+++ b/drivers/devfreq/Kconfig
@@ -74,6 +74,18 @@  config DEVFREQ_GOV_PASSIVE
 	  through sysfs entries. The passive governor recommends that
 	  devfreq device uses the OPP table to get the frequency/voltage.
 
+comment "DEVFREQ Options"
+
+config DEVFREQ_DELAYED_TIMER
+	bool "Use delayed timer in Simple Ondemand Governor"
+	default false
+	help
+	  Simple Ondemand Governor uses polling for reading buses counters.
+	  A default timer used is deferred, which saves power, but can
+	  miss increased demand for higher bus frequency if timer was
+	  assigned to idle cpu. If you want to change this to delayed
+	  timer at the cost of more power used, say Yes here.
+
 comment "DEVFREQ Drivers"
 
 config ARM_EXYNOS_BUS_DEVFREQ