diff options
| author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-06-22 23:10:08 -0700 |
|---|---|---|
| committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2026-06-22 23:10:08 -0700 |
| commit | 7a0e692a0381254b2f77c54dec100cd3325a6fdf (patch) | |
| tree | 2d2ce96c3471a02166323e88cd7ccab1d43b1cd4 /lib/debugobjects.c | |
| parent | fb402386af4cdce108ff991a796386de55439735 (diff) | |
| parent | a6ac4e24c1a8a533bb61035184fdcc7eede4cc8d (diff) | |
| download | linux-7a0e692a0381254b2f77c54dec100cd3325a6fdf.tar.gz linux-7a0e692a0381254b2f77c54dec100cd3325a6fdf.zip | |
Merge branch 'next' into for-linus
Prepare input updates for 7.2 merge window.
Diffstat (limited to 'lib/debugobjects.c')
| -rw-r--r-- | lib/debugobjects.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 12f50de85b62..b18a682fe3da 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 @@ -1024,7 +1034,7 @@ void debug_object_assert_init(void *addr, const struct debug_obj_descr *descr) raw_spin_lock_irqsave(&db->lock, flags); obj = lookup_object_or_alloc(addr, db, descr, false, true); raw_spin_unlock_irqrestore(&db->lock, flags); - if (likely(!IS_ERR_OR_NULL(obj))) + if (!IS_ERR_OR_NULL(obj)) return; /* If NULL the allocation has hit OOM */ @@ -1212,7 +1222,7 @@ struct self_test { static __initconst const struct debug_obj_descr descr_type_test; -static bool __init is_static_object(void *addr) +static __noipa bool __init is_static_object(void *addr) { struct self_test *obj = addr; |
