Skip to content

RFC Share PMDs for FS/DAX on x86

Larry Bassel linux-mm linux-nvdimm lkml nvdimm 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 RFC Latest2 patches 1 replyIn review
  2. v1 RFC2 patches 11 repliesSuperseded

Changes in v2 from the cover letter

* Rebased on v5.2-rc3

* An incorrect reference to "page table entries" was fixed (pointed out by Kirill Shutemov)

* Renamed CONFIG_ARCH_WANT_HUGE_PMD_SHARE
to CONFIG_ARCH_HAS_HUGE_PMD_SHARE instead of introducing a new config option (suggested by Dan Williams)

* Removed some unnecessary #ifdef stubs (suggested by Matt Wilcox)

* A previously overlooked case involving mprotect() is now handled properly (pointed out by Mike Kravetz)

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2Rename CONFIG_ARCH_WANT_HUGE_PMD_SHARE to CONFIG_ARCH_HAS_HUGE_PMD_SHAREarch/arm64/Kconfig arch/arm64/mm/hugetlbpage.c arch/x86/Kconfig +1 more+6 -60 replies
2/2Implement sharing/unsharing of PMDs for FS/DAXinclude/linux/hugetlb.h mm/huge_memory.c mm/hugetlb.c +1 more+152 -51 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC PATCH v2 0/2] Share PMDs for FS/DAX on x86

Changes from v1 to v2:

* Rebased on v5.2-rc3

* An incorrect reference to "page table entries" was fixed (pointed out by Kirill Shutemov)

* Renamed CONFIG_ARCH_WANT_HUGE_PMD_SHARE
to CONFIG_ARCH_HAS_HUGE_PMD_SHARE instead of introducing a new config option (suggested by Dan Williams)

* Removed some unnecessary #ifdef stubs (suggested by Matt Wilcox)

* A previously overlooked case involving mprotect() is now handled properly (pointed out by Mike Kravetz)

---

This patchset implements sharing of page tables pointing to 2MiB pages (PMDs) for FS/DAX on x86.

Only shared mmapings of files (i.e. neither private mmapings nor anonymous pages) are eligible for PMD sharing.

Due to the characteristics of DAX, this code is simpler and less intrusive than the general case would be.

In our use case (high end Oracle database using DAX/XFS/PMEM/2MiB pages) there would be significant memory savings.

A future system might have 6 TiB of PMEM on it and there might be 10000 processes each mapping all of this 6 TiB. Here the savings would be approximately
(6 TiB / 2 MiB) * 8 bytes (page table size) * 10000 = 240 GiB (and these page tables themselves would probably be in non-PMEM (ordinary RAM)).

There would also be a reduction in page faults because in some cases the page fault has already been satisfied and the page table entry has been filled in (and so the processes after the first would not take a fault).

The code for detecting whether PMDs can be shared and the implementation of sharing and unsharing is based on, but somewhat different than that in mm/hugetlb.c, though some of the code from this file could be reused and thus was made non-static.

Larry Bassel (2):
Rename CONFIG_ARCH_WANT_HUGE_PMD_SHARE to
CONFIG_ARCH_HAS_HUGE_PMD_SHARE
Implement sharing/unsharing of PMDs for FS/DAX

 arch/arm64/Kconfig          |   2 +-
 arch/arm64/mm/hugetlbpage.c |   2 +-
 arch/x86/Kconfig            |   2 +-
 include/linux/hugetlb.h     |   4 ++
 mm/huge_memory.c            |  37 +++++++++++++++
 mm/hugetlb.c                |  14 +++---
 mm/memory.c                 | 108 +++++++++++++++++++++++++++++++++++++++++++-
 7 files changed, 158 insertions(+), 11 deletions(-)
Signature · 6 lines
1.8.3.1

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm