Commit 4bedcc28 authored by Thomas Gleixner's avatar Thomas Gleixner
Browse files

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: default avatarThomas Gleixner <tglx@linutronix.de>
Tested-by: default avatarSebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://lore.kernel.org/r/87sfzehdnl.ffs@tglx
parent 36a21d51
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -557,6 +557,11 @@ __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack
	struct debug_obj *obj;
	unsigned long flags;

	/*
	 * On RT enabled kernels the pool refill must happen in preemptible
	 * context:
	 */
	if (!IS_ENABLED(CONFIG_PREEMPT_RT) || preemptible())
		fill_pool();

	db = get_bucket((unsigned long) addr);