From: Thomas Gleixner Date: Thu, 12 Aug 2021 15:43:26 +0000 (+0200) Subject: debugobjects: Make them PREEMPT_RT aware X-Git-Tag: v5.15~468^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4bedcc28469a24fe481a8a31b3584e6070457ddb;p=platform%2Fkernel%2Flinux-starfive.git 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 Tested-by: Sebastian Andrzej Siewior Link: https://lore.kernel.org/r/87sfzehdnl.ffs@tglx --- diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 9e14ae02306b..6946f8e204e3 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -557,7 +557,12 @@ __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack struct debug_obj *obj; unsigned long flags; - fill_pool(); + /* + * 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);