Skip to content

Commit 4bedcc2

Browse files
committed
debugobjects: Make them PREEMPT_RT aware
On PREEMPT_RT enabled kernels it is not possible to refill the object pool from atomic context (preemption or interrupts disabled) as the allocator might acquire 'sleeping' spinlocks. Guard the invocation of fill_pool() accordingly. Signed-off-by: Thomas Gleixner <[email protected]> Tested-by: Sebastian Andrzej Siewior <[email protected]> Link: https://lore.kernel.org/r/87sfzehdnl.ffs@tglx
1 parent 36a21d5 commit 4bedcc2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/debugobjects.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,12 @@ __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack
557557
struct debug_obj *obj;
558558
unsigned long flags;
559559

560-
fill_pool();
560+
/*
561+
* On RT enabled kernels the pool refill must happen in preemptible
562+
* context:
563+
*/
564+
if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible())
565+
fill_pool();
561566

562567
db = get_bucket((unsigned long) addr);
563568

0 commit comments

Comments
 (0)