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]
Date:   Wed, 04 Jan 2023 17:47:58 +0200
From:   ypodemsk@...hat.com
To:     Giovanni Gherdovich <ggherdovich@...e.cz>, peterz@...radead.org,
        mingo@...hat.com, juri.lelli@...hat.com,
        vincent.guittot@...aro.org, dietmar.eggemann@....com,
        rostedt@...dmis.org, bsegall@...gle.com, mgorman@...e.de,
        bristot@...hat.com, vschneid@...hat.com,
        rafael.j.wysocki@...el.com, jlelli@...hat.com, mtosatti@...hat.com,
        nsaenz@...nel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] sched/core: Fix arch_scale_freq_tick() on tickless
 systems

Friendly ping

On Wed, 2022-12-14 at 16:35 +0100, Giovanni Gherdovich wrote:
> On Wed, 2022-11-30 at 14:51 +0200, Yair Podemsky wrote:
> > In order for the scheduler to be frequency invariant we measure the
> > ratio between the maximum cpu frequency and the actual cpu
> > frequency.
> > During long tickless periods of time the calculations that keep
> > track
> > of that might overflow, in the function scale_freq_tick():
> > 
> > if (check_shl_overflow(acnt, 2*SCHED_CAPACITY_SHIFT, &acnt))
> > ยป       goto error;
> > 
> > eventually forcing the kernel to disable the feature for all cpus,
> > and show the warning message
> > "Scheduler frequency invariance went wobbly, disabling!".
> > Let's avoid that by limiting the frequency invariant calculations
> > to cpus with regular tick.
> > 
> > Fixes: e2b0d619b400 ("x86, sched: check for counters overflow in
> > frequency invariant accounting")
> > Signed-off-by: Yair Podemsky <ypodemsk@...hat.com>
> > Suggested-by: "Peter Zijlstra (Intel)" <peterz@...radead.org>
> 
> Acked-by: Giovanni Gherdovich <ggherdovich@...e.cz>
> 
> > ---
> > V1 -> V2: solution approach was changed from detecting long
> > tickless periods
> > to frequency invariant measurements on housekeeping cpus only.
> > Link: ee89073a1e9de11c7bd7726eb5da71a0e8795099.camel@...hat.com
> > ---
> >  kernel/sched/core.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/kernel/sched/core.c b/kernel/sched/core.c
> > index daff72f00385..1bb0a840c817 100644
> > --- a/kernel/sched/core.c
> > +++ b/kernel/sched/core.c
> > @@ -5469,7 +5469,9 @@ void scheduler_tick(void)
> >  	unsigned long thermal_pressure;
> >  	u64 resched_latency;
> >  
> > -	arch_scale_freq_tick();
> > +	if (housekeeping_cpu(cpu, HK_TYPE_TICK))
> > +		arch_scale_freq_tick();
> > +
> >  	sched_clock_tick();
> >  
> >  	rq_lock(rq, &rf);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