Skip to content

Commit 133699a

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 2f8d62e commit 133699a

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
@@ -1572,10 +1572,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
15721572
void *start, *p;
15731573
int idx, order;
15741574
bool shuffle;
1575+
bool enableirqs = false;
15751576

15761577
flags &= gfp_allowed_mask;
15771578

15781579
if (gfpflags_allow_blocking(flags))
1580+
enableirqs = true;
1581+
#ifdef CONFIG_PREEMPT_RT_FULL
1582+
if (system_state > SYSTEM_BOOTING)
1583+
enableirqs = true;
1584+
#endif
1585+
if (enableirqs)
15791586
local_irq_enable();
15801587

15811588
flags |= s->allocflags;
@@ -1634,7 +1641,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
16341641
page->frozen = 1;
16351642

16361643
out:
1637-
if (gfpflags_allow_blocking(flags))
1644+
if (enableirqs)
16381645
local_irq_disable();
16391646
if (!page)
16401647
return NULL;

0 commit comments

Comments
 (0)