Re: [PATCH 6/7] virt: steal_governor: restart sampling immediately after CPU hotplug
From: Yury Norov
Date: Fri Nov 20 2026 - 10:37:14 EST
On Fri, Nov 20, 2026 at 02:20:21PM +0530, Shrikanth Hegde wrote:
>
>
> On 11/19/26 11:09 PM, Yury Norov wrote:
> > On Thu, Nov 19, 2026 at 11:36:46AM +0530, Shrikanth Hegde wrote:
> > > Hi Yury.
> > >
> > > On 11/14/26 12:12 AM, Yury Norov wrote:
> > > > CPU hotplug between samples can distort the calculated steal ratio because
> > > > the governor divides accumulated steal time by the current active CPU
> > > > count, even when that count changed during the sampling interval.
> > > >
> > > > For example, assume a constant 3% steal rate on each CPU, with four active
> > > > CPUs for 900ms followed by two active CPUs for 100ms. The accumulated
> > > > steal time is:
> > > >
> > > > 4 * 900ms * 3% + 2 * 100ms * 3% = 108ms + 6ms = 114ms
> > >
> > >
> > > This example is not realistic. If you had 3% steal with 4 CPUs, and if they become 2,
> > > your steal time will definitely increase. It will likely double. So
> > > governor likely calculates 6%.
> >
> > You say it's not realistic, and then you confirm the math. So
> > realistic or not?
>
> I do not expect the steal time to remain consistent across after hotplug
> completes.
>
> Instead of speculating, we should to get the numbers from the actual systems.
You're very welcome to stop speculating and run your own experiments,
if you don't trust the above.