summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2013-01-09 12:08:15 +0100
committerSebastian Andrzej Siewior <bigeasy@linutronix.de>2020-04-03 18:49:47 +0200
commitc01e10fe606d1bb949382650db71e6d711b1bb02 (patch)
tree9068508a2eaa33beb83d9eff56c8f19e2bb0eee1 /mm
parentd18a0a185407898fcf2931257f585083fa2e1e2a (diff)
downloadlinux-rt-c01e10fe606d1bb949382650db71e6d711b1bb02.tar.gz
slub: Enable irqs for __GFP_WAIT
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>
Diffstat (limited to 'mm')
-rw-r--r--mm/slub.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/mm/slub.c b/mm/slub.c
index 7dc6ef98cd7c..1929645daa53 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1647,10 +1647,18 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
void *start, *p, *next;
int idx;
bool shuffle;
+ bool enableirqs = false;
flags &= gfp_allowed_mask;
if (gfpflags_allow_blocking(flags))
+ enableirqs = true;
+
+#ifdef CONFIG_PREEMPT_RT
+ if (system_state > SYSTEM_BOOTING)
+ enableirqs = true;
+#endif
+ if (enableirqs)
local_irq_enable();
flags |= s->allocflags;
@@ -1709,7 +1717,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;