2019-12-09 14:46:38

by Kamil Konieczny

[permalink] [raw]
Subject: [PATCH 0/4] PM / devfreq: add possibility for delayed work

Add possibility for changing work from deferred to delayed in devfreq
workqueue. This can be done with

echo 1 > /sys/class/devfreq/devfreqX/delayed_timer

Second way is to use config option, in that case delayed timer will be
used from devfreq start.

Default behaviour is to stick with old delayed timer.

This patchset was inspired by Lukasz Luba patches and discussion that
follows, see

[v1] https://marc.info/?l=linux-pm&m=154904631226997&w=2
[v2] https://marc.info/?l=linux-pm&m=154989907416072&w=2
[v3] https://marc.info/?l=linux-pm&m=155001027823904&w=2

Kamil Konieczny (4):
PM / devfreq: reuse system workqueue machanism
PM / devfreq: add possibility for delayed work
PM / devfreq: Kconfig: add DEVFREQ_DELAYED_TIMER option
PM / devfreq: use delayed work if DEVFREQ_DELAYED_TIMER set

Documentation/ABI/testing/sysfs-class-devfreq | 10 ++++
drivers/devfreq/Kconfig | 12 ++++
drivers/devfreq/devfreq.c | 55 +++++++++++++++++--
include/linux/devfreq.h | 2 +
4 files changed, 75 insertions(+), 4 deletions(-)

--
2.24.0


2019-12-09 14:46:59

by Kamil Konieczny

[permalink] [raw]
Subject: [PATCH 3/4] PM / devfreq: Kconfig: add DEVFREQ_DELAYED_TIMER option

Add Kconfig option DEVFREQ_DELAYED_TIMER. If set, devfreq workqueue
will use delayed timer from its start.

Signed-off-by: Kamil Konieczny <[email protected]>
---
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"

config ARM_EXYNOS_BUS_DEVFREQ
--
2.24.0

2019-12-09 14:47:22

by Kamil Konieczny

[permalink] [raw]
Subject: [PATCH 4/4] PM / devfreq: use delayed work if DEVFREQ_DELAYED_TIMER set

If option DEVFREQ_DELAYED_TIMER is set use delayed work in devfreq
workqueue from devfreq start.

Signed-off-by: Kamil Konieczny <[email protected]>
---
drivers/devfreq/devfreq.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index c277d1770fef..d9edf648a09e 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -702,7 +702,10 @@ struct devfreq *devfreq_add_device(struct device *dev,
devfreq->last_status.current_frequency = profile->initial_freq;
devfreq->data = data;
devfreq->nb.notifier_call = devfreq_notifier_call;
- devfreq->delayed_timer = false;
+ if (IS_ENABLED(CONFIG_DEVFREQ_DELAYED_TIMER))
+ devfreq->delayed_timer = true;
+ else
+ devfreq->delayed_timer = false;

if (!devfreq->profile->max_state && !devfreq->profile->freq_table) {
mutex_unlock(&devfreq->lock);
--
2.24.0

2019-12-09 14:51:00

by Kamil Konieczny

[permalink] [raw]
Subject: [PATCH 1/4] PM / devfreq: reuse system workqueue machanism

There is no need for creating another workqueue, it is enough
to reuse system_freezable_power_efficient one.

Signed-off-by: Kamil Konieczny <[email protected]>
---
drivers/devfreq/devfreq.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index 46a7ff7c2994..955949c6fc1f 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -1532,11 +1532,11 @@ static int __init devfreq_init(void)
return PTR_ERR(devfreq_class);
}

- devfreq_wq = create_freezable_workqueue("devfreq_wq");
+ devfreq_wq = system_freezable_power_efficient_wq;
if (!devfreq_wq) {
class_destroy(devfreq_class);
- pr_err("%s: couldn't create workqueue\n", __FILE__);
- return -ENOMEM;
+ pr_err("%s: system_freezable_power_efficient_wq isn't initialized\n", __FILE__);
+ return -EINVAL;
}
devfreq_class->dev_groups = devfreq_groups;

--
2.24.0

2019-12-09 19:35:15

by Matthias Kaehlcke

[permalink] [raw]
Subject: Re: [PATCH 3/4] PM / devfreq: Kconfig: add DEVFREQ_DELAYED_TIMER option

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 <[email protected]>
> ---
> 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'.

2019-12-10 01:36:12

by Chanwoo Choi

[permalink] [raw]
Subject: Re: [PATCH 1/4] PM / devfreq: reuse system workqueue machanism

On 12/9/19 11:44 PM, Kamil Konieczny wrote:
> There is no need for creating another workqueue, it is enough
> to reuse system_freezable_power_efficient one.
>
> Signed-off-by: Kamil Konieczny <[email protected]>
> ---
> drivers/devfreq/devfreq.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index 46a7ff7c2994..955949c6fc1f 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -1532,11 +1532,11 @@ static int __init devfreq_init(void)
> return PTR_ERR(devfreq_class);
> }
>
> - devfreq_wq = create_freezable_workqueue("devfreq_wq");
> + devfreq_wq = system_freezable_power_efficient_wq;

