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: <CAKfTPtAq67bpoHP01MDLnVBX-F=UzAJjNmZAcqWqkVwc8A-tGQ@mail.gmail.com>
Date: Tue, 2 Dec 2025 14:24:19 +0100
From: Vincent Guittot <vincent.guittot@...aro.org>
To: David Laight <david.laight.linux@...il.com>
Cc: mingo@...hat.com, peterz@...radead.org, juri.lelli@...hat.com, 
	dietmar.eggemann@....com, rostedt@...dmis.org, bsegall@...gle.com, 
	mgorman@...e.de, vschneid@...hat.com, linux-kernel@...r.kernel.org, 
	pierre.gondois@....com, kprateek.nayak@....com, qyousef@...alina.io, 
	hongyan.xia2@....com, christian.loehle@....com, luis.machado@....com
Subject: Re: [PATCH 0/6 v7] sched/fair: Add push task mecansim and hadle more
 EAS cases

On Mon, 1 Dec 2025 at 23:03, David Laight <david.laight.linux@...il.com> wrote:
>
> On Mon,  1 Dec 2025 10:13:02 +0100
> Vincent Guittot <vincent.guittot@...aro.org> wrote:
>
> ...
>
> If you've got sched/fair.c out on the operating table have a look at all the
> code that multiplies by PELT_MIN_DIVISOR (about 48k).
> There are max_t(u32) that (I think) mask the product to 32bits (on 64bit)
> before assigning to a u64.

I'm going to have a look. Some stay in the 32 bits range like util_sum
but some others don't and we have scale_load_down() which is either a
nop or >> 10 in the picture

> Conversely on 32bit the product is only 32bits - even though it is assigned
> to a u64.
>
> There might a valid justification for the 'utilisation' fitting in 32bits,
> but I'm not sure it applies to any of the other fields.
>
> There are also all the 'long' variables in the code - which change size
> between 32bit and 64bit.
> I failed to spot an explanation as to why this is valid.
> I suspect they should all be either u32 or u64.
>
> This all means that variables the 'runnable_sum' may be truncated and much
> smaller than they ought to be.
> I think that means the scheduler can incorrectly think a 'session' is idle
> when, in fact, it is very busy.
>
> I didn't do a full analysis of the code, just looked at a few expressions.
>
> The 64bit code calculates 'long_var * PELT_MIN_DIVISOR' to get a 64bit product.
> Doing a full 64x64 multiply if 32bit is rather more expensive.
> Given PELT_MIN_DIVISOR is just a scale factor to get extra precision
> (I think the product decays with time) multiplying by 32768 would be much
> cheaper and have much the same effect.
>
>         David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