Skip to content

Commit bda297f

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 513c2ca commit bda297f

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

mm/slub.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,14 +1538,17 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
15381538
void *start, *p;
15391539
int idx, order;
15401540
bool shuffle;
1541+
bool enableirqs = false;
15411542

15421543
flags &= gfp_allowed_mask;
15431544

1545+
if (gfpflags_allow_blocking(flags))
1546+
enableirqs = true;
15441547
#ifdef CONFIG_PREEMPT_RT_FULL
15451548
if (system_state > SYSTEM_BOOTING)
1546-
#else
1547-
if (gfpflags_allow_blocking(flags))
1549+
enableirqs = true;
15481550
#endif
1551+
if (enableirqs)
15491552
local_irq_enable();
15501553

15511554
flags |= s->allocflags;
@@ -1620,11 +1623,7 @@ static struct page *allocate_slab(struct kmem_cache *s, gfp_t flags, int node)
16201623
page->frozen = 1;
16211624

16221625
out:
1623-
#ifdef CONFIG_PREEMPT_RT_FULL
1624-
if (system_state > SYSTEM_BOOTING)
1625-
#else
1626-
if (gfpflags_allow_blocking(flags))
1627-
#endif
1626+
if (enableirqs)
16281627
local_irq_disable();
16291628
if (!page)
16301629
return NULL;

0 commit comments

Comments
 (0)