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.
Showing the changes to lib/debugobjects.c (1 of 1 file). Show all
Unified · Split
| @@ -557,7 +557,12 @@ __debug_object_init(void *addr, const struct debug_obj_descr *descr, int onstack · 556 unmodified lines | ||
| 557 | 557 | struct debug_obj *obj; |
| 558 | 558 | unsigned long flags; |
| 559 | 559 | |
| 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(); | |
| 561 | 566 | |
| 562 | 567 | db = get_bucket((unsigned long) addr); |
| 563 | 568 | |