Received: by 10.223.164.202 with SMTP id h10csp127632wrb; Thu, 30 Nov 2017 07:56:19 -0800 (PST) X-Google-Smtp-Source: AGs4zMYcT8rltd0D2CVXj3mOYdkM4rkG5GOTKRepKVMRntoQjH2cyoc91jar5sEQ570XweCgagVV X-Received: by 10.99.144.68 with SMTP id a65mr2877402pge.429.1512057379770; Thu, 30 Nov 2017 07:56:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1512057379; cv=none; d=google.com; s=arc-20160816; b=CpaovG3cnUx5ACCEh5g033bVfS66jsni8YQDt+W/2BXoPlruKXqfrVeeQKwEaB9BK8 hRHYmKaw67wedDHGKReeAU73KBP+BSvIACpHg5uO7fdRS0gDFeKzWHbUVoSrzVqCIokg cQCK081pcNwMfWrWNWxSCAV8CN9or1BeHKtu9DeSNB9u5irwGYEx2C0cSxT6+Rl2cPF0 e6SaZcVgpldprKmF4XFNc0kDRqHjouPdvvFhLAWR2+V1K4Whiy6LubpeHuV+alknJ6Ab sCFA0Ba/rSoel3mLpGymRYIm/CHxEieLaDMIZXAWf4cIQ7ePjn+zml32/i0mj6ny+kFM 5qjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=q353ilNkEdlN8qUaHhFeA0iHJbZdPfnxWAFE/R55aU4=; b=ERDef6vu99VJyES37nGTIezGvksSUcKN1uH2cflJ9FyVNsea9q8LdcUH5HFQftpRWQ 5bUEdyqHAQkLC5kqmWgOvRvHqy45iySooxYrSHcsRdzBM82r3CtjWnOlVn7yl+0Xtql5 Efu9MKZ66o79LKxVG6xTpqMnd74TLfG0h3wYXVr7FwfMH+feMl3dAXOwh8t+HAdFJI54 WuvgwVDtYSxhwQRp0e6AnuWwghltmcbBNmxPHU5kXeQpiNQY8/FzJCPYIxa2C7IRD9c3 RNxfaGmwxt4uMbbCm9Fh/V5aPNtsl7oZhQks7rBp91utHjhjDxlbjTsuBC3lah2fOVNK ITxw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m23si3193132pgc.165.2017.11.30.07.56.06; Thu, 30 Nov 2017 07:56:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752619AbdK3PyK (ORCPT + 99 others); Thu, 30 Nov 2017 10:54:10 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:56598 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752135AbdK3PyI (ORCPT ); Thu, 30 Nov 2017 10:54:08 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 861B11529; Thu, 30 Nov 2017 07:54:08 -0800 (PST) Received: from e110439-lin (e110439-lin.cambridge.arm.com [10.1.210.68]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 728133F318; Thu, 30 Nov 2017 07:54:06 -0800 (PST) Date: Thu, 30 Nov 2017 15:54:03 +0000 From: Patrick Bellasi To: Juri Lelli Cc: linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, Ingo Molnar , Peter Zijlstra , "Rafael J . Wysocki" , Viresh Kumar , Vincent Guittot , Dietmar Eggemann , Morten Rasmussen , Todd Kjos , Joel Fernandes Subject: Re: [PATCH v3 5/6] cpufreq: schedutil: relax rate-limiting while running RT/DL tasks Message-ID: <20171130155403.GE31247@e110439-lin> References: <20171130114723.29210-1-patrick.bellasi@arm.com> <20171130114723.29210-6-patrick.bellasi@arm.com> <20171130133642.GE9903@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171130133642.GE9903@localhost.localdomain> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30-Nov 14:36, Juri Lelli wrote: > Hi, > > On 30/11/17 11:47, Patrick Bellasi wrote: > > The policy in use for RT/DL tasks sets the maximum frequency when a task > > in these classes calls for a cpufreq_update_util(). However, the > > current implementation is still enforcing a frequency switch rate > > limiting when these tasks are running. > > This is potentially working against the goal to switch to the maximum OPP > > when RT tasks are running. In certain unfortunate cases it can also happen > > that a RT task almost completes its activation at a lower OPP. > > > > This patch overrides on purpose the rate limiting configuration > > to better serve RT/DL tasks. As long as a frequency scaling operation > > is not in progress, a frequency switch is always authorized when > > running in "rt_mode", i.e. the current task in a CPU belongs to the > > RT/DL class. > > > > Signed-off-by: Patrick Bellasi > > Reviewed-by: Dietmar Eggemann > > Cc: Ingo Molnar > > Cc: Peter Zijlstra > > Cc: Rafael J. Wysocki > > Cc: Viresh Kumar > > Cc: linux-kernel@vger.kernel.org > > Cc: linux-pm@vger.kernel.org > > > > --- > > Changes from v2: > > - rebased on v4.15-rc1 > > > > Change-Id: I733d47b9e265cebb2e3e5e71a3cd468e9be002d1 > > Luckily this gets ignored... :) Indeed, and it was intended... just to verify if ML folks can tolerate the idea to have Change-Ids in the "notes section". This would help some internal review workflow, which sometimes are based... yes... ehm... on gerrit :-] > > --- > > kernel/sched/cpufreq_schedutil.c | 19 ++++++++++++------- > > 1 file changed, 12 insertions(+), 7 deletions(-) > > > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c > > index 40521d59630b..3eea8884e61b 100644 > > --- a/kernel/sched/cpufreq_schedutil.c > > +++ b/kernel/sched/cpufreq_schedutil.c > > @@ -74,7 +74,8 @@ static DEFINE_PER_CPU(struct sugov_cpu, sugov_cpu); > > > > /************************ Governor internals ***********************/ > > > > -static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) > > +static bool sugov_should_update_freq(struct sugov_policy *sg_policy, > > + u64 time, bool rt_mode) > > { > > s64 delta_ns; > > > > @@ -111,6 +112,10 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) > > return true; > > } > > > > + /* Always update if a RT/DL task is running */ > > + if (rt_mode) > > + return true; > > + > > delta_ns = time - sg_policy->last_freq_update_time; > > return delta_ns >= sg_policy->freq_update_delay_ns; > > } > > @@ -268,11 +273,6 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, > > sugov_set_iowait_boost(sg_cpu, time, flags); > > sg_cpu->last_update = time; > > > > - if (!sugov_should_update_freq(sg_policy, time)) > > - return; > > - > > - busy = sugov_cpu_is_busy(sg_cpu); > > - > > /* > > * While RT/DL tasks are running we do not want FAIR tasks to > > * overvrite this CPU's flags, still we can update utilization and > > @@ -281,6 +281,11 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, > > rt_mode = task_has_dl_policy(current) || > > task_has_rt_policy(current) || > > (flags & SCHED_CPUFREQ_RT_DL); > > + if (!sugov_should_update_freq(sg_policy, time, rt_mode)) > > + return; > > + > > + busy = sugov_cpu_is_busy(sg_cpu); > > + > > if (rt_mode) { > > next_f = policy->cpuinfo.max_freq; > > } else { > > @@ -379,7 +384,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > > sugov_set_iowait_boost(sg_cpu, time, flags); > > sg_cpu->last_update = time; > > > > - if (sugov_should_update_freq(sg_policy, time)) { > > + if (sugov_should_update_freq(sg_policy, time, rt_mode)) { > > next_f = rt_mode > > ? sg_policy->policy->cpuinfo.max_freq > > : sugov_next_freq_shared(sg_cpu, time); > > Reviewed-by: Juri Lelli Tks ;-) > I wonder if we would also need some way to trigger a back to back update > as soon as a currently running one finishes and an RT/DL task asked for > an update (without waiting for the next tick). Good point, I think that would actually be an interesting optimization. We already discussed that in the past, but refrained by adding more on top of this already "substantial" set of changes. Can we think about that once we decided about some patches of this series? > Best, > > Juri Cheers Patrick -- #include Patrick Bellasi From 1585498332592104858@xxx Thu Nov 30 13:37:18 +0000 2017 X-GM-THRID: 1585491498407736730 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread