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

mm/vmalloc: cleanup large_gfp in vm_area_alloc_pages()

Now that we have already checked for unsupported flags, we can use the
helper function to set the necessary gfp flags for the large order
allocation optimization.

Link: https://lkml.kernel.org/r/20251121094405.40628-4-vishal.moola@gmail.com
Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
Reviewed-by: "Uladzislau Rezki (Sony)" <urezki@gmail.com>
Acked-by: SeongJae Park <sj@kernel.org>
Cc: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Vishal Moola (Oracle) and committed by
Andrew Morton
75f20b17 bb4d3c76

+1 -3
+1 -3
mm/vmalloc.c
··· 3634 3634 unsigned int max_attempt_order = MAX_PAGE_ORDER; 3635 3635 struct page *page; 3636 3636 int i; 3637 - gfp_t large_gfp = (gfp & 3638 - ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL | __GFP_COMP)) 3639 - | __GFP_NOWARN; 3640 3637 unsigned int large_order = ilog2(nr_remaining); 3638 + gfp_t large_gfp = vmalloc_gfp_adjust(gfp, large_order) & ~__GFP_DIRECT_RECLAIM; 3641 3639 3642 3640 large_order = min(max_attempt_order, large_order); 3643 3641