It affect the behaviors of whole device drivers using devfreq subsystem.
It is not good to change the workqueue type without any reasonable
data like experiment result, power-consumption result and performance
result for almost device drivers using devfreq subsystem.

Are there any problem or any benefit to change workqueue type?

Actually, it is not simple to change the like just one device driver
because devfreq subsytem is very important for both performance
and power-consumption.

If you hope to change the feature related to both performance
and power-consumption, please suggest the reasonable data
with fundamental reason.

So, I can't agree it.


> if (!devfreq_wq) {
> class_destroy(devfreq_class);
> - pr_err("%s: couldn't create workqueue\n", __FILE__);
> - return -ENOMEM;
> + pr_err("%s: system_freezable_power_efficient_wq isn't initialized\n", __FILE__);
> + return -EINVAL;
> }
> devfreq_class->dev_groups = devfreq_groups;
>
>


--
Best Regards,
Chanwoo Choi
Samsung Electronics

2019-12-10 01:49:56

by Chanwoo Choi

[permalink] [raw]
Subject: Re: [PATCH 3/4] PM / devfreq: Kconfig: add DEVFREQ_DELAYED_TIMER option

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 <[email protected]>
> ---
> 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
>


--
Best Regards,
Chanwoo Choi
Samsung Electronics

2019-12-10 07:29:22

by Kamil Konieczny

[permalink] [raw]
Subject: Re: [PATCH 1/4] PM / devfreq: reuse system workqueue machanism

On 10.12.2019 02:41, Chanwoo Choi wrote:
> On 12/9/19 11:44 PM, Kamil Konieczny wrote:
>> There is no need for creating another workqueue, it is enough
>> to reuse system_freezable_power_efficient one.
>>
>> Signed-off-by: Kamil Konieczny <[email protected]>
>> ---
>> drivers/devfreq/devfreq.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>> index 46a7ff7c2994..955949c6fc1f 100644
>> --- a/drivers/devfreq/devfreq.c
>> +++ b/drivers/devfreq/devfreq.c
>> @@ -1532,11 +1532,11 @@ static int __init devfreq_init(void)
>> return PTR_ERR(devfreq_class);
>> }
>>
>> - devfreq_wq = create_freezable_workqueue("devfreq_wq");
>> + devfreq_wq = system_freezable_power_efficient_wq;
>
> It affect the behaviors of whole device drivers using devfreq subsystem.
> It is not good to change the workqueue type without any reasonable
> data like experiment result, power-consumption result and performance
> result for almost device drivers using devfreq subsystem.
>
> Are there any problem or any benefit to change workqueue type?

The workqueue is freezable with additional capability of 'power_efficient',
it is already developed by linux community so why not reuse it ?

> Actually, it is not simple to change the like just one device driver
> because devfreq subsytem is very important for both performance
> and power-consumption.

I agree. The name of this wq promises what you want, both freezable
and power efficiency.

