From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752805AbdK3NSG (ORCPT ); Thu, 30 Nov 2017 08:18:06 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:44155 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750742AbdK3NSE (ORCPT ); Thu, 30 Nov 2017 08:18:04 -0500 X-Google-Smtp-Source: AGs4zMYkxWPrbVSyIoXO1lTW4w8k0utI0GIHeEFKcqkSoAuMcsEAgWyVDtn1Q8YgrESq5xLNC1cVWg== Date: Thu, 30 Nov 2017 14:17:59 +0100 From: Juri Lelli To: Patrick Bellasi 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 , Steve Muckle Subject: Re: [PATCH v3 2/6] cpufreq: schedutil: ensure max frequency while running RT/DL tasks Message-ID: <20171130131759.GB9903@localhost.localdomain> References: <20171130114723.29210-1-patrick.bellasi@arm.com> <20171130114723.29210-3-patrick.bellasi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171130114723.29210-3-patrick.bellasi@arm.com> User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 30/11/17 11:47, Patrick Bellasi wrote: [...] > @@ -340,6 +349,7 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > struct sugov_policy *sg_policy = sg_cpu->sg_policy; > unsigned long util, max; > unsigned int next_f; > + bool rt_mode; > > sugov_get_util(&util, &max, sg_cpu->cpu); > > @@ -353,17 +363,27 @@ static void sugov_update_shared(struct update_util_data *hook, u64 time, > sg_cpu->flags = 0; > goto done; > } > - sg_cpu->flags = flags; > + > + /* > + * While RT/DL tasks are running we do not want FAIR tasks to > + * overwrite this CPU's flags, still we can update utilization and > + * frequency (if required/possible) to be fair with these tasks. > + */ > + rt_mode = task_has_dl_policy(current) || > + task_has_rt_policy(current) || > + (flags & SCHED_CPUFREQ_RT_DL); > + if (rt_mode) > + sg_cpu->flags |= flags; > + else > + sg_cpu->flags = flags; > > sugov_set_iowait_boost(sg_cpu, time, flags); > sg_cpu->last_update = time; > > if (sugov_should_update_freq(sg_policy, time)) { > - if (flags & SCHED_CPUFREQ_RT_DL) > - next_f = sg_policy->policy->cpuinfo.max_freq; > - else > - next_f = sugov_next_freq_shared(sg_cpu, time); > - > + next_f = rt_mode > + ? sg_policy->policy->cpuinfo.max_freq > + : sugov_next_freq_shared(sg_cpu, time); > sugov_update_commit(sg_policy, time, next_f); Aren't we already at max_freq at this point (since an RT/DL task is running)? Do we need to trigger a frequency update? Best, Juri