Re: [PATCH 6/7] virt: steal_governor: restart sampling immediately after CPU hotplug
From: Yury Norov
Date: Sun Nov 15 2026 - 21:13:35 EST
> static void steal_governor_loop(struct work_struct *work)
> {
> u64 curr_steal, delta_steal, delta_ns, steal_ratio;
> @@ -233,6 +243,11 @@ static void steal_governor_loop(struct work_struct *work)
> sg_ctx.steal = curr_steal;
> sg_ctx.time = now;
>
> + if (sg_ctx.sample_invalidated) {
> + sg_ctx.sample_invalidated = false;
> + goto requeue_work;
> + }
> +
> /*
> * steal_ratio = (delta_steal * 100*100)/(delta_ns * num_cpus())
> * To avoid possible overflow, divide the denominator early.
> @@ -254,11 +269,14 @@ static void steal_governor_loop(struct work_struct *work)
> return;
> }
>
> - schedule_delayed_work(&sg_ctx.work, sg_ctx.delay);
> +requeue_work:
> + mod_delayed_work(system_wq, &sg_ctx.work, sg_ctx.delay);
Sashiko has correctly pointed it should be system_percpu_wq.
> }