Skip to content

Commit 6f4e10e

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 87d277a commit 6f4e10e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

mm/slub.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1627,10 +1627,18 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
16271627
void *start, *p, *next;
16281628
int idx;
16291629
bool shuffle;
1630+
bool enableirqs = false;
16301631

16311632
flags &= gfp_allowed_mask;
16321633

16331634
if (gfpflags_allow_blocking(flags))
1635+
enableirqs = true;
1636+
1637+
#ifdef CONFIG_PREEMPT_RT
1638+
if (system_state > SYSTEM_BOOTING)
1639+
enableirqs = true;
1640+
#endif
1641+
if (enableirqs)
16341642
local_irq_enable();
16351643

16361644
flags |= s->allocflags;
@@ -1689,7 +1697,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
16891697
page->frozen = 1;
16901698

16911699
out:
1692-
if (gfpflags_allow_blocking(flags))
1700+
if (enableirqs)
16931701
local_irq_disable();
16941702
if (!page)
16951703
return NULL;

0 commit comments

Comments
 (0)