lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAB8ipk-5vSLHkW9h26Zduvn4t7CG3dNKS2d5Xb1f9MXtgX2J4g@mail.gmail.com>
Date: Thu, 10 Apr 2025 10:42:00 +0800
From: Xuewen Yan <xuewen.yan94@...il.com>
To: Sultan Alsawaf <sultan@...neltoast.com>
Cc: Stephan Gerhold <stephan.gerhold@...aro.org>, "Rafael J. Wysocki" <rafael@...nel.org>, 
	Viresh Kumar <viresh.kumar@...aro.org>, Ingo Molnar <mingo@...hat.com>, 
	Peter Zijlstra <peterz@...radead.org>, Juri Lelli <juri.lelli@...hat.com>, 
	Vincent Guittot <vincent.guittot@...aro.org>, Dietmar Eggemann <dietmar.eggemann@....com>, 
	Steven Rostedt <rostedt@...dmis.org>, Ben Segall <bsegall@...gle.com>, Mel Gorman <mgorman@...e.de>, 
	Valentin Schneider <vschneid@...hat.com>, linux-pm@...r.kernel.org, 
	linux-kernel@...r.kernel.org, regressions@...ts.linux.dev, 
	Johan Hovold <johan@...nel.org>
Subject: Re: [PATCH 1/2] cpufreq: schedutil: Fix superfluous updates caused by need_freq_update

On Thu, Apr 10, 2025 at 10:33 AM Sultan Alsawaf <sultan@...neltoast.com> wrote:
>
> On Thu, Apr 10, 2025 at 10:30:45AM +0800, Xuewen Yan wrote:
> > On Thu, Apr 10, 2025 at 10:22 AM Sultan Alsawaf <sultan@...neltoast.com> wrote:
> > >
> > > On Thu, Apr 10, 2025 at 10:13:04AM +0800, Xuewen Yan wrote:
> > > > On Thu, Apr 10, 2025 at 10:09 AM Sultan Alsawaf <sultan@...neltoast.com> wrote:
> > > > >
> > > > > On Thu, Apr 10, 2025 at 10:06:41AM +0800, Xuewen Yan wrote:
> > > > > > On Thu, Apr 10, 2025 at 9:49 AM Sultan Alsawaf <sultan@...neltoast.com> wrote:
> > > > > > >
> > > > > > > On Wed, Apr 09, 2025 at 07:48:05PM +0800, Xuewen Yan wrote:
> > > > > > > > Or can we modify it as follows?
> > > > > > > >
> > > > > > > > -->8--
> > > > > > > >
> > > > > > > > diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> > > > > > > > index 1a19d69b91ed..0e8d3b92ffe7 100644
> > > > > > > > --- a/kernel/sched/cpufreq_schedutil.c
> > > > > > > > +++ b/kernel/sched/cpufreq_schedutil.c
> > > > > > > > @@ -83,7 +83,7 @@ static bool sugov_should_update_freq(struct
> > > > > > > > sugov_policy *sg_policy, u64 time)
> > > > > > > >
> > > > > > > >         if (unlikely(sg_policy->limits_changed)) {
> > > > > > > >                 sg_policy->limits_changed = false;
> > > > > > > > -               sg_policy->need_freq_update =
> > > > > > > > cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS);
> > > > > > > > +               sg_policy->need_freq_update = true;
> > > > > > > >                 return true;
> > > > > > > >         }
> > > > > > > >
> > > > > > > > @@ -95,11 +95,15 @@ static bool sugov_should_update_freq(struct
> > > > > > > > sugov_policy *sg_policy, u64 time)
> > > > > > > >  static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time,
> > > > > > > >                                    unsigned int next_freq)
> > > > > > > >  {
> > > > > > > > -       if (sg_policy->need_freq_update)
> > > > > > > > +       if (sg_policy->need_freq_update) {
> > > > > > > >                 sg_policy->need_freq_update = false;
> > > > > > > > -       else if (sg_policy->next_freq == next_freq)
> > > > > > > > -               return false;
> > > > > > > > +               if (cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS))
> > > > > > > > +                       goto change;
> > > > > > > > +       }
> > > > > > > >
> > > > > > > > +       if (sg_policy->next_freq == next_freq)
> > > > > > > > +               return false;
> >
> > I have deleted the else.
>
> Yes, but your change causes a regression by recreating part of the problem
> solved in 8e461a1cb43d6 ("cpufreq: schedutil: Fix superfluous updates caused by
> need_freq_update").

Hi, Sultan,

Did I miss anything?

@@ -95,11 +95,15 @@ static bool sugov_should_update_freq(struct
sugov_policy *sg_policy, u64 time)
 static bool sugov_update_next_freq(struct sugov_policy *sg_policy, u64 time,
                                   unsigned int next_freq)
 {
-       if (sg_policy->need_freq_update)
+       if (sg_policy->need_freq_update) {
                sg_policy->need_freq_update = false;
-       else if (sg_policy->next_freq == next_freq)
-               return false;
+               if (cpufreq_driver_test_flags(CPUFREQ_NEED_UPDATE_LIMITS))
+                       goto change;
+       }

+       if (sg_policy->next_freq == next_freq)
+               return false;
+change:
        sg_policy->next_freq = next_freq;
        sg_policy->last_freq_update_time = time;

---
The patch set the need_freq_update to be false Unconditionally.
Is there another issue ?

Thanks!

>
> Sultan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