* [PATCH] sunrpc: queue work on system_power_efficient_wq
@ 2016-09-01 7:30 Chunyan Zhang
2016-09-01 18:46 ` Anna Schumaker
0 siblings, 1 reply; 4+ messages in thread
From: Chunyan Zhang @ 2016-09-01 7:30 UTC (permalink / raw)
To: trond.myklebust, anna.schumaker, davem
Cc: linux-nfs, netdev, linux-kernel, zhang.lyra, ke.wang
From: Ke Wang <ke.wang@spreadtrum.com>
sunrpc uses workqueue to clean cache regulary. There is no real dependency
of executing work on the cpu which queueing it.
On a idle system, especially for a heterogeneous systems like big.LITTLE,
it is observed that the big idle cpu was woke up many times just to service
this work, which against the principle of power saving. It would be better
if we can schedule it on a cpu which the scheduler believes to be the most
appropriate one.
After apply this patch, system_wq will be replaced by
system_power_efficient_wq for sunrpc. This functionality is enabled when
CONFIG_WQ_POWER_EFFICIENT is selected.
Signed-off-by: Ke Wang <ke.wang@spreadtrum.com>
---
net/sunrpc/cache.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
index 4d8e11f..8aabe12 100644
--- a/net/sunrpc/cache.c
+++ b/net/sunrpc/cache.c
@@ -353,7 +353,7 @@ void sunrpc_init_cache_detail(struct cache_detail *cd)
spin_unlock(&cache_list_lock);
/* start the cleaning process */
- schedule_delayed_work(&cache_cleaner, 0);
+ queue_delayed_work(system_power_efficient_wq, &cache_cleaner, 0);
}
EXPORT_SYMBOL_GPL(sunrpc_init_cache_detail);
@@ -476,7 +476,8 @@ static void do_cache_clean(struct work_struct *work)
delay = 0;
if (delay)
- schedule_delayed_work(&cache_cleaner, delay);
+ queue_delayed_work(system_power_efficient_wq,
+ &cache_cleaner, delay);
}
--
2.7.4
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] sunrpc: queue work on system_power_efficient_wq
2016-09-01 7:30 [PATCH] sunrpc: queue work on system_power_efficient_wq Chunyan Zhang
@ 2016-09-01 18:46 ` Anna Schumaker
[not found] ` <d72ce63e4a054c8797c9ba92cdad3b5d@SHMBX03.spreadtrum.com>
0 siblings, 1 reply; 4+ messages in thread
From: Anna Schumaker @ 2016-09-01 18:46 UTC (permalink / raw)
To: Chunyan Zhang, trond.myklebust, anna.schumaker, davem
Cc: linux-nfs, netdev, linux-kernel, ke.wang
On 09/01/2016 03:30 AM, Chunyan Zhang wrote:
> From: Ke Wang <ke.wang@spreadtrum.com>
>
> sunrpc uses workqueue to clean cache regulary. There is no real dependency
> of executing work on the cpu which queueing it.
>
> On a idle system, especially for a heterogeneous systems like big.LITTLE,
> it is observed that the big idle cpu was woke up many times just to service
> this work, which against the principle of power saving. It would be better
> if we can schedule it on a cpu which the scheduler believes to be the most
> appropriate one.
>
> After apply this patch, system_wq will be replaced by
> system_power_efficient_wq for sunrpc. This functionality is enabled when
> CONFIG_WQ_POWER_EFFICIENT is selected.
Makes sense to me, but I'm a little surprised that there isn't a "schedule_delayed_power_efficient_work()" function to match how the normal workqueue is used.
Thanks,
Anna
>
> Signed-off-by: Ke Wang <ke.wang@spreadtrum.com>
> ---
> net/sunrpc/cache.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
> index 4d8e11f..8aabe12 100644
> --- a/net/sunrpc/cache.c
> +++ b/net/sunrpc/cache.c
> @@ -353,7 +353,7 @@ void sunrpc_init_cache_detail(struct cache_detail *cd)
> spin_unlock(&cache_list_lock);
>
> /* start the cleaning process */
> - schedule_delayed_work(&cache_cleaner, 0);
> + queue_delayed_work(system_power_efficient_wq, &cache_cleaner, 0);
> }
> EXPORT_SYMBOL_GPL(sunrpc_init_cache_detail);
>
> @@ -476,7 +476,8 @@ static void do_cache_clean(struct work_struct *work)
> delay = 0;
>
> if (delay)
> - schedule_delayed_work(&cache_cleaner, delay);
> + queue_delayed_work(system_power_efficient_wq,
> + &cache_cleaner, delay);
> }
>
>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 答复: [PATCH] sunrpc: queue work on system_power_efficient_wq
[not found] ` <d72ce63e4a054c8797c9ba92cdad3b5d-GFC6RAiklXKXEiejXgtQ7QQSgKfZeEaX@public.gmane.org>
@ 2016-09-20 5:03 ` Chunyan Zhang
0 siblings, 0 replies; 4+ messages in thread
From: Chunyan Zhang @ 2016-09-20 5:03 UTC (permalink / raw)
To: Ke Wang (王科)
Cc: Anna Schumaker,
trond.myklebust-7I+n7zu2hftEKMMhf/gKZA@public.gmane.org,
davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org,
linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Resend behalf on Ke Wang.
Thanks,
Chunyan
On 20 September 2016 at 10:33, Ke Wang (王科) <Ke.Wang@spreadtrum.com> wrote:
> May I have any comments for this patch?
> or
> This patch can be merged directly into next release?
>
> Thanks,
> Ke
> ________________________________________
> 发件人: Anna Schumaker <Anna.Schumaker-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org>
> 发送时间: 2016年9月2日 2:46
> 收件人: Chunyan Zhang; trond.myklebust@primarydata.com; anna.schumaker-HgOvQuBEEgTQT0dZR+AlfA@public.gmane.org; davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org
> 抄送: linux-nfs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org; Ke Wang (王科)
> 主题: Re: [PATCH] sunrpc: queue work on system_power_efficient_wq
>
> On 09/01/2016 03:30 AM, Chunyan Zhang wrote:
>> From: Ke Wang <ke.wang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>
>>
>> sunrpc uses workqueue to clean cache regulary. There is no real dependency
>> of executing work on the cpu which queueing it.
>>
>> On a idle system, especially for a heterogeneous systems like big.LITTLE,
>> it is observed that the big idle cpu was woke up many times just to service
>> this work, which against the principle of power saving. It would be better
>> if we can schedule it on a cpu which the scheduler believes to be the most
>> appropriate one.
>>
>> After apply this patch, system_wq will be replaced by
>> system_power_efficient_wq for sunrpc. This functionality is enabled when
>> CONFIG_WQ_POWER_EFFICIENT is selected.
>
> Makes sense to me, but I'm a little surprised that there isn't a "schedule_delayed_power_efficient_work()" function to match how the normal workqueue is used.
>
> Thanks,
> Anna
>
>>
>> Signed-off-by: Ke Wang <ke.wang-lxIno14LUO0EEoCn2XhGlw@public.gmane.org>
>> ---
>> net/sunrpc/cache.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
>> index 4d8e11f..8aabe12 100644
>> --- a/net/sunrpc/cache.c
>> +++ b/net/sunrpc/cache.c
>> @@ -353,7 +353,7 @@ void sunrpc_init_cache_detail(struct cache_detail *cd)
>> spin_unlock(&cache_list_lock);
>>
>> /* start the cleaning process */
>> - schedule_delayed_work(&cache_cleaner, 0);
>> + queue_delayed_work(system_power_efficient_wq, &cache_cleaner, 0);
>> }
>> EXPORT_SYMBOL_GPL(sunrpc_init_cache_detail);
>>
>> @@ -476,7 +476,8 @@ static void do_cache_clean(struct work_struct *work)
>> delay = 0;
>>
>> if (delay)
>> - schedule_delayed_work(&cache_cleaner, delay);
>> + queue_delayed_work(system_power_efficient_wq,
>> + &cache_cleaner, delay);
>> }
>>
>>
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: 答复: [PATCH] sunrpc: queue work on system_power_efficient_wq
[not found] ` <d72ce63e4a054c8797c9ba92cdad3b5d@SHMBX03.spreadtrum.com>
[not found] ` <d72ce63e4a054c8797c9ba92cdad3b5d-GFC6RAiklXKXEiejXgtQ7QQSgKfZeEaX@public.gmane.org>
@ 2016-09-26 20:56 ` Anna Schumaker
1 sibling, 0 replies; 4+ messages in thread
From: Anna Schumaker @ 2016-09-26 20:56 UTC (permalink / raw)
To: Ke Wang (王科), Chunyan Zhang,
trond.myklebust@primarydata.com, davem@davemloft.net
Cc: linux-nfs@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Hi,
I took a second look at the patch and it still looks okay to me. It's in my git tree for 4.9.
Thanks,
Anna
On 09/19/2016 10:33 PM, Ke Wang (王科) wrote:
> May I have any comments for this patch?
> or
> This patch can be merged directly into next release?
>
> Thanks,
> Ke
> ________________________________________
> 发件人: Anna Schumaker <Anna.Schumaker@netapp.com>
> 发送时间: 2016年9月2日 2:46
> 收件人: Chunyan Zhang; trond.myklebust@primarydata.com; anna.schumaker@netapp.com; davem@davemloft.net
> 抄送: linux-nfs@vger.kernel.org; netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Ke Wang (王科)
> 主题: Re: [PATCH] sunrpc: queue work on system_power_efficient_wq
>
> On 09/01/2016 03:30 AM, Chunyan Zhang wrote:
>> From: Ke Wang <ke.wang@spreadtrum.com>
>>
>> sunrpc uses workqueue to clean cache regulary. There is no real dependency
>> of executing work on the cpu which queueing it.
>>
>> On a idle system, especially for a heterogeneous systems like big.LITTLE,
>> it is observed that the big idle cpu was woke up many times just to service
>> this work, which against the principle of power saving. It would be better
>> if we can schedule it on a cpu which the scheduler believes to be the most
>> appropriate one.
>>
>> After apply this patch, system_wq will be replaced by
>> system_power_efficient_wq for sunrpc. This functionality is enabled when
>> CONFIG_WQ_POWER_EFFICIENT is selected.
>
> Makes sense to me, but I'm a little surprised that there isn't a "schedule_delayed_power_efficient_work()" function to match how the normal workqueue is used.
>
> Thanks,
> Anna
>
>>
>> Signed-off-by: Ke Wang <ke.wang@spreadtrum.com>
>> ---
>> net/sunrpc/cache.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c
>> index 4d8e11f..8aabe12 100644
>> --- a/net/sunrpc/cache.c
>> +++ b/net/sunrpc/cache.c
>> @@ -353,7 +353,7 @@ void sunrpc_init_cache_detail(struct cache_detail *cd)
>> spin_unlock(&cache_list_lock);
>>
>> /* start the cleaning process */
>> - schedule_delayed_work(&cache_cleaner, 0);
>> + queue_delayed_work(system_power_efficient_wq, &cache_cleaner, 0);
>> }
>> EXPORT_SYMBOL_GPL(sunrpc_init_cache_detail);
>>
>> @@ -476,7 +476,8 @@ static void do_cache_clean(struct work_struct *work)
>> delay = 0;
>>
>> if (delay)
>> - schedule_delayed_work(&cache_cleaner, delay);
>> + queue_delayed_work(system_power_efficient_wq,
>> + &cache_cleaner, delay);
>> }
>>
>>
>>
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-09-26 20:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-01 7:30 [PATCH] sunrpc: queue work on system_power_efficient_wq Chunyan Zhang
2016-09-01 18:46 ` Anna Schumaker
[not found] ` <d72ce63e4a054c8797c9ba92cdad3b5d@SHMBX03.spreadtrum.com>
[not found] ` <d72ce63e4a054c8797c9ba92cdad3b5d-GFC6RAiklXKXEiejXgtQ7QQSgKfZeEaX@public.gmane.org>
2016-09-20 5:03 ` 答复: " Chunyan Zhang
2016-09-26 20:56 ` Anna Schumaker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).