From: Vishal Moola (Oracle) Date: Fri, 21 Nov 2025 09:44:04 +0000 (-0800) Subject: mm/vmalloc: cleanup large_gfp in vm_area_alloc_pages() X-Git-Tag: v6.19-rc1~112^2~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75f20b17440fdaee33a6de2efe3c162e6b19e18e;p=thirdparty%2Flinux.git 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) Reviewed-by: "Uladzislau Rezki (Sony)" Acked-by: SeongJae Park Cc: Christoph Hellwig Signed-off-by: Andrew Morton --- diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 185add3f5606e..134f615fd3bd8 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -3634,10 +3634,8 @@ vm_area_alloc_pages(gfp_t gfp, int nid, unsigned int max_attempt_order = MAX_PAGE_ORDER; struct page *page; int i; - gfp_t large_gfp = (gfp & - ~(__GFP_DIRECT_RECLAIM | __GFP_NOFAIL | __GFP_COMP)) - | __GFP_NOWARN; unsigned int large_order = ilog2(nr_remaining); + gfp_t large_gfp = vmalloc_gfp_adjust(gfp, large_order) & ~__GFP_DIRECT_RECLAIM; large_order = min(max_attempt_order, large_order);