[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251201220258.651c7d08@pumpkin>
Date: Mon, 1 Dec 2025 22:02:58 +0000
From: David Laight <david.laight.linux@...il.com>
To: Vincent Guittot <vincent.guittot@...aro.org>
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 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.
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