Skip to content

Commit ee651da

Browse files
committed
Merge tag 'core-urgent-2026-05-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull debugobjects fix from Ingo Molnar:: - Fix debugobjects regression on -rt kernels: don't fill the pool (which uses a coarse lock) if ->pi_blocked_on, because that messes up the priority inheritance of callers * tag 'core-urgent-2026-05-24' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: debugobjects: Do not fill_pool() if pi_blocked_on
2 parents 2be86a8 + 5f41161 commit ee651da

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

lib/debugobjects.c

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,15 @@ static struct debug_obj *lookup_object_or_alloc(void *addr, struct debug_bucket
711711
return NULL;
712712
}
713713

714+
static inline bool debug_objects_is_pi_blocked_on(void)
715+
{
716+
#ifdef CONFIG_RT_MUTEXES
717+
return current->pi_blocked_on != NULL;
718+
#else
719+
return false;
720+
#endif
721+
}
722+
714723
static void debug_objects_fill_pool(void)
715724
{
716725
if (!static_branch_likely(&obj_cache_enabled))
@@ -727,11 +736,12 @@ static void debug_objects_fill_pool(void)
727736

728737
/*
729738
* On RT enabled kernels the pool refill must happen in preemptible
730-
* context -- for !RT kernels we rely on the fact that spinlock_t and
731-
* raw_spinlock_t are basically the same type and this lock-type
732-
* inversion works just fine.
739+
* context and not enqueued on an rt_mutex -- for !RT kernels we rely
740+
* on the fact that spinlock_t and raw_spinlock_t are basically the
741+
* same type and this lock-type inversion works just fine.
733742
*/
734-
if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible() || system_state < SYSTEM_SCHEDULING) {
743+
if (!IS_ENABLED(CONFIG_PREEMPT_RT) || system_state < SYSTEM_SCHEDULING ||
744+
(preemptible() && !debug_objects_is_pi_blocked_on())) {
735745
/*
736746
* Annotate away the spinlock_t inside raw_spinlock_t warning
737747
* by temporarily raising the wait-type to LD_WAIT_CONFIG, matching

0 commit comments

Comments
 (0)