Skip to contentSkip to conversation

selftests-mm-move-hugetlb-helpers-to-hugepage_settings.patch removed from -mm tree

merged mm-stable Andrew Morton 1 participant 1 message Jun 21

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: selftests/mm: move HugeTLB helpers to hugepage_settings
has been removed from the -mm tree. Its filename was
selftests-mm-move-hugetlb-helpers-to-hugepage_settings.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: "Mike Rapoport (Microsoft)" <[email protected]>
Subject: selftests/mm: move HugeTLB helpers to hugepage_settings
Date: Mon, 11 May 2026 19:28:08 +0300

Move library functions that abstract HugeTLB /proc and /sysfs access from vm_util to hugepage_settings.

This will help creating common helpers that save and restore HugeTLB and THP settings.

Cc Baolin Wang <[email protected]>
Cc Barry Song <[email protected]>
Cc David Hildenbrand <[email protected]>
Cc Dev Jain <[email protected]>
Cc Donet Tom <[email protected]>
Cc Jason Gunthorpe <[email protected]>
Cc John Hubbard <[email protected]>
Cc Lance Yang <[email protected]>
Cc Leon Romanovsky <[email protected]>
Cc Liam Howlett <[email protected]>
Cc Li Wang <[email protected]>
Cc Lorenzo Stoakes <[email protected]>
Cc Mark Brown <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Nico Pache <[email protected]>
Cc Peter Xu <[email protected]>
Cc Ryan Roberts <[email protected]>
Cc Shuah Khan <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc Zi Yan <[email protected]>

---

 tools/testing/selftests/mm/gup_longterm.c             |    1 
 tools/testing/selftests/mm/hmm-tests.c                |    2 
 tools/testing/selftests/mm/hugepage_settings.c        |   68 ++++++++++
 tools/testing/selftests/mm/hugepage_settings.h        |    8 +
 tools/testing/selftests/mm/hugetlb-madvise.c          |    1 
 tools/testing/selftests/mm/hugetlb-mmap.c             |    1 
 tools/testing/selftests/mm/hugetlb-vmemmap.c          |    1 
 tools/testing/selftests/mm/hugetlb_dio.c              |    1 
 tools/testing/selftests/mm/hugetlb_fault_after_madv.c |    1 
 tools/testing/selftests/mm/hugetlb_madv_vs_map.c      |    1 
 tools/testing/selftests/mm/protection_keys.c          |    1 
 tools/testing/selftests/mm/thuge-gen.c                |    1 
 tools/testing/selftests/mm/uffd-common.h              |    1 
 tools/testing/selftests/mm/va_high_addr_switch.c      |    1 
 tools/testing/selftests/mm/vm_util.c                  |   67 ---------
 tools/testing/selftests/mm/vm_util.h                  |    3 
 16 files changed, 88 insertions(+), 71 deletions(-)
tools/testing/selftests/mm/gup_longterm.c renamed from tools/testing/selftests/mm/gup_longterm.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -29,6 +29,7 @@
 #include "../../../../mm/gup_test.h"
 #include "kselftest.h"
 #include "vm_util.h"
+#include "hugepage_settings.h"
 
 static size_t pagesize;
 static int nr_hugetlbsizes;
tools/testing/selftests/mm/hmm-tests.c renamed from tools/testing/selftests/mm/hmm-tests.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -1
@@ -11,6 +11,7 @@
  */
 
 #include "kselftest_harness.h"
+#include "hugepage_settings.h"
 
 #include <errno.h>
 #include <fcntl.h>
@@ -27,7 +28,6 @@
 #include <sys/ioctl.h>
 #include <sys/time.h>
 
