linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/vmalloc: warn only once when vmalloc detect invalid gfp flags
@ 2025-11-18  0:05 David Heidelberg via B4 Relay
  2025-11-18  0:34 ` Vishal Moola (Oracle)
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: David Heidelberg via B4 Relay @ 2025-11-18  0:05 UTC (permalink / raw)
  To: Andrew Morton, Uladzislau Rezki, Vishal Moola (Oracle)
  Cc: linux-mm, linux-kernel, phone-devel, David Heidelberg

From: David Heidelberg <david@ixit.cz>

Without WARN_ONCE, the logs get spammed immediately after the boot,
on devices as OnePlus 6T (Snapdragon 845).

Fixes: 7179b2256315 ("mm/vmalloc: warn on invalid vmalloc gfp flags")
Signed-off-by: David Heidelberg <david@ixit.cz>
---
I'm not 100% sure this is the right solution, but having WARN_ONCE or
rate limited warnings here helps a lot on devices as OnePlus 6 (sdm845).

Please let me know what you think.
---
 mm/vmalloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/vmalloc.c b/mm/vmalloc.c
index 49e0b68768d73..2a3ee17093d6e 100644
--- a/mm/vmalloc.c
+++ b/mm/vmalloc.c
@@ -3934,8 +3934,8 @@ static gfp_t vmalloc_fix_flags(gfp_t flags)
 	gfp_t invalid_mask = flags & ~GFP_VMALLOC_SUPPORTED;
 
 	flags &= GFP_VMALLOC_SUPPORTED;
-	WARN(1, "Unexpected gfp: %#x (%pGg). Fixing up to gfp: %#x (%pGg). Fix your code!\n",
-			invalid_mask, &invalid_mask, flags, &flags);
+	WARN_ONCE(1, "Unexpected gfp: %#x (%pGg). Fixing up to gfp: %#x (%pGg). Fix your code!\n"
+		  invalid_mask, &invalid_mask, flags, &flags);
 	return flags;
 }
 

---
base-commit: 0c1c7a6a83feaf2cf182c52983ffe330ffb50280
change-id: 20251118-only-one-vmalloc-b8d997045791

Best regards,
-- 
David Heidelberg <david@ixit.cz>




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

end of thread, other threads:[~2025-11-18  9:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-11-18  0:05 [PATCH] mm/vmalloc: warn only once when vmalloc detect invalid gfp flags David Heidelberg via B4 Relay
2025-11-18  0:34 ` Vishal Moola (Oracle)
     [not found]   ` <b7e215ee-fce6-4a7c-995d-8ea6625b1ae8@ixit.cz>
2025-11-18  1:06     ` Vishal Moola (Oracle)
2025-11-18  0:53 ` kernel test robot
2025-11-18  1:16 ` Vishal Moola (Oracle)
2025-11-18  9:31   ` Uladzislau Rezki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox