linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] make vmalloc gfp flags usage more apparent
@ 2025-10-30 16:43 Vishal Moola (Oracle)
  2025-10-30 16:43 ` [RFC PATCH 1/4] mm/vmalloc: warn on invalid vmalloc gfp flags Vishal Moola (Oracle)
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Vishal Moola (Oracle) @ 2025-10-30 16:43 UTC (permalink / raw)
  To: linux-kernel, linux-mm
  Cc: Uladzislau Rezki, Andrew Morton, Christoph Hellwig,
	Vishal Moola (Oracle)

We should do a better job at enforcing gfp flags for vmalloc. Right now, we
have a kernel-doc for __vmalloc_node_range(), and hope callers pass in
supported flags. If a caller were to pass in an unsupported flag, we may
BUG, silently clear it, or completely ignore it.

If we are more proactive about enforcing gfp flags, we can making sure
callers know when they may be asking for unsupported behavior.

This patchset lets vmalloc control the incoming gfp flags, and cleans up
some confusing gfp code.

----------------
Based on mm-new

I did some digging and am not entirely sure what flags vmalloc does NOT
support. Is a better idea is to have explicitly supported flags and drop
all others?

__GFP_COMP is an obvious one due to a BUG call in split_page().
~GFP_BITS_MASK is also obvious.

Then I started following the kernel doc and added NORETRY and
RETRY_MAYFAIL, and after forking a couple hundred times, it turns out some
per-cpu allocations pass in the NORETRY flag right now.

Does anyone have a handy-dandy list of supported/unsupported vmalloc flags
that we should reject/clear? Ulad?

Vishal Moola (Oracle) (4):
  mm/vmalloc: warn on invalid vmalloc gfp flags
  mm/vmalloc: Add a helper to optimize vmalloc allocation gfps
  mm/vmalloc: cleanup large_gfp in vm_area_alloc_pages()
  mm/vmalloc: cleanup gfp flag use in new_vmap_block()

 mm/vmalloc.c | 41 +++++++++++++++++++++++++++++++++--------
 1 file changed, 33 insertions(+), 8 deletions(-)

-- 
2.51.1



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

end of thread, other threads:[~2025-11-03 13:51 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30 16:43 [RFC PATCH 0/4] make vmalloc gfp flags usage more apparent Vishal Moola (Oracle)
2025-10-30 16:43 ` [RFC PATCH 1/4] mm/vmalloc: warn on invalid vmalloc gfp flags Vishal Moola (Oracle)
2025-10-30 16:43 ` [RFC PATCH 2/4] mm/vmalloc: Add a helper to optimize vmalloc allocation gfps Vishal Moola (Oracle)
2025-10-30 16:43 ` [RFC PATCH 3/4] mm/vmalloc: cleanup large_gfp in vm_area_alloc_pages() Vishal Moola (Oracle)
2025-10-30 16:43 ` [RFC PATCH 4/4] mm/vmalloc: cleanup gfp flag use in new_vmap_block() Vishal Moola (Oracle)
2025-11-03 12:57 ` [RFC PATCH 0/4] make vmalloc gfp flags usage more apparent Uladzislau Rezki
2025-11-03 13:51   ` Christoph Hellwig

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).