Skip to content

vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP

Song Liu bpf linux-mm lkml 6 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest4 patches 56 repliesIn review
  2. v3 posting 2/24 patches 10 repliesSuperseded
  3. v3 posting 1/24 patches 0 repliesSuperseded
Earlier versions · 3
VersionPostedPatchesRepliesStatus
v2 posting 2/23 patches12 repliesSuperseded
v2 posting 1/23 patches2 repliesSuperseded
v12 patches8 repliesSuperseded

Changes in v4 from the cover letter

1. Fix __weak module_alloc_huge; remove unused vmalloc_huge; rename __vmalloc_huge => vmalloc_huge. (Christoph Hellwig)
2. Use vzalloc (as it was before vmalloc_no_huge) and clean up comments in kvm_s390_pv_alloc_vm.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAParch/Kconfig arch/powerpc/kernel/module.c arch/s390/kvm/pv.c +2 more+16 -201 reply
2/4page_alloc: use vmalloc_huge for large system hashmm/page_alloc.c+1 -14 replies
3/4module: introduce module_alloc_hugearch/x86/kernel/module.c include/linux/moduleloader.h kernel/module.c+34 -02 replies
4/4bpf: use module_alloc_huge for bpf_prog_packkernel/bpf/core.c+4 -30 replies

Reviews trailers per patch

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

PatchChristoph HellwigRik van Riel
1/4R-b R-b
2/4R-b R-b
3/4R-b
4/4

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

Read the v4 thread

Cover letter [PATCH v4 bpf 0/4] vmalloc: bpf: introduce VM_ALLOW_HUGE_VMAP

Changes v3 => v4:
1. Fix __weak module_alloc_huge; remove unused vmalloc_huge; rename __vmalloc_huge => vmalloc_huge. (Christoph Hellwig)
2. Use vzalloc (as it was before vmalloc_no_huge) and clean up comments in kvm_s390_pv_alloc_vm.

Changes v2 => v3:
1. Use __vmalloc_huge in alloc_large_system_hash.
2. Use EXPORT_SYMBOL_GPL for new functions. (Christoph Hellwig)
3. Add more description about the issues and changes.(Christoph Hellwig, Rick Edgecombe).

Changes v1 => v2:
1. Add vmalloc_huge(). (Christoph Hellwig)
2. Add module_alloc_huge(). (Christoph Hellwig)
3. Add Fixes tag and Link tag. (Thorsten Leemhuis)

Enabling HAVE_ARCH_HUGE_VMALLOC on x86_64 and use it for bpf_prog_pack has caused some issues [1], as many users of vmalloc are not yet ready to handle huge pages. To enable a more smooth transition to use huge page backed vmalloc memory, this set replaces VM_NO_HUGE_VMAP flag with an new opt-in flag, VM_ALLOW_HUGE_VMAP. More discussions about this topic can be found at [2].

Patch 1 removes VM_NO_HUGE_VMAP and adds VM_ALLOW_HUGE_VMAP. Patch 2 uses VM_ALLOW_HUGE_VMAP in bpf_prog_pack.

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

Song Liu (4):
vmalloc: replace VM_NO_HUGE_VMAP with VM_ALLOW_HUGE_VMAP
page_alloc: use vmalloc_huge for large system hash
module: introduce module_alloc_huge
bpf: use module_alloc_huge for bpf_prog_pack

 arch/Kconfig                 |  6 ++----
 arch/powerpc/kernel/module.c |  2 +-
 arch/s390/kvm/pv.c           |  7 +------
 arch/x86/kernel/module.c     | 21 +++++++++++++++++++++
 include/linux/moduleloader.h |  5 +++++
 include/linux/vmalloc.h      |  4 ++--
 kernel/bpf/core.c            |  7 ++++---
 kernel/module.c              |  8 ++++++++
 mm/page_alloc.c              |  2 +-
 mm/vmalloc.c                 | 17 ++++++++++-------
 10 files changed, 55 insertions(+), 24 deletions(-)

--
2.30.2