Skip to content

Commit

Permalink
arm64: mm: hugetlb: add support for free vmemmap pages of HugeTLB
Browse files Browse the repository at this point in the history
The preparation of supporting freeing vmemmap associated with each
infrastructure is ready, so now we can support it for arm64.

Signed-off-by: Muchun Song <songmuchun@bytedance.com>
  • Loading branch information
Muchun Song authored and intel-lab-lkp committed Mar 10, 2021
1 parent 92924b2 commit d0b8d83
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions arch/arm64/mm/mmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
#include <linux/io.h>
#include <linux/mm.h>
#include <linux/vmalloc.h>
#include <linux/hugetlb.h>

#include <asm/barrier.h>
#include <asm/cputype.h>
Expand Down Expand Up @@ -1109,6 +1110,10 @@ int __meminit vmemmap_populate(unsigned long start, unsigned long end, int node,
pmd_t *pmdp;

WARN_ON((start < VMEMMAP_START) || (end > VMEMMAP_END));

if (is_hugetlb_free_vmemmap_enabled() && !altmap)
return vmemmap_populate_basepages(start, end, node, altmap);

do {
next = pmd_addr_end(addr, end);

Expand Down
4 changes: 2 additions & 2 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -239,9 +239,9 @@ config HUGETLB_PAGE

config HUGETLB_PAGE_FREE_VMEMMAP
def_bool HUGETLB_PAGE
depends on X86_64
select HAVE_BOOTMEM_INFO_NODE if X86_64
depends on SPARSEMEM_VMEMMAP
depends on HAVE_BOOTMEM_INFO_NODE
depends on X86_64 || ARM64

config MEMFD_CREATE
def_bool TMPFS || HUGETLBFS
Expand Down

0 comments on commit d0b8d83

Please sign in to comment.