[PATCH v5 15/24] virt/steal_monitor: Restore to active on module disable

From: Shrikanth Hegde

Date: Thu Jun 25 2026 - 08:53:09 EST


When the module is not in use, preferred CPUs must be same
as active CPUs.

Even if one disables the module during high steal time, it
still restores the preferred CPUs to be same as active CPUs
to keep disable path simple.

Signed-off-by: Shrikanth Hegde <sshegde@xxxxxxxxxxxxx>
---
v4->v5:
- Modified for steal_monitor

drivers/virt/steal_monitor/sm_core.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/virt/steal_monitor/sm_core.c b/drivers/virt/steal_monitor/sm_core.c
index e320559c6576..b1865fcdff93 100644
--- a/drivers/virt/steal_monitor/sm_core.c
+++ b/drivers/virt/steal_monitor/sm_core.c
@@ -23,6 +23,7 @@ static int __init steal_monitor_init(void)
static void __exit steal_monitor_exit(void)
{
pr_info("steal_monitor is disabled\n");
+ cpumask_copy(&__cpu_preferred_mask, cpu_active_mask);
}

module_init(steal_monitor_init);
--
2.47.3