[PATCH v3 3/4] mm/vmalloc: cleanup large_gfp in vm_area_alloc_pages()

Vishal Moola (Oracle) posted 4 patches 2 weeks ago
There is a newer version of this series
[PATCH v3 3/4] mm/vmalloc: cleanup large_gfp in vm_area_alloc_pages()
Posted by Vishal Moola (Oracle) 2 weeks ago
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.

Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
---
 mm/vmalloc.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 0929f4f53ffe..d343db806170 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);
 
-- 
2.51.1
Re: [PATCH v3 3/4] mm/vmalloc: cleanup large_gfp in vm_area_alloc_pages()
Posted by Uladzislau Rezki 1 week, 6 days ago
On Mon, Nov 17, 2025 at 09:35:29AM -0800, Vishal Moola (Oracle) wrote:
> 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.
> 
> Signed-off-by: Vishal Moola (Oracle) <vishal.moola@gmail.com>
> ---
>  mm/vmalloc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 0929f4f53ffe..d343db806170 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);
>  
> -- 
> 2.51.1
> 
Reviewed-by: "Uladzislau Rezki (Sony)" <urezki@gmail.com>

--
Uladzislau Rezki