linux/kernel/sched
Peter Zijlstra 5324953c06 sched/core: Fix wakeup_preempt's next_class tracking
Kernel test robot reported that
tools/testing/selftests/kvm/hardware_disable_test was failing due to
commit 704069649b ("sched/core: Rework sched_class::wakeup_preempt()
and rq_modified_*()")

It turns out there were two related problems that could lead to a
missed preemption:

 - when hitting newidle balance from the idle thread, it would elevate
   rb->next_class from &idle_sched_class to &fair_sched_class, causing
   later wakeup_preempt() calls to not hit the sched_class_above()
   case, and not issue resched_curr().

   Notably, this modification pattern should only lower the
   next_class, and never raise it. Create two new helper functions to
   wrap this.

 - when doing schedule_idle(), it was possible to miss (re)setting
   rq->next_class to &idle_sched_class, leading to the very same
   problem.

Cc: Sean Christopherson <seanjc@google.com>
Fixes: 704069649b ("sched/core: Rework sched_class::wakeup_preempt() and rq_modified_*()")
Reported-by: kernel test robot <oliver.sang@intel.com>
Closes: https://lore.kernel.org/oe-lkp/202602122157.4e861298-lkp@intel.com
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://patch.msgid.link/20260218163329.GQ1395416@noisy.programming.kicks-ass.net
2026-02-23 11:19:19 +01:00
..
Makefile
autogroup.c
autogroup.h
build_policy.c
build_utility.c
clock.c
completion.c
core.c sched/core: Fix wakeup_preempt's next_class tracking 2026-02-23 11:19:19 +01:00
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/core: Fix wakeup_preempt's next_class tracking 2026-02-23 11:19:19 +01:00
ext.h
ext_idle.c
ext_idle.h
ext_internal.h
fair.c sched/core: Fix wakeup_preempt's next_class tracking 2026-02-23 11:19:19 +01:00
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 sched/core: Fix wakeup_preempt's next_class tracking 2026-02-23 11:19:19 +01:00
smp.h
stats.c
stats.h
stop_task.c
swait.c
syscalls.c
topology.c
wait.c
wait_bit.c