-
 /*
  * This is a private UAPI to the kernel test module so it isn't exported
  * in the usual include/uapi/... directory.
tools/testing/selftests/mm/hugepage_settings.c renamed from tools/testing/selftests/mm/hugepage_settings.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +68 -0

78 lines not on this page · raw message

tools/testing/selftests/mm/hugepage_settings.h renamed from tools/testing/selftests/mm/hugepage_settings.h~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +8 -0
@@ -6,6 +6,8 @@
 #include <stddef.h>
 #include <stdint.h>
 
+/* Transparent Huge Pages (THP) */
+
 enum thp_enabled {
 	THP_NEVER,
 	THP_ALWAYS,
@@ -86,4 +88,10 @@ unsigned long thp_shmem_supported_orders
 bool thp_available(void);
 bool thp_is_enabled(void);
 
+/* HugeTLB */
+
+int detect_hugetlb_page_sizes(size_t sizes[], int max);
+unsigned long default_huge_page_size(void);
+unsigned long get_free_hugepages(void);
+
 #endif /* __HUGEPAGE_SETTINGS_H__ */
tools/testing/selftests/mm/hugetlb_dio.c renamed from tools/testing/selftests/mm/hugetlb_dio.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -20,6 +20,7 @@
 #include <sys/syscall.h>
 #include "vm_util.h"
 #include "kselftest.h"
+#include "hugepage_settings.h"
 
 #ifndef STATX_DIOALIGN
 #define STATX_DIOALIGN		0x00002000U
tools/testing/selftests/mm/hugetlb_fault_after_madv.c renamed from tools/testing/selftests/mm/hugetlb_fault_after_madv.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -10,6 +10,7 @@
 
 #include "vm_util.h"
 #include "kselftest.h"
+#include "hugepage_settings.h"
 
 #define INLOOP_ITER 100
 
tools/testing/selftests/mm/hugetlb-madvise.c renamed from tools/testing/selftests/mm/hugetlb-madvise.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -20,6 +20,7 @@
 #include <fcntl.h>
 #include "vm_util.h"
 #include "kselftest.h"
+#include "hugepage_settings.h"
 
 #define MIN_FREE_PAGES	20
 #define NR_HUGE_PAGES	10	/* common number of pages to map/allocate */
tools/testing/selftests/mm/hugetlb_madv_vs_map.c renamed from tools/testing/selftests/mm/hugetlb_madv_vs_map.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -25,6 +25,7 @@
 #include <unistd.h>
 
 #include "vm_util.h"
+#include "hugepage_settings.h"
 
 #define INLOOP_ITER 100
 
tools/testing/selftests/mm/hugetlb-mmap.c renamed from tools/testing/selftests/mm/hugetlb-mmap.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -18,6 +18,7 @@
 #include <linux/memfd.h>
 #include "vm_util.h"
 #include "kselftest.h"
+#include "hugepage_settings.h"
 
 #define LENGTH (256UL*1024*1024)
 #define PROTECTION (PROT_READ | PROT_WRITE)
tools/testing/selftests/mm/hugetlb-vmemmap.c renamed from tools/testing/selftests/mm/hugetlb-vmemmap.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -11,6 +11,7 @@
 #include <sys/mman.h>
 #include <fcntl.h>
 #include "vm_util.h"
+#include "hugepage_settings.h"
 
 #define PAGE_COMPOUND_HEAD	(1UL << 15)
 #define PAGE_COMPOUND_TAIL	(1UL << 16)
tools/testing/selftests/mm/protection_keys.c renamed from tools/testing/selftests/mm/protection_keys.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -46,6 +46,7 @@
 #include <sys/ptrace.h>
 #include <setjmp.h>
 
+#include "hugepage_settings.h"
 #include "pkey-helpers.h"
 
 int iteration_nr = 1;
tools/testing/selftests/mm/thuge-gen.c renamed from tools/testing/selftests/mm/thuge-gen.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -28,6 +28,7 @@
 #include <string.h>
 #include "vm_util.h"
 #include "kselftest.h"
+#include "hugepage_settings.h"
 
 #if !defined(MAP_HUGETLB)
 #define MAP_HUGETLB	0x40000
tools/testing/selftests/mm/uffd-common.h renamed from tools/testing/selftests/mm/uffd-common.h~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -37,6 +37,7 @@
 
 #include "kselftest.h"
 #include "vm_util.h"
+#include "hugepage_settings.h"
 
 #define UFFD_FLAGS	(O_CLOEXEC | O_NONBLOCK | UFFD_USER_MODE_ONLY)
 
tools/testing/selftests/mm/va_high_addr_switch.c renamed from tools/testing/selftests/mm/va_high_addr_switch.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +1 -0
@@ -11,6 +11,7 @@
 
 #include "vm_util.h"
 #include "kselftest.h"
+#include "hugepage_settings.h"
 
 /*
  * The hint addr value is used to allocate addresses
tools/testing/selftests/mm/vm_util.c renamed from tools/testing/selftests/mm/vm_util.c~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +0 -67

85 lines not on this page · raw message

tools/testing/selftests/mm/vm_util.h renamed from tools/testing/selftests/mm/vm_util.h~selftests-mm-move-hugetlb-helpers-to-hugepage_settings +0 -3
@@ -94,8 +94,6 @@ bool check_huge_anon(void *addr, int nr_
 bool check_huge_file(void *addr, int nr_hpages, uint64_t hpage_size);
 bool check_huge_shmem(void *addr, int nr_hpages, uint64_t hpage_size);
 int64_t allocate_transhuge(void *ptr, int pagemap_fd);
-unsigned long default_huge_page_size(void);
-int detect_hugetlb_page_sizes(size_t sizes[], int max);
 int pageflags_get(unsigned long pfn, int kpageflags_fd, uint64_t *flags);
 
 int uffd_register(int uffd, void *addr, uint64_t len,
@@ -103,7 +101,6 @@ int uffd_register(int uffd, void *addr,
 int uffd_unregister(int uffd, void *addr, uint64_t len);
 int uffd_register_with_ioctls(int uffd, void *addr, uint64_t len,
 			      bool miss, bool wp, bool minor, uint64_t *ioctls);
-unsigned long get_free_hugepages(void);
 bool check_vmflag_io(void *addr);
 bool check_vmflag_pfnmap(void *addr);
 bool check_vmflag_guard(void *addr);

_

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