From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751082AbdJBLNz (ORCPT ); Mon, 2 Oct 2017 07:13:55 -0400 Received: from mail-pf0-f178.google.com ([209.85.192.178]:46516 "EHLO mail-pf0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750903AbdJBLNx (ORCPT ); Mon, 2 Oct 2017 07:13:53 -0400 X-Google-Smtp-Source: AOwi7QCyJKvL06L0Qex/LFMfjS0+xC64vtZPvJzi+abvpl8mOp98/9ryite2TS074LmPGKeI9nfP/g== Date: Mon, 2 Oct 2017 19:13:45 +0800 From: Leo Yan To: Joel Fernandes Cc: Ingo Molnar , Peter Zijlstra , LKML , Dietmar Eggemann , Morten Rasmussen , Chris Redpath , Vincent Guittot , Patrick Bellasi , "Rafael J . Wysocki" Subject: Re: [PATCH v2 2/2] cpufreq: schedutil: consolidate capacity margin calculation Message-ID: <20171002111345.GC18885@leoy-ThinkPad-T440> References: <1506904212-15354-1-git-send-email-leo.yan@linaro.org> <1506904212-15354-2-git-send-email-leo.yan@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Joel, On Sun, Oct 01, 2017 at 06:02:24PM -0700, Joel Fernandes wrote: > Hi Leo, > > On Sun, Oct 1, 2017 at 5:30 PM, Leo Yan wrote: > > Scheduler CFS class has variable 'capacity_margin' to calculate the > > s/calculate/represent/ ? > > > capacity margin, and schedutil governor also needs to compensate the > > same margin for frequency tipping point. Below are formulas used in > > CFS class and schedutil governor separately: > > > > CFS: U` = U * capacity_margin / 1024 = U * 1.25 > > You should mention in the commit message, at the moment > capacity_margin is 1280 which makes U` = 1.25. > > > Schedutil: U` = U + U >> 2 = U + U * 0.25 = U * 1.25 > > > > This patch consolidates the capacity margin calculation so let > > schedutil to use same formula with CFS class. As result this can avoid > > As a result. > > > the mismatch issue between schedutil and CFS class after change > > 'capacity_margin' to other values. > > This didn't make sense to me. May be you meant: > > This patch consolidates the usage of the capacity margin value and > lets schedutil use the same formula as the CFS class. Thus we can > avoid the mismatch between schedutil and CFS class if > 'capacity_margin' is changed to other values in the future. Yeah, thanks for the suggestion. And accept all upper comment. Will refine for new patch. Thanks, Leo Yan > > Cc: Dietmar Eggemann > > Cc: Morten Rasmussen > > Cc: Chris Redpath > > Cc: Joel Fernandes > > Cc: Vincent Guittot > > Cc: Patrick Bellasi > > Cc: Rafael J. Wysocki > > Signed-off-by: Leo Yan > > --- > > kernel/sched/cpufreq_schedutil.c | 6 ++++-- > > kernel/sched/sched.h | 1 + > > 2 files changed, 5 insertions(+), 2 deletions(-) > > > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > > index 9209d83..13cc243 100644 > > --- a/kernel/sched/cpufreq_schedutil.c > > +++ b/kernel/sched/cpufreq_schedutil.c > > @@ -155,7 +155,8 @@ static void sugov_update_commit(struct sugov_policy *sg_policy, u64 time, > > * > > * next_freq = C * curr_freq * util_raw / max > > * > > - * Take C = 1.25 for the frequency tipping point at (util / max) = 0.8. > > + * Take C = capacity_margin / 1024 = 1.25, so it's for the frequency tipping > > + * point at (util / max) = 0.8. > > The above comment assumes capacity_margin is 1280. If for any reason > the capacity_margin is changed to something else, then the comment > wont make sense anymore. > > thanks, > > - Joel