mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] lockdep/selftests: Restore PREEMPT_RT task state
@ 2026-05-23 18:51 Karl Mehltretter
  2026-05-23 18:51 ` [PATCH 1/2] lockdep/selftests: Restore migrate_disable() state on PREEMPT_RT Karl Mehltretter
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Karl Mehltretter @ 2026-05-23 18:51 UTC (permalink / raw)
  To: Peter Zijlstra
  Cc: Ingo Molnar, Will Deacon, Boqun Feng, Waiman Long, Andrew Morton,
	Sebastian Andrzej Siewior, Clark Williams, Steven Rostedt,
	linux-kernel, linux-rt-devel, Karl Mehltretter

Hi,

the lockdep selftests deliberately run broken locking patterns. On
PREEMPT_RT, some of those paths also leave task-local RT state behind, and
dotest() has to restore that state before the next testcase.

Patch 1 restores current->migration_disabled on all PREEMPT_RT builds.
The missing restore is visible with CONFIG_SMP=n as a pinned-lock warning,
"bad: scheduling from the idle thread!" and a panic after the selftests.

Patch 2 restores current->sched_rt_mutex after WW-mutex selftests. Without
that, stale RT-mutex scheduler state produces rt_mutex_pre_schedule()
warnings in later testcases.

Both changes are in dotest()'s PREEMPT_RT cleanup path in
lib/locking-selftest.c.

Tested on x86_64 QEMU with CONFIG_PREEMPT_RT=y,
CONFIG_DEBUG_LOCKING_API_SELFTESTS=y, CONFIG_LOCKDEP=y and
CONFIG_PROVE_LOCKING=y. Both CONFIG_SMP=n and CONFIG_SMP=y configurations
boot to userspace without the pinned-lock panic or rt_mutex_pre_schedule()
warnings.

Karl Mehltretter (2):
  lockdep/selftests: Restore migrate_disable() state on PREEMPT_RT
  lockdep/selftests: Restore sched_rt_mutex state on PREEMPT_RT

 lib/locking-selftest.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-06-03 14:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-05-23 18:51 [PATCH 0/2] lockdep/selftests: Restore PREEMPT_RT task state Karl Mehltretter
2026-05-23 18:51 ` [PATCH 1/2] lockdep/selftests: Restore migrate_disable() state on PREEMPT_RT Karl Mehltretter
2026-06-03 14:25   ` [tip: locking/core] " tip-bot2 for Karl Mehltretter
2026-05-23 18:51 ` [PATCH 2/2] lockdep/selftests: Restore sched_rt_mutex " Karl Mehltretter
2026-06-03 14:25   ` [tip: locking/core] " tip-bot2 for Karl Mehltretter
2026-06-01  8:43 ` [PATCH 0/2] lockdep/selftests: Restore PREEMPT_RT task state Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®