Merge tag 'core-debugobjects-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <torvalds@linux-foundation.org>
Mon, 30 Aug 2021 21:06:31 +0000 (14:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 30 Aug 2021 21:06:31 +0000 (14:06 -0700)
Pull debugobjects update from Thomas Gleixner:
 "A single commit for debugobjects to make them work on PREEMPT_RT by
  preventing object pool refill in atomic contexts"

* tag 'core-debugobjects-2021-08-30' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
  debugobjects: Make them PREEMPT_RT aware

lib/debugobjects.c

index 9e14ae0..6946f8e 100644 (file)
@@ -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);