Skip to contentSkip to conversation

mm-shmem-add-mthp-support-for-anonymous-shmem.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 25, 2024

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm: shmem: add mTHP support for anonymous shmem
has been removed from the -mm tree. Its filename was
mm-shmem-add-mthp-support-for-anonymous-shmem.patch

This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Baolin Wang <[email protected]>
Subject: mm: shmem: add mTHP support for anonymous shmem
Date: Tue, 11 Jun 2024 18:11:08 +0800

Commit 19eaf44954df adds multi-size THP (mTHP) for anonymous pages, that can allow THP to be configured through the sysfs interface located at '/sys/kernel/mm/transparent_hugepage/hugepage-XXkb/enabled'.

However, the anonymous shmem will ignore the anonymous mTHP rule configured through the sysfs interface, and can only use the PMD-mapped THP, that is not reasonable. Users expect to apply the mTHP rule for all anonymous pages, including the anonymous shmem, in order to enjoy the benefits of mTHP. For example, lower latency than PMD-mapped THP, smaller memory bloat than PMD-mapped THP, contiguous PTEs on ARM architecture to reduce TLB miss etc. In addition, the mTHP interfaces can be extended to support all shmem/tmpfs scenarios in the future, especially for the shmem mmap() case.

The primary strategy is similar to supporting anonymous mTHP. Introduce a new interface '/mm/transparent_hugepage/hugepage-XXkb/shmem_enabled', which can have almost the same values as the top-level '/sys/kernel/mm/transparent_hugepage/shmem_enabled', with adding a new additional "inherit" option and dropping the testing options 'force' and 'deny'. By default all sizes will be set to "never" except PMD size, which is set to "inherit". This ensures backward compatibility with the anonymous shmem enabled of the top level, meanwhile also allows independent control of anonymous shmem enabled for each mTHP.

---

 include/linux/huge_mm.h |   10 ++
 mm/shmem.c              |  189 +++++++++++++++++++++++++++++++-------
 2 files changed, 168 insertions(+), 31 deletions(-)
include/linux/huge_mm.h renamed from include/linux/huge_mm.h~mm-shmem-add-mthp-support-for-anonymous-shmem +10 -0
@@ -560,6 +560,16 @@ static inline bool thp_migration_support
 {
 	return false;
 }
+
+static inline int highest_order(unsigned long orders)
+{
+	return 0;
+}
+
+static inline int next_order(unsigned long *orders, int prev)
+{
+	return 0;
+}
 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
 
 static inline int split_folio_to_list_to_order(struct folio *folio,
mm/shmem.c renamed from mm/shmem.c~mm-shmem-add-mthp-support-for-anonymous-shmem +158 -31

243 lines not on this page · raw message

_

Patches currently in -mm which might be from [email protected] are