Skip to content

GB pages hugetlb support

Andi Kleen linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest18 patches 57 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/18Convert hugeltlb.c over to pass global state around in a structurearch/ia64/mm/hugetlbpage.c arch/powerpc/mm/hugetlbpage.c arch/sh/mm/hugetlbpage.c +9 more+270 -1692 replies
2/18Add basic support for more than one hstate in hugetlbfsinclude/linux/hugetlb.h mm/hugetlb.c+44 -96 replies
3/18Convert /proc output code over to report multiple hstatesmm/hugetlb.c+39 -201 reply
4/18Add basic support for more than one hstate in hugetlbfsmm/hugetlb.c+11 -44 replies
5/18Expand the hugetlbfs sysctls to handle arrays for all hstatesinclude/linux/hugetlb.h kernel/sysctl.c mm/hugetlb.c+35 -153 replies
6/18Add support to have individual hstates for each hugetlbfs mountfs/hugetlbfs/inode.c include/linux/hugetlb.h mm/hugetlb.c+67 -172 replies
7/18Abstract out the NUMA node round robin code into a separate functionmm/hugetlb.c+22 -153 replies
8/18Add a __alloc_bootmem_node_nopanicinclude/linux/bootmem.h mm/bootmem.c+16 -01 reply
9/18Export prep_compound_page to the hugetlb allocatormm/internal.h mm/page_alloc.c+3 -10 replies
10/18Factor out new huge page preparation code into separate functionmm/hugetlb.c+13 -82 replies
11/18Fix alignment bug in bootmem allocatormm/bootmem.c+3 -113 replies
12/18Add support to allocate hugetlb pages that are larger than MAX_ORDERmm/hugetlb.c+62 -23 replies
13/18Add support to allocate hugepages of different size with hugepages=...include/linux/hugetlb.h mm/hugetlb.c+19 -53 replies
14/18Clean up hugetlb boot time printkmm/hugetlb.c+30 -31 reply
15/18Add support to x86-64 to allocate and lookup GB pages in hugetlbarch/x86/mm/hugetlbpage.c+12 -40 replies
16/18Add huge pud support to hugetlbfsarch/ia64/mm/hugetlbpage.c arch/powerpc/mm/hugetlbpage.c arch/sh/mm/hugetlbpage.c +4 more+59 -10 replies
17/18Add huge pud support to mm/memory.cmm/memory.c+9 -10 replies
18/18Implement hugepagesz= option for x86-64Documentation/kernel-parameters.txt arch/x86/mm/hugetlbpage.c include/asm-x86/page.h+28 -23 replies

Reviews trailers per patch

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

PatchMel Gorman
1/18
2/18
3/18
4/18
5/18
6/18
7/18A-b
8/18A-b
9/18
10/18
11/18
12/18
13/18
14/18
15/18
16/18
17/18
18/18

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/18] GB pages hugetlb support

This patchkit supports GB pages for hugetlb on x86-64 in addition to
2MB pages. This is the sucessor of an earlier much simpler
patchkit that allowed to set the hugepagesz globally at boot to 1GB pages. The advantage of this more complex patchkit is that it allows 2MB page users and 1GB page users to coexist (although not on the same hugetlbfs mount points)

It first adds some straight-forward infrastructure to hugetlbfs to support multiple page sizes. Then it uses that infrastructure to implement support for huge pages > MAX_ORDER (which can be allocated at boot with bootmem only). Then the x86-64 port is extended to support 1GB pages on CPUs that support them (AMD Quad Cores)

There is no support for i386 because GB pages are only available in long mode.

The variable page size support is currently limited to the specific use case of the single additional 1GB page size. Using it for more page sizes (especially those < MAX_ORDER) would require some more work, although the basic infrastructure is all in place and the incremental work will be small. But I didn't bother to implement some corner cases not needed for the GB page case. I usually added comments so they should be easy to find (and fix) later however :)

I hacked in also cpuset support. It would be good if Paul double checked that.

GB pages are only intended to be used in special situations, like dedicated databases where complicated configuration does not matter. That is why they have some limitations:
- Can be only allocated at boot (using hugepagesz=1G hugepages=...)
- Can't be freed at runtime
- One hugetlbfs mount per page size (using the pagesize=... mount option). This is a little awkward, but greatly simplified the code.
- No IPC SHM support currently (would not be very hard to do, but it is unclear what the best API for this is. Suggestions welcome)

Some of this would be fixable later.

Known issues:
- GB pages are not reported in total memory, which gives confusing free(1) output
- I have still to explain myself how and if free_pgd_pages works on hugetlb, both with 1GB and with 2MB pages.
- cpuset support is a little dubious, but the code was even before quite strange.
- lockdep sometimes complains about recursive page_table_locks for shared hugetlb memory, but as far as I can see I didn't actually change this area. Looks a little dubious, might be a false positive too.
- hugemmap04 from LTP fails. Cause unknown currently

-Andi

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>