Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

SLUB: Don't pass __GFP_FAIL for the initial allocation

SLUB uses higher order allocations by default but falls back to small
orders under memory pressure. Make sure the GFP mask used in the initial
allocation doesn't include __GFP_NOFAIL.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Pekka Enberg and committed by
Linus Torvalds
ba52270d 4923abf9

+8 -2
+8 -2
mm/slub.c
··· 1085 1085 { 1086 1086 struct page *page; 1087 1087 struct kmem_cache_order_objects oo = s->oo; 1088 + gfp_t alloc_gfp; 1088 1089 1089 1090 flags |= s->allocflags; 1090 1091 1091 - page = alloc_slab_page(flags | __GFP_NOWARN | __GFP_NORETRY, node, 1092 - oo); 1092 + /* 1093 + * Let the initial higher-order allocation fail under memory pressure 1094 + * so we fall-back to the minimum order allocation. 1095 + */ 1096 + alloc_gfp = (flags | __GFP_NOWARN | __GFP_NORETRY) & ~__GFP_NOFAIL; 1097 + 1098 + page = alloc_slab_page(alloc_gfp, node, oo); 1093 1099 if (unlikely(!page)) { 1094 1100 oo = s->min; 1095 1101 /*