All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set
@ 2018-04-18 14:45 Christopher Lameter
  2018-04-18 15:05 ` Mikulas Patocka
  2018-04-19 11:00 ` Michal Hocko
  0 siblings, 2 replies; 8+ messages in thread
From: Christopher Lameter @ 2018-04-18 14:45 UTC (permalink / raw)
  To: Vlastimil Babka
  Cc: Mikulas Patocka, Mike Snitzer, Matthew Wilcox, Pekka Enberg,
	linux-mm, dm-devel, David Rientjes, Joonsoo Kim, Andrew Morton,
	linux-kernel

Mikulas Patoka wants to ensure that no fallback to lower order happens. I
think __GFP_NORETRY should work correctly in that case too and not fall
back.



Allocating at a smaller order is a retry operation and should not
be attempted.

If the caller does not want retries then respect that.

GFP_NORETRY allows callers to ensure that only maximum order
allocations are attempted.

Signed-off-by: Christoph Lameter <cl@linux.com>

Index: linux/mm/slub.c
===================================================================
--- linux.orig/mm/slub.c
+++ linux/mm/slub.c
@@ -1598,7 +1598,7 @@ static struct page *allocate_slab(struct
 		alloc_gfp = (alloc_gfp | __GFP_NOMEMALLOC) & ~(__GFP_RECLAIM|__GFP_NOFAIL);

 	page = alloc_slab_page(s, alloc_gfp, node, oo);
-	if (unlikely(!page)) {
+	if (unlikely(!page) && !(flags & __GFP_NORETRY)) {
 		oo = s->min;
 		alloc_gfp = flags;
 		/*

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-04-23 22:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-18 14:45 [PATCH] SLUB: Do not fallback to mininum order if __GFP_NORETRY is set Christopher Lameter
2018-04-18 15:05 ` Mikulas Patocka
2018-04-18 15:11   ` Christopher Lameter
2018-04-18 18:49   ` David Rientjes
2018-04-19 11:00 ` Michal Hocko
2018-04-20 14:53   ` Christopher Lameter
2018-04-21 17:02     ` Vlastimil Babka
2018-04-23 22:41       ` Christopher Lameter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.