History

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.

Thomas Gleixner committed 5 years ago

Commit 4bedcc21 parent 36a21d51 file · +6 −1Browse files

Showing the changes to lib/debugobjects.c (1 of 1 file). Show all

Unified · Split

lib/debugobjects.c+6−1
@@ -557,7 +557,12 @@ __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack · 556 unmodified lines
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