2018-08-27 14:32:32 +00:00
|
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
2019-04-08 23:49:20 +00:00
|
|
|
Date: Wed, 9 Jan 2013 12:08:15 +0100
|
2019-11-25 00:04:39 +00:00
|
|
|
Subject: [PATCH 082/290] slub: Enable irqs for __GFP_WAIT
|
|
|
|
Origin: https://git.kernel.org/cgit/linux/kernel/git/rt/linux-stable-rt.git/commit?id=0d2a7aef26031e05ab0f7d78fc15f838459aa348
|
2018-08-27 14:32:32 +00:00
|
|
|
|
|
|
|
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>
|
|
|
|
---
|
2019-04-08 23:49:20 +00:00
|
|
|
mm/slub.c | 9 ++++++++-
|
2018-08-27 14:32:32 +00:00
|
|
|
1 file changed, 8 insertions(+), 1 deletion(-)
|
|
|
|
|
2019-04-08 23:49:20 +00:00
|
|
|
diff --git a/mm/slub.c b/mm/slub.c
|
2019-11-25 00:04:39 +00:00
|
|
|
index cbe47408c6eb..81c32ceab228 100644
|
2018-08-27 14:32:32 +00:00
|
|
|
--- a/mm/slub.c
|
|
|
|
+++ b/mm/slub.c
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -1570,10 +1570,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
|
2018-08-27 14:32:32 +00:00
|
|
|
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;
|
2019-04-08 23:49:20 +00:00
|
|
|
@@ -1632,7 +1639,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
|
2018-08-27 14:32:32 +00:00
|
|
|
page->frozen = 1;
|
|
|
|
|
|
|
|
out:
|
|
|
|
- if (gfpflags_allow_blocking(flags))
|
|
|
|
+ if (enableirqs)
|
|
|
|
local_irq_disable();
|
|
|
|
if (!page)
|
|
|
|
return NULL;
|