]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
sched/core: Fix unbalance set_rq_online/offline() in sched_cpu_deactivate()
authorYang Yingliang <yangyingliang@huawei.com>
Wed, 3 Jul 2024 03:16:10 +0000 (11:16 +0800)
committerPeter Zijlstra <peterz@infradead.org>
Mon, 29 Jul 2024 10:22:33 +0000 (12:22 +0200)
If cpuset_cpu_inactive() fails, set_rq_online() need be called to rollback.

Fixes: 120455c514f7 ("sched: Fix hotplug vs CPU bandwidth control")
Cc: stable@kernel.org
Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20240703031610.587047-5-yangyingliang@huaweicloud.com
kernel/sched/core.c

index 4d119e930beb1bbb1372f764d1ed66df20418c65..f3951e4a55e5b6078142f2f2b44359b7560e6e4f 100644 (file)
@@ -8022,6 +8022,7 @@ int sched_cpu_deactivate(unsigned int cpu)
        ret = cpuset_cpu_inactive(cpu);
        if (ret) {
                sched_smt_present_inc(cpu);
+               sched_set_rq_online(rq, cpu);
                balance_push_set(cpu, false);
                set_cpu_active(cpu, true);
                sched_update_numa(cpu, true);