linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm: vmalloc: correct use of __GFP_NOWARN mask in __vmalloc_area_node()
@ 2022-12-16 23:46 Lorenzo Stoakes
  2022-12-19 12:09 ` Uladzislau Rezki
  0 siblings, 1 reply; 3+ messages in thread
From: Lorenzo Stoakes @ 2022-12-16 23:46 UTC (permalink / raw)
  To: linux-mm, Andrew Morton, Uladzislau Rezki, Christoph Hellwig,
	linux-kernel
  Cc: Matthew Wilcox, Nicholas Piggin, Baoquan He, Lorenzo Stoakes

This function invokes warn_alloc() with __GFP_NOWARN set which is a
no-op. Set this flag _after_ this call so it is actually invoked, and
additionally remove a duplicate application of __GFP_NOWARN afterwards.

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
---
 mm/vmalloc.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index ca71de7c9d77..9e30f0b39203 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3031,7 +3031,7 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 	int ret;

 	array_size = (unsigned long)nr_small_pages * sizeof(struct page *);
-	gfp_mask |= __GFP_NOWARN;
+
 	if (!(gfp_mask & (GFP_DMA | GFP_DMA32)))
 		gfp_mask |= __GFP_HIGHMEM;

@@ -3051,10 +3051,12 @@ static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
 		return NULL;
 	}

+	gfp_mask |= __GFP_NOWARN;
+
 	set_vm_area_page_order(area, page_shift - PAGE_SHIFT);
 	page_order = vm_area_page_order(area);

-	area->nr_pages = vm_area_alloc_pages(gfp_mask | __GFP_NOWARN,
+	area->nr_pages = vm_area_alloc_pages(gfp_mask,
 		node, page_order, nr_small_pages, area->pages);

 	atomic_long_add(area->nr_pages, &nr_vmalloc_pages);
--
2.38.1


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

end of thread, other threads:[~2022-12-19 12:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-12-16 23:46 [PATCH] mm: vmalloc: correct use of __GFP_NOWARN mask in __vmalloc_area_node() Lorenzo Stoakes
2022-12-19 12:09 ` Uladzislau Rezki
2022-12-19 12:25   ` Lorenzo Stoakes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).