LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Viresh Kumar <email@example.com>
To: "Rafael J. Wysocki" <firstname.lastname@example.org>
Cc: Rafael Wysocki <email@example.com>,
Ingo Molnar <firstname.lastname@example.org>,
Peter Zijlstra <email@example.com>,
Linux PM <firstname.lastname@example.org>,
Vincent Guittot <email@example.com>,
Claudio Scordino <firstname.lastname@example.org>,
Patrick Bellasi <email@example.com>,
Juri Lelli <firstname.lastname@example.org>,
Joel Fernandes <email@example.com>,
"4 . 12+" <firstname.lastname@example.org>,
Linux Kernel Mailing List <email@example.com>
Subject: Re: [PATCH] sched/schedutil: Don't set next_freq to UINT_MAX
Date: Wed, 9 May 2018 14:11:28 +0530 [thread overview]
Message-ID: <20180509084128.s3nu57njyep4tw2w@vireshk-i7> (raw)
On 08-05-18, 22:54, Rafael J. Wysocki wrote:
> On Tue, May 8, 2018 at 8:42 AM, Viresh Kumar <firstname.lastname@example.org> wrote:
> > The schedutil driver sets sg_policy->next_freq to UINT_MAX on certain
> > occasions:
> > - In sugov_start(), when the schedutil governor is started for a group
> > of CPUs.
> > - And whenever we need to force a freq update before rate-limit
> > duration, which happens when:
> > - there is an update in cpufreq policy limits.
> > - Or when the utilization of DL scheduling class increases.
> > In return, get_next_freq() doesn't return a cached next_freq value but
> > instead recalculates the next frequency. This has some side effects
> > though and may significantly delay a required increase in frequency.
> > In sugov_update_single() we try to avoid decreasing frequency if the CPU
> > has not been idle recently. Consider this scenario, the available range
> > of frequencies for a CPU are from 800 MHz to 2.5 GHz and current
> > frequency is 800 MHz. From one of the call paths
> > sg_policy->need_freq_update is set to true and hence
> > sg_policy->next_freq is set to UINT_MAX. Now if the CPU had been busy,
> > next_f will always be less than UINT_MAX, whatever the value of next_f
> > is. And so even when we wanted to increase the frequency, we will
> > overwrite next_f with UINT_MAX and will not change the frequency
> > eventually. This will continue until the time CPU stays busy. This isn't
> > cross checked with any specific test cases, but rather based on general
> > code review.
> > Fix that by not resetting the sg_policy->need_freq_update flag from
> > sugov_should_update_freq() but get_next_freq() and we wouldn't need to
> > overwrite sg_policy->next_freq anymore.
> > Cc: 4.12+ <email@example.com> # 4.12+
> > Fixes: b7eaf1aab9f8 ("cpufreq: schedutil: Avoid reducing frequency of busy CPUs prematurely")
> The rest of the chantelog is totally disconnected from this commit.
I added the "Fixes" tag because this is exactly the commit after which
this problem started, isn't it?
> So the problem is that sugov_update_single() doesn't check the special
> UNIT_MAX value before assigning sg_policy->next_freq to next_f. Fair
> I don't see why the patch is the right fix for that, however.
I thought not overwriting next_freq makes things much simpler and easy
to review. What else do you have in mind to solve this problem ?
next prev parent reply other threads:[~2018-05-09 8:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 6:42 Viresh Kumar
2018-05-08 20:54 ` Rafael J. Wysocki
2018-05-09 8:41 ` Viresh Kumar [this message]
2018-05-09 8:56 ` Rafael J. Wysocki
2018-05-09 9:15 ` Viresh Kumar
2018-05-09 9:23 ` Rafael J. Wysocki
2018-05-09 9:30 ` Viresh Kumar
2018-05-09 9:32 ` Rafael J. Wysocki
2018-05-09 9:44 ` [PATCH] cpufreq: schedutil: Avoid using invalid next_freq Rafael J. Wysocki
2018-05-09 9:46 ` Viresh Kumar
2018-05-09 10:35 ` [PATCH V2] sched/schedutil: Don't set next_freq to UINT_MAX Viresh Kumar
2018-05-11 20:47 ` [V2] " Joel Fernandes
2018-05-17 10:33 ` Rafael J. Wysocki
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--subject='Re: [PATCH] sched/schedutil: Don'\''t set next_freq to UINT_MAX' \
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).