52 lines
1.6 KiB
Diff
52 lines
1.6 KiB
Diff
From 3e9e31775846ca871bff4cfe9e435b325b36cfee Mon Sep 17 00:00:00 2001
|
|
Message-Id: <3e9e31775846ca871bff4cfe9e435b325b36cfee.1596234183.git.zanussi@kernel.org>
|
|
In-Reply-To: <378ee68279f6a7631221f2670a9298620148690d.1596234183.git.zanussi@kernel.org>
|
|
References: <378ee68279f6a7631221f2670a9298620148690d.1596234183.git.zanussi@kernel.org>
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
Date: Wed, 9 Jan 2013 12:08:15 +0100
|
|
Subject: [PATCH 082/329] slub: Enable irqs for __GFP_WAIT
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.19/older/patches-4.19.135-rt60.tar.xz
|
|
|
|
SYSTEM_RUNNING might be too late for enabling interrupts. Allocations
|
|
with GFP_WAIT can happen before that. So use this as an indicator.
|
|
|
|
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
|
---
|
|
mm/slub.c | 9 ++++++++-
|
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
diff --git a/mm/slub.c b/mm/slub.c
|
|
index d33c04a0e5da..af485aba93ec 100644
|
|
--- a/mm/slub.c
|
|
+++ b/mm/slub.c
|
|
@@ -1589,10 +1589,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
|
|
void *start, *p;
|
|
int idx, order;
|
|
bool shuffle;
|
|
+ bool enableirqs = false;
|
|
|
|
flags &= gfp_allowed_mask;
|
|
|
|
if (gfpflags_allow_blocking(flags))
|
|
+ enableirqs = true;
|
|
+#ifdef CONFIG_PREEMPT_RT_FULL
|
|
+ if (system_state > SYSTEM_BOOTING)
|
|
+ enableirqs = true;
|
|
+#endif
|
|
+ if (enableirqs)
|
|
local_irq_enable();
|
|
|
|
flags |= s->allocflags;
|
|
@@ -1651,7 +1658,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
|
|
page->frozen = 1;
|
|
|
|
out:
|
|
- if (gfpflags_allow_blocking(flags))
|
|
+ if (enableirqs)
|
|
local_irq_disable();
|
|
if (!page)
|
|
return NULL;
|
|
--
|
|
2.17.1
|
|
|