linux/kernel/sched
Zqiang ccaeeb585c sched_ext: Use the resched_cpu() to replace resched_curr() in the bypass_lb_node()
For the PREEMPT_RT kernels, the scx_bypass_lb_timerfn() running in the
preemptible per-CPU ktimer kthread context, this means that the following
scenarios will occur(for x86 platform):

       cpu1                          cpu2
				 ktimer kthread:
                                 ->scx_bypass_lb_timerfn
                                   ->bypass_lb_node
                                     ->for_each_cpu(cpu, resched_mask)

    migration/1:                       by preempt by migration/2:
    multi_cpu_stop()                     multi_cpu_stop()
    ->take_cpu_down()
      ->__cpu_disable()
	->set cpu1 offline

                                       ->rq1 = cpu_rq(cpu1)
                                       ->resched_curr(rq1)
                                         ->smp_send_reschedule(cpu1)
					   ->native_smp_send_reschedule(cpu1)
					     ->if(unlikely(cpu_is_offline(cpu))) {
                					WARN(1, "sched: Unexpected
							reschedule of offline CPU#%d!\n", cpu);
                					return;
        					}

This commit therefore use the resched_cpu() to replace resched_curr()
in the bypass_lb_node() to avoid send-ipi to offline CPUs.

Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Reviewed-by: Andrea Righi <arighi@nvidia.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2025-12-22 17:51:51 -10:00
..
Makefile
autogroup.c
autogroup.h
build_policy.c
build_utility.c
clock.c
completion.c
core.c
core_sched.c
cpuacct.c
cpudeadline.c
cpudeadline.h
cpufreq.c
cpufreq_schedutil.c
cpupri.c
cpupri.h
cputime.c
deadline.c
debug.c
ext.c sched_ext: Use the resched_cpu() to replace resched_curr() in the bypass_lb_node() 2025-12-22 17:51:51 -10:00
ext.h
ext_idle.c
ext_idle.h
ext_internal.h
fair.c
features.h
idle.c
isolation.c
loadavg.c
membarrier.c
pelt.c
pelt.h
psi.c
rq-offsets.c
rt.c
sched-pelt.h
sched.h
smp.h
stats.c
stats.h
stop_task.c
swait.c
syscalls.c
topology.c
wait.c
wait_bit.c