Thread (7 messages) read the whole thread 7 messages, 2 authors, 2025-12-01

Re: [PATCH v2 2/2] powerpc/smp: Disable steal from updating CPU capacity

From: Vincent Guittot <vincent.guittot@linaro.org>
Date: 2025-11-03 08:47:31
Also in: lkml

Hi Sikar,

On Wed, 29 Oct 2025 at 09:32, Srikar Dronamraju [off-list ref] wrote:
* Vincent Guittot [off-list ref] [2025-10-29 08:43:34]:
quoted
Hi Srikar,

On Wed, 29 Oct 2025 at 07:09, Srikar Dronamraju [off-list ref] wrote:
quoted
In a shared LPAR with SMT enabled, it has been observed that when a CPU
experiences steal time, it can trigger task migrations between sibling
CPUs. The idle CPU pulls a runnable task from its sibling that is
impacted by steal, making the previously busy CPU go idle. This reversal
IIUC, the migration is triggered by the reduced capacity case when
there is 1 task on the CPU
Thanks Vincent for taking a look at the change.

Yes, Lets assume we have 3 threads running on 6 vCPUs backed by 2 Physical
cores. So only 3 vCPUs (0,1,2) would be busy and other 3 (3,4,5) will be
idle. The vCPUs that are busy will start seeing steal time of around 33%
because they cant run completely on the Physical CPU. Without the change,
they will start seeing their capacity decrease. While the idle vCPUs(3,4,5)
ones will have their capacity intact. So when the scheduler switches the 3
tasks to the idle vCPUs, the newer busy vCPUs (3,4,5) will start seeing steal
and hence see their CPU capacity drops while the newer idle vCPUs (0,1,2)
will see their capacity increase since their steal time reduces. Hence the
tasks will be migrated again.
Thanks for the details
This is probably even more visible when vcpu are not pinned to separate cpu

quoted
quoted
can repeat continuously, resulting in ping-pong behavior between SMT
siblings.
Does it mean that the vCPU generates its own steal time or is it
because other vcpus are already running on the other CPU and they
starts to steal time on the sibling vCPU
There are other vCPUs running and sharing the same Physical CPU, and hence
these vCPUs are seeing steal time.
quoted
quoted
To avoid migrations solely triggered by steal time, disable steal from
updating CPU capacity when running in shared processor mode.
You are disabling the steal time accounting only for your arch. Does
it mean that only powerpc are impacted by this effect ?
On PowerVM, the hypervisor schedules at a core granularity. So in the above
scenario, if we assume SMT to be 2, then we have 3 vCores and 1 Physical
core. So even if 2 threads are running, they would be scheduled on 2 vCores
and hence we would start seeing 50% steal. So this steal accounting is more
predominant on Shared LPARs running on PowerVM.

However we can use this same mechanism on other architectures too since the
framework is arch independent.

Does this clarify?
yes, thanks
I see 2 problems in your use case, the idle cpu doesn't have steal
time even if the host cpu on which it will run, is already busy with
other things
and with not pinned vcpu, we can't estimate what will be the steal
time on the target host
And I don't see a simple way other than disabling steal time
--
Thanks and Regards
Srikar Dronamraju
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help