diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-05-24 10:48:55 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-05-24 10:48:55 -0700 |
| commit | ee651da6d3e1e3c57d22dd6f03850af980b7cd10 (patch) | |
| tree | 8c2bcd61a715f17f3c68b857440119c6e4603de2 /lib | |
| parent | 2be86a8c57773bce1b5c845c49e0bfa3caac838c (diff) | |
| parent | 5f41161059fd0f1bbf18c90f3180e38cc45a14eb (diff) | |
| download | linux-next-history-ee651da6d3e1e3c57d22dd6f03850af980b7cd10.tar.gz | |
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
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/debugobjects.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 12e2e42e6a31a..772ddabcbe7d3 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -711,6 +711,15 @@ static struct debug_obj *lookup_object_or_alloc(void *addr, struct debug_bucket return NULL; } +static inline bool debug_objects_is_pi_blocked_on(void) +{ +#ifdef CONFIG_RT_MUTEXES + return current->pi_blocked_on != NULL; +#else + return false; +#endif +} + static void debug_objects_fill_pool(void) { if (!static_branch_likely(&obj_cache_enabled)) @@ -727,11 +736,12 @@ static void debug_objects_fill_pool(void) /* * On RT enabled kernels the pool refill must happen in preemptible - * context -- for !RT kernels we rely on the fact that spinlock_t and - * raw_spinlock_t are basically the same type and this lock-type - * inversion works just fine. + * context and not enqueued on an rt_mutex -- for !RT kernels we rely + * on the fact that spinlock_t and raw_spinlock_t are basically the + * same type and this lock-type inversion works just fine. */ - if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible() || system_state < SYSTEM_SCHEDULING) { + if (!IS_ENABLED(CONFIG_PREEMPT_RT) || system_state < SYSTEM_SCHEDULING || + (preemptible() && !debug_objects_is_pi_blocked_on())) { /* * Annotate away the spinlock_t inside raw_spinlock_t warning * by temporarily raising the wait-type to LD_WAIT_CONFIG, matching |
