Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751849AbcCAGvP (ORCPT ); Tue, 1 Mar 2016 01:51:15 -0500 Received: from mail-wm0-f47.google.com ([74.125.82.47]:37156 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751609AbcCAGvN (ORCPT ); Tue, 1 Mar 2016 01:51:13 -0500 MIME-Version: 1.0 In-Reply-To: <1456190570-4475-5-git-send-email-smuckle@linaro.org> References: <1456190570-4475-1-git-send-email-smuckle@linaro.org> <1456190570-4475-5-git-send-email-smuckle@linaro.org> Date: Tue, 1 Mar 2016 14:51:12 +0800 X-Google-Sender-Auth: NhrhEUorPxdR0HD50wqQMIhm4p0 Message-ID: Subject: Re: [RFCv7 PATCH 04/10] sched/fair: add triggers for OPP change requests From: Ricky Liang To: Steve Muckle Cc: Peter Zijlstra , Ingo Molnar , "Rafael J. Wysocki" , open list , linux-pm@vger.kernel.org, Vincent Guittot , Morten Rasmussen , Dietmar Eggemann , Juri Lelli , Patrick Bellasi , Michael Turquette Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1729 Lines: 54 Hi Steve, On Tue, Feb 23, 2016 at 9:22 AM, Steve Muckle wrote: > From: Juri Lelli > > Each time a task is {en,de}queued we might need to adapt the current > frequency to the new usage. Add triggers on {en,de}queue_task_fair() for > this purpose. Only trigger a freq request if we are effectively waking up > or going to sleep. Filter out load balancing related calls to reduce the > number of triggers. > > [smuckle@linaro.org: resolve merge conflicts, define task_new, > use renamed static key sched_freq] > > cc: Ingo Molnar > cc: Peter Zijlstra > Signed-off-by: Juri Lelli > Signed-off-by: Steve Muckle > --- > kernel/sched/fair.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++-- > 1 file changed, 47 insertions(+), 2 deletions(-) > > diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c > index 3437e01..f1f00a4 100644 > --- a/kernel/sched/fair.c > +++ b/kernel/sched/fair.c > @@ -4283,6 +4283,21 @@ static inline void hrtick_update(struct rq *rq) > } > #endif > > +static unsigned long capacity_orig_of(int cpu); > +static int cpu_util(int cpu); > + > +static void update_capacity_of(int cpu) > +{ > + unsigned long req_cap; > + > + if (!sched_freq()) > + return; > + > + /* Convert scale-invariant capacity to cpu. */ > + req_cap = cpu_util(cpu) * SCHED_CAPACITY_SCALE / capacity_orig_of(cpu); > + set_cfs_cpu_capacity(cpu, true, req_cap); > +} > + The change hunks of this patch should probably all depend on CONFIG_SMP as capacity_orig_of() and cpu_util() are only available when CONFIG_SMP is enabled. [snip...] Thanks, Ricky