> If you hope to change the feature related to both performance
> and power-consumption, please suggest the reasonable data
> with fundamental reason.
>
> So, I can't agree it.
>
>
>> if (!devfreq_wq) {
>> class_destroy(devfreq_class);
>> - pr_err("%s: couldn't create workqueue\n", __FILE__);
>> - return -ENOMEM;
>> + pr_err("%s: system_freezable_power_efficient_wq isn't initialized\n", __FILE__);
>> + return -EINVAL;
>> }
>> devfreq_class->dev_groups = devfreq_groups;
>>
>>
>
>

--
Best regards,
Kamil Konieczny
Samsung R&D Institute Poland

2019-12-10 07:47:56

by Chanwoo Choi

[permalink] [raw]
Subject: Re: [PATCH 1/4] PM / devfreq: reuse system workqueue machanism

On 12/10/19 4:28 PM, Kamil Konieczny wrote:
> On 10.12.2019 02:41, Chanwoo Choi wrote:
>> On 12/9/19 11:44 PM, Kamil Konieczny wrote:
>>> There is no need for creating another workqueue, it is enough
>>> to reuse system_freezable_power_efficient one.
>>>
>>> Signed-off-by: Kamil Konieczny <[email protected]>
>>> ---
>>> drivers/devfreq/devfreq.c | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>>> index 46a7ff7c2994..955949c6fc1f 100644
>>> --- a/drivers/devfreq/devfreq.c
>>> +++ b/drivers/devfreq/devfreq.c
>>> @@ -1532,11 +1532,11 @@ static int __init devfreq_init(void)
>>> return PTR_ERR(devfreq_class);
>>> }
>>>
>>> - devfreq_wq = create_freezable_workqueue("devfreq_wq");
>>> + devfreq_wq = system_freezable_power_efficient_wq;
>>
>> It affect the behaviors of whole device drivers using devfreq subsystem.
>> It is not good to change the workqueue type without any reasonable
>> data like experiment result, power-consumption result and performance
>> result for almost device drivers using devfreq subsystem.
>>
>> Are there any problem or any benefit to change workqueue type?
>
> The workqueue is freezable with additional capability of 'power_efficient',
> it is already developed by linux community so why not reuse it ?

As you agreed below, why don't you suggest the any reasonable test result
with this patch? As I commented, it affects the all device drivers.
It is necessary to suggest the test result on multiple scenarios
in order to prevent the any power-consumption and performance regression.
It is not easy to change them without any data.

Frankly, if you test almost scenarios and suggest the reasonable result
that anyone can understand, like there are never difference
between "create_freezable_workqueue("devfreq_wq");" and system_freezable_power_efficient_wq.
But you don't suggest any data.

- The original devfreq_wq include the only work related to devfreq.
- system_freezable_power_efficient_wq include the all works registered
from both other subsystem and device drivers in linux kernel.

>
>> Actually, it is not simple to change the like just one device driver
>> because devfreq subsytem is very important for both performance
>> and power-consumption.
>
> I agree. The name of this wq promises what you want, both freezable
> and power efficiency.
>
>> If you hope to change the feature related to both performance
>> and power-consumption, please suggest the reasonable data
>> with fundamental reason.
>>
>> So, I can't agree it.
>>
>>
>>> if (!devfreq_wq) {
>>> class_destroy(devfreq_class);
>>> - pr_err("%s: couldn't create workqueue\n", __FILE__);
>>> - return -ENOMEM;
>>> + pr_err("%s: system_freezable_power_efficient_wq isn't initialized\n", __FILE__);
>>> + return -EINVAL;
>>> }
>>> devfreq_class->dev_groups = devfreq_groups;
>>>
>>>
>>
>>
>


--
Best Regards,
Chanwoo Choi
Samsung Electronics

2019-12-10 09:30:33

by Kamil Konieczny

[permalink] [raw]
Subject: Re: [PATCH 1/4] PM / devfreq: reuse system workqueue machanism

Hi Chanwoo,

