summaryrefslogtreecommitdiff
path: root/lib/debugobjects.c
diff options
context:
space:
mode:
authorMark Brown <broonie@kernel.org>2026-03-03 02:15:13 +0300
committerMark Brown <broonie@kernel.org>2026-03-03 02:15:13 +0300
commitc26137d3a3a8168b49679e30cf3c08177bb2dbe7 (patch)
tree6e6316d5c496617206ce2b8c0bf2dcca10230929 /lib/debugobjects.c
parent9ab637ac5d3826606947f4e861107da958eda324 (diff)
parent11439c4635edd669ae435eec308f4ab8a0804808 (diff)
downloadlinux-c26137d3a3a8168b49679e30cf3c08177bb2dbe7.tar.xz
regmap: Merge up v7.0-rc2
This gets us a fix for KUnit execution which allows us to run the testsuite again.
Diffstat (limited to 'lib/debugobjects.c')
-rw-r--r--lib/debugobjects.c19
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);