The page allocator will take care of doing this so SLUB doesn't need to do this before calling into it. The page allocator will soon start using the GFP bits as a proxy to infer if it can do blocking stuff (separately from whether it can do actual reclaim), hence SLUB will benefit from leaving __GFP_DIRECT_RECLAIM set even when it's forbidden by gfp_allowed_mask. Signed-off-by: Brendan Jackman --- mm/slub.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/slub.c b/mm/slub.c index 867a07260acf9e3c0f92de66e2d25f081ae51dcb..0f8724af4ce63f6e2a32e889f6490be7a25823eb 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3177,8 +3177,6 @@ static struct slab *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) int idx; bool shuffle; - flags &= gfp_allowed_mask; - flags |= s->allocflags; /* @@ -3212,7 +3210,7 @@ static struct slab *allocate_slab(struct kmem_cache *s, gfp_t flags, int node) slab->frozen = 0; init_slab_obj_exts(slab); - account_slab(slab, oo_order(oo), s, flags); + account_slab(slab, oo_order(oo), s, flags & gfp_allowed_mask); slab->slab_cache = s; -- 2.50.1