On 10.12.2019 08:53, Chanwoo Choi wrote:
> On 12/10/19 4:28 PM, Kamil Konieczny wrote:
>> On 10.12.2019 02:41, Chanwoo Choi wrote:
>>> On 12/9/19 11:44 PM, Kamil Konieczny wrote:
>>>> There is no need for creating another workqueue, it is enough
>>>> to reuse system_freezable_power_efficient one.
>>>>
>>>> Signed-off-by: Kamil Konieczny <[email protected]>
>>>> ---
>>>> drivers/devfreq/devfreq.c | 6 +++---
>>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>>
>>>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>>>> index 46a7ff7c2994..955949c6fc1f 100644
>>>> --- a/drivers/devfreq/devfreq.c
>>>> +++ b/drivers/devfreq/devfreq.c
>>>> @@ -1532,11 +1532,11 @@ static int __init devfreq_init(void)
>>>> return PTR_ERR(devfreq_class);
>>>> }
>>>>
>>>> - devfreq_wq = create_freezable_workqueue("devfreq_wq");
>>>> + devfreq_wq = system_freezable_power_efficient_wq;
>>>
>>> It affect the behaviors of whole device drivers using devfreq subsystem.
>>> It is not good to change the workqueue type without any reasonable
>>> data like experiment result, power-consumption result and performance
>>> result for almost device drivers using devfreq subsystem.
>>>
>>> Are there any problem or any benefit to change workqueue type?
>>
>> The workqueue is freezable with additional capability of 'power_efficient',
>> it is already developed by linux community so why not reuse it ?
>
> As you agreed below, why don't you suggest the any reasonable test result
> with this patch? As I commented, it affects the all device drivers.
> It is necessary to suggest the test result on multiple scenarios
> in order to prevent the any power-consumption and performance regression.
> It is not easy to change them without any data.
>
> Frankly, if you test almost scenarios and suggest the reasonable result
> that anyone can understand, like there are never difference
> between "create_freezable_workqueue("devfreq_wq");" and system_freezable_power_efficient_wq.
> But you don't suggest any data.

I agree about tests data needed for deciding about change. As I already wrote in other
letter, I do not have such tests procedures, so if you have them and you may share
them with me or Marek, I can run them and gather tests results.

> - The original devfreq_wq include the only work related to devfreq.
> - system_freezable_power_efficient_wq include the all works registered
> from both other subsystem and device drivers in linux kernel.

I do not know that good system wq, devfreq_wq have only one work item so
imho it is not beneficial to use separate wq. Seperate wq can be good
during debugging problems with wq.

>>> Actually, it is not simple to change the like just one device driver
>>> because devfreq subsytem is very important for both performance
>>> and power-consumption.
>>
>> I agree. The name of this wq promises what you want, both freezable
>> and power efficiency.
>>
>>> If you hope to change the feature related to both performance
>>> and power-consumption, please suggest the reasonable data
>>> with fundamental reason.
>>>
>>> So, I can't agree it.
>>>
>>>
>>>> if (!devfreq_wq) {
>>>> class_destroy(devfreq_class);
>>>> - pr_err("%s: couldn't create workqueue\n", __FILE__);
>>>> - return -ENOMEM;
>>>> + pr_err("%s: system_freezable_power_efficient_wq isn't initialized\n", __FILE__);
>>>> + return -EINVAL;
>>>> }
>>>> devfreq_class->dev_groups = devfreq_groups;

--
Best regards,
Kamil Konieczny
Samsung R&D Institute Poland

2019-12-10 09:36:54

by Chanwoo Choi

[permalink] [raw]
Subject: Re: [PATCH 1/4] PM / devfreq: reuse system workqueue machanism

