Skip to content

Commit ba9b879

Browse files
KAGA-KOKOSebastian Andrzej Siewior
authored andcommitted
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 <[email protected]>
1 parent ee0cd0d commit ba9b879

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

mm/slub.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1570,10 +1570,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
15701570
void *start, *p;
15711571
int idx, order;
15721572
bool shuffle;
1573+
bool enableirqs = false;
15731574

15741575
flags &= gfp_allowed_mask;
15751576

15761577
if (gfpflags_allow_blocking(flags))
1578+
enableirqs = true;
1579+
#ifdef CONFIG_PREEMPT_RT_FULL
1580+
if (system_state > SYSTEM_BOOTING)
1581+
enableirqs = true;
1582+
#endif
1583+
if (enableirqs)
15771584
local_irq_enable();
15781585

15791586
flags |= s->allocflags;
@@ -1632,7 +1639,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
16321639
page->frozen = 1;
16331640

16341641
out:
1635-
if (gfpflags_allow_blocking(flags))
1642+
if (enableirqs)
16361643
local_irq_disable();
16371644
if (!page)
16381645
return NULL;

0 commit comments

Comments
 (0)