]> www.infradead.org Git - users/jedix/linux-maple.git/commit
sched_ext: Enable the ops breather and eject BPF scheduler on softlockup
authorTejun Heo <tj@kernel.org>
Tue, 5 Nov 2024 21:49:04 +0000 (11:49 -1000)
committerTejun Heo <tj@kernel.org>
Fri, 8 Nov 2024 20:42:22 +0000 (10:42 -1000)
commite32c260195e6ff72940ab7826e38e0a0066fc58f
tree4397fbaba6a85afa05b90fb9a1c5d31c10e6e16b
parent62dcbab8b0ef21729532600039fd514c09407092
sched_ext: Enable the ops breather and eject BPF scheduler on softlockup

On 2 x Intel Sapphire Rapids machines with 224 logical CPUs, a poorly
behaving BPF scheduler can live-lock the system by making multiple CPUs bang
on the same DSQ to the point where soft-lockup detection triggers before
SCX's own watchdog can take action. It also seems possible that the machine
can be live-locked enough to prevent scx_ops_helper, which is an RT task,
from running in a timely manner.

Implement scx_softlockup() which is called when three quarters of
soft-lockup threshold has passed. The function immediately enables the ops
breather and triggers an ops error to initiate ejection of the BPF
scheduler.

The previous and this patch combined enable the kernel to reliably recover
the system from live-lock conditions that can be triggered by a poorly
behaving BPF scheduler on Intel dual socket systems.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Douglas Anderson <dianders@chromium.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
include/linux/sched/ext.h
kernel/sched/ext.c
kernel/watchdog.c
tools/sched_ext/scx_show_state.py