diff options
| author | Tejun Heo <tj@kernel.org> | 2026-03-06 20:46:32 +0300 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2026-03-06 20:46:32 +0300 |
| commit | 32e940f2bd3b16551f23ea44be47f6f5d1746d64 (patch) | |
| tree | 23037a80fd683ff1a52ca05e2d7432c0cbc8f98b /lib/debugobjects.c | |
| parent | 477174ac35c510d0ed3043f5bd4fba25546a21ce (diff) | |
| parent | 1dde502587657045b267f179d7a1ecc7b8a1a265 (diff) | |
| download | linux-32e940f2bd3b16551f23ea44be47f6f5d1746d64.tar.xz | |
Merge branch 'for-7.0-fixes' into for-7.1
To prepare for hierarchical scheduling patchset which will cause multiple
conflicts otherwise.
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'lib/debugobjects.c')
| -rw-r--r-- | lib/debugobjects.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/debugobjects.c b/lib/debugobjects.c index 89a1d6745dc2..12f50de85b62 100644 --- a/lib/debugobjects.c +++ b/lib/debugobjects.c @@ -398,9 +398,26 @@ static void fill_pool(void) atomic_inc(&cpus_allocating); while (pool_should_refill(&pool_global)) { + gfp_t gfp = __GFP_HIGH | __GFP_NOWARN; HLIST_HEAD(head); - if (!kmem_alloc_batch(&head, obj_cache, __GFP_HIGH | __GFP_NOWARN)) + /* + * Allow reclaim only in preemptible context and during + * early boot. If not preemptible, the caller might hold + * locks causing a deadlock in the allocator. + * + * If the reclaim flag is not set during early boot then + * allocations, which happen before deferred page + * initialization has completed, will fail. + * + * In preemptible context the flag is harmless and not a + * performance issue as that's usually invoked from slow + * path initialization context. + */ + if (preemptible() || system_state < SYSTEM_SCHEDULING) + gfp |= __GFP_KSWAPD_RECLAIM; + + if (!kmem_alloc_batch(&head, obj_cache, gfp)) break; guard(raw_spinlock_irqsave)(&pool_lock); |
