Skip to content

make vmalloc gfp flags usage more apparent

Vishal Moola (Oracle) linux-mm lkml syzbot 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 4 repliesIn review

RFC v2 from the cover letter

- Whitelist supported gfp flags instead of blacklisting the unsupported
- Move the flags check up to the only exported functions that accept flags:
__vmalloc_noprof() and vmalloc_huge_node_prof()

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/linux-mm/[email protected]/

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mm/vmalloc: warn on invalid vmalloc gfp flagsmm/vmalloc.c+22 -00 replies
2/4mm/vmalloc: Add a helper to optimize vmalloc allocation gfpsmm/vmalloc.c+14 -30 replies
3/4mm/vmalloc: cleanup large_gfp in vm_area_alloc_pages()mm/vmalloc.c+1 -30 replies
4/4mm/vmalloc: cleanup gfp flag use in new_vmap_block()mm/vmalloc.c+1 -20 replies

Reviews trailers per patch

2 of 4 patches have a Reviewed-by or Acked-by.

PatchChristoph HellwigUladzislau Rezki (Sony)
1/4R-b
2/4
3/4
4/4R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/4] make vmalloc gfp flags usage more apparent

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 hard to read gfp code.

---
Based on currnet mm-new. Linked rfc [1] and rfc v2[2] for convenience.

Changes from last rfc:
- Collected review tags (Patches 1 & 4)
- Add unlikely keyword to help the compiler
- Replace pr_warn() with WARN(1)

RFC v2:
- Whitelist supported gfp flags instead of blacklisting the unsupported
- Move the flags check up to the only exported functions that accept flags:
__vmalloc_noprof() and vmalloc_huge_node_prof()

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/linux-mm/[email protected]/

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 | 46 ++++++++++++++++++++++++++++++++++++++--------
 1 file changed, 38 insertions(+), 8 deletions(-)
Signature · 1 line
2.51.1