From: Eduardo Valentin <edubezval@gmail.com>
To: Leo Yan <leo.yan@linaro.org>
Cc: Zhang Rui <rui.zhang@intel.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Vincent Guittot <vincent.guittot@linaro.org>
Subject: Re: [PATCH] thermal: Use power efficient workqueue
Date: Wed, 10 Jan 2018 11:28:05 -0800 [thread overview]
Message-ID: <20180110192803.GC3837@localhost.localdomain> (raw)
In-Reply-To: <1514971456-2877-1-git-send-email-leo.yan@linaro.org>
On Wed, Jan 03, 2018 at 05:24:16PM +0800, Leo Yan wrote:
> Thermal core framework uses the system_freezable_wq workqueue as its
> workqueue for polling temperature. Using system_freezable_wq workqueue
> prevents the scheduler to make smart decision about the best place to
> schedule the work.
>
> This commit replaces system_freezable_wq with
> system_freezable_power_efficient_wq. With kernel configuration
> CONFIG_WQ_POWER_EFFICIENT is enabled, the work can be scheduled on the
> best CPU from a power or a performance point of view.
>
> This commit is inspired by Vincent Guittot patch "netfilter: conntrack:
> use power efficient workqueue" and verified on 96boards Hikey960.
The case may not be the same as for netfilter and for thermal.
what is the worst case scheduling delay here?
More importantly, what problem are you really trying to solve?
Do you have a case in which thermal WQs are consuming too much CPUs?
Do you care describing (also in the commit)?
>
> Cc: Eduardo Valentin <edubezval@gmail.com>
> Cc: Zhang Rui <rui.zhang@intel.com>
> Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
> Cc: Vincent Guittot <vincent.guittot@linaro.org>
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> ---
> drivers/thermal/thermal_core.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
> index 2b1b0ba..ba90f71 100644
> --- a/drivers/thermal/thermal_core.c
> +++ b/drivers/thermal/thermal_core.c
> @@ -293,11 +293,12 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
> int delay)
> {
> if (delay > 1000)
> - mod_delayed_work(system_freezable_wq, &tz->poll_queue,
> + mod_delayed_work(system_freezable_power_efficient_wq,
> + &tz->poll_queue,
> round_jiffies(msecs_to_jiffies(delay)));
> else if (delay)
> - mod_delayed_work(system_freezable_wq, &tz->poll_queue,
> - msecs_to_jiffies(delay));
> + mod_delayed_work(system_freezable_power_efficient_wq,
> + &tz->poll_queue, msecs_to_jiffies(delay));
> else
> cancel_delayed_work(&tz->poll_queue);
> }
> --
> 2.7.4
>
prev parent reply other threads:[~2018-01-10 19:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-03 9:24 [PATCH] thermal: Use power efficient workqueue Leo Yan
2018-01-03 9:43 ` Vincent Guittot
2018-01-10 19:28 ` Eduardo Valentin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180110192803.GC3837@localhost.localdomain \
--to=edubezval@gmail.com \
--cc=daniel.lezcano@linaro.org \
--cc=leo.yan@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rui.zhang@intel.com \
--cc=vincent.guittot@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).