On 12/10/19 6:28 PM, Kamil Konieczny wrote:
> Hi Chanwoo,
>
> On 10.12.2019 08:53, Chanwoo Choi wrote:
>> On 12/10/19 4:28 PM, Kamil Konieczny wrote:
>>> On 10.12.2019 02:41, Chanwoo Choi wrote:
>>>> On 12/9/19 11:44 PM, Kamil Konieczny wrote:
>>>>> There is no need for creating another workqueue, it is enough
>>>>> to reuse system_freezable_power_efficient one.
>>>>>
>>>>> Signed-off-by: Kamil Konieczny <[email protected]>
>>>>> ---
>>>>> drivers/devfreq/devfreq.c | 6 +++---
>>>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>>>
>>>>> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
>>>>> index 46a7ff7c2994..955949c6fc1f 100644
>>>>> --- a/drivers/devfreq/devfreq.c
>>>>> +++ b/drivers/devfreq/devfreq.c
>>>>> @@ -1532,11 +1532,11 @@ static int __init devfreq_init(void)
>>>>> return PTR_ERR(devfreq_class);
>>>>> }
>>>>>
>>>>> - devfreq_wq = create_freezable_workqueue("devfreq_wq");
>>>>> + devfreq_wq = system_freezable_power_efficient_wq;
>>>>
>>>> It affect the behaviors of whole device drivers using devfreq subsystem.
>>>> It is not good to change the workqueue type without any reasonable
>>>> data like experiment result, power-consumption result and performance
>>>> result for almost device drivers using devfreq subsystem.
>>>>
>>>> Are there any problem or any benefit to change workqueue type?
>>>
>>> The workqueue is freezable with additional capability of 'power_efficient',
>>> it is already developed by linux community so why not reuse it ?
>>
>> As you agreed below, why don't you suggest the any reasonable test result
>> with this patch? As I commented, it affects the all device drivers.
>> It is necessary to suggest the test result on multiple scenarios
>> in order to prevent the any power-consumption and performance regression.
>> It is not easy to change them without any data.
>>
>> Frankly, if you test almost scenarios and suggest the reasonable result
>> that anyone can understand, like there are never difference
>> between "create_freezable_workqueue("devfreq_wq");" and system_freezable_power_efficient_wq.
>> But you don't suggest any data.
>
> I agree about tests data needed for deciding about change. As I already wrote in other
> letter, I do not have such tests procedures, so if you have them and you may share
> them with me or Marek, I can run them and gather tests results.
>
>> - The original devfreq_wq include the only work related to devfreq.
>> - system_freezable_power_efficient_wq include the all works registered
>> from both other subsystem and device drivers in linux kernel.
>
> I do not know that good system wq, devfreq_wq have only one work item so
> imho it is not beneficial to use separate wq. Seperate wq can be good
> during debugging problems with wq.

No, devfreq_wq has not ony one work item. If one target use the multiple
devfreq device with simple_ondemand governor, devfreq_wq has the
the multiple work item. It depends on the number of devfreq device
with simple_ondemand governor.

>
>>>> Actually, it is not simple to change the like just one device driver
>>>> because devfreq subsytem is very important for both performance
>>>> and power-consumption.
>>>
>>> I agree. The name of this wq promises what you want, both freezable
>>> and power efficiency.
>>>
>>>> If you hope to change the feature related to both performance
>>>> and power-consumption, please suggest the reasonable data
>>>> with fundamental reason.
>>>>
>>>> So, I can't agree it.
>>>>
>>>>
>>>>> if (!devfreq_wq) {
>>>>> class_destroy(devfreq_class);
>>>>> - pr_err("%s: couldn't create workqueue\n", __FILE__);
>>>>> - return -ENOMEM;
>>>>> + pr_err("%s: system_freezable_power_efficient_wq isn't initialized\n", __FILE__);
>>>>> + return -EINVAL;
>>>>> }
>>>>> devfreq_class->dev_groups = devfreq_groups;
>


--
Best Regards,
Chanwoo Choi
Samsung Electronics

2019-12-10 09:40:24

by Kamil Konieczny

[permalink] [raw]
Subject: Re: [PATCH 3/4] PM / devfreq: Kconfig: add DEVFREQ_DELAYED_TIMER option

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 <[email protected]>
>> ---
>> 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'.
>
>

--
Best regards,
Kamil Konieczny
Samsung R&D Institute Poland