Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753749AbeAJT2D (ORCPT + 1 other); Wed, 10 Jan 2018 14:28:03 -0500 Received: from mail-pg0-f66.google.com ([74.125.83.66]:40582 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752951AbeAJT17 (ORCPT ); Wed, 10 Jan 2018 14:27:59 -0500 X-Google-Smtp-Source: ACJfBovFoGMg3ACc5RXQW0k9Qzip/SCFdikIbEC/+xIdpguMKI4/1tOlUKTjObnUp1Hh23cDrxphdQ== Date: Wed, 10 Jan 2018 11:28:05 -0800 From: Eduardo Valentin To: Leo Yan Cc: Zhang Rui , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Daniel Lezcano , Vincent Guittot Subject: Re: [PATCH] thermal: Use power efficient workqueue Message-ID: <20180110192803.GC3837@localhost.localdomain> References: <1514971456-2877-1-git-send-email-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1514971456-2877-1-git-send-email-leo.yan@linaro.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: 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 > Cc: Zhang Rui > Cc: Daniel Lezcano > Cc: Vincent Guittot > Signed-off-by: Leo Yan > --- > 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 >