linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] mm/arm64: re-enable HVO
@ 2024-08-06  2:21 Yu Zhao
  2024-08-06  2:21 ` [RFC PATCH 1/4] mm: HVO: introduce helper function to update and flush pgtable Yu Zhao
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Yu Zhao @ 2024-08-06  2:21 UTC (permalink / raw)
  To: Catalin Marinas, Will Deacon
  Cc: Andrew Morton, David Rientjes, Douglas Anderson,
	Frank van der Linden, Mark Rutland, Muchun Song, Nanyong Sun,
	Yang Shi, linux-arm-kernel, linux-mm, linux-kernel, Yu Zhao

This series presents one of the previously discussed approaches to
re-enable HugeTLB Vmemmap Optimization (HVO) on arm64. HVO was
disabled by commit 060a2c92d1b6 ("arm64: mm: hugetlb: Disable
HUGETLB_PAGE_OPTIMIZE_VMEMMAP") due to the following reason:

  This is deemed UNPREDICTABLE by the Arm architecture without a
  break-before-make sequence (make the PTE invalid, TLBI, write the
  new valid PTE). However, such sequence is not possible since the
  vmemmap may be concurrently accessed by the kernel.

Other approaches that have been discussed include:
  A. Handle kernel PF while doing BBM [1],
  B. Use stop_machine() while doing BBM [2], and,
  C. Enable FEAT_BBM level 2 and keep the memory contents at the old
     and new output addresses unchanged to avoid BBM (D8.16.1-2) [3].

A quick comparison between this approach (D) and the above approaches:
  --+------------------------------+-----------------------------+
    |              Pro             |             Con             |
  --+------------------------------+-----------------------------+
  A | Low latency, h/w independent | Predictability concerns [4] |
  B | Predictable, h/w independent | High latency                |
  C | Predictable, low latency     | H/w dependent, complex      |
  D | Predictable, h/w independent | Medium latency              |
  --+------------------------------+-----------------------------+

[1] https://lore.kernel.org/20240113094436.2506396-1-sunnanyong@huawei.com/
[2] https://lore.kernel.org/ZbKjHHeEdFYY1xR5@arm.com/
[3] https://lore.kernel.org/Zo68DP6siXfb6ZBR@arm.com/
[4] https://lore.kernel.org/20240326125409.GA9552@willie-the-truck/

Nanyong Sun (2):
  mm: HVO: introduce helper function to update and flush pgtable
  arm64: mm: Re-enable OPTIMIZE_HUGETLB_VMEMMAP

Yu Zhao (2):
  arm64: use IPIs to pause/resume remote CPUs
  arm64: pause remote CPUs to update vmemmap

 arch/arm64/Kconfig               |   1 +
 arch/arm64/include/asm/pgalloc.h |  55 ++++++++++++++++
 arch/arm64/include/asm/smp.h     |   3 +
 arch/arm64/kernel/smp.c          | 110 +++++++++++++++++++++++++++++++
 mm/hugetlb_vmemmap.c             |  69 +++++++++++++++----
 5 files changed, 226 insertions(+), 12 deletions(-)


base-commit: de9c2c66ad8e787abec7c9d7eff4f8c3cdd28aed
-- 
2.46.0.rc2.264.g509ed76dc8-goog



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-08-08 16:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-06  2:21 [RFC PATCH 0/4] mm/arm64: re-enable HVO Yu Zhao
2024-08-06  2:21 ` [RFC PATCH 1/4] mm: HVO: introduce helper function to update and flush pgtable Yu Zhao
2024-08-06  2:21 ` [RFC PATCH 2/4] arm64: use IPIs to pause/resume remote CPUs Yu Zhao
2024-08-06  9:12   ` David Hildenbrand
2024-08-08 16:09   ` Doug Anderson
2024-08-06  2:21 ` [RFC PATCH 3/4] arm64: pause remote CPUs to update vmemmap Yu Zhao
2024-08-06  5:08   ` Yu Zhao
2024-08-06  2:21 ` [RFC PATCH 4/4] arm64: mm: Re-enable OPTIMIZE_HUGETLB_VMEMMAP Yu Zhao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).