54 lines
1.4 KiB
Diff
54 lines
1.4 KiB
Diff
From 3ad012e48450900372cd581bafdcac667e20fc35 Mon Sep 17 00:00:00 2001
|
|
From: Thomas Gleixner <tglx@linutronix.de>
|
|
Date: Wed, 9 Jan 2013 12:08:15 +0100
|
|
Subject: [PATCH 108/365] 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>
|
|
---
|
|
mm/slub.c | 13 ++++++-------
|
|
1 file changed, 6 insertions(+), 7 deletions(-)
|
|
|
|
diff --git a/mm/slub.c b/mm/slub.c
|
|
index 1167a156f43f..a83b7f1c0957 100644
|
|
--- a/mm/slub.c
|
|
+++ b/mm/slub.c
|
|
@@ -1555,14 +1555,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_RUNNING)
|
|
-#else
|
|
- if (gfpflags_allow_blocking(flags))
|
|
+ enableirqs = true;
|
|
#endif
|
|
+ if (enableirqs)
|
|
local_irq_enable();
|
|
|
|
flags |= s->allocflags;
|
|
@@ -1637,11 +1640,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
|
|
page->frozen = 1;
|
|
|
|
out:
|
|
-#ifdef CONFIG_PREEMPT_RT_FULL
|
|
- if (system_state == SYSTEM_RUNNING)
|
|
-#else
|
|
- if (gfpflags_allow_blocking(flags))
|
|
-#endif
|
|
+ if (enableirqs)
|
|
local_irq_disable();
|
|
if (!page)
|
|
return NULL;
|
|
--
|
|
2.28.0
|
|
|