Skip to contentSkip to conversation

Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems"

PATCH Applied Leon Hwang 2 participants 2 messages Oct 23, 2025 – Oct 27, 2025

Subsystems (3)
lore
Share & tools
lore

Leon Hwang

author
#0 lore raw

PATCH v2 1/1 Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems"

This reverts commit a584c7734a4dd050451fcdd65c66317e15660e81 to avoid the build error:

map_hugetlb.c: In function 'main':
map_hugetlb.c:79:25: warning: implicit declaration of function 'default_huge_page_size' [-Wimplicit-function-declaration]
79 | hugepage_size = default_huge_page_size();

---
v1 -> v2:
- Revert the commit instead of fixing the build error.
- https://lore.kernel.org/linux-mm/[email protected]/

 tools/testing/selftests/vm/map_hugetlb.c | 7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/vm/map_hugetlb.c +0 -7
index c65c55b7a789..312889edb84a 100644
@@ -15,7 +15,6 @@
 #include <unistd.h>
 #include <sys/mman.h>
 #include <fcntl.h>
-#include "vm_util.h"
 
 #define LENGTH (256UL*1024*1024)
 #define PROTECTION (PROT_READ | PROT_WRITE)
@@ -71,16 +70,10 @@ int main(int argc, char **argv)
 {
 	void *addr;
 	int ret;
-	size_t hugepage_size;
 	size_t length = LENGTH;
 	int flags = FLAGS;
 	int shift = 0;
 
-	hugepage_size = default_huge_page_size();
-	/* munmap with fail if the length is not page aligned */
-	if (hugepage_size > length)
-		length = hugepage_size;
-
 	if (argc > 1)
 		length = atol(argv[1]) << 20;
 	if (argc > 2) {

--
2.51.0

maintainer Applied
#1 lore raw

Patch "Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems"" has been added to the 6.1-stable tree

This is a note to let you know that I've just added the patch titled

Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems"

to the 6.1-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
revert-selftests-mm-fix-map_hugetlb-failure-on-64k-page-size-systems.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

From [email protected] Mon Oct 27 12:22:10 2025
From: Leon Hwang <[email protected]>
Date: Thu, 23 Oct 2025 09:47:32 +0800
Subject: Revert "selftests: mm: fix map_hugetlb failure on 64K page size systems"
To: [email protected], [email protected]
Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], Leon Hwang <[email protected]>
Message-ID: <[email protected]>

From: Leon Hwang <[email protected]>

This reverts commit a584c7734a4dd050451fcdd65c66317e15660e81 which is commit 91b80cc5b39f00399e8e2d17527cad2c7fa535e2 upstream.

This fixes the following build error:

map_hugetlb.c: In function 'main':
map_hugetlb.c:79:25: warning: implicit declaration of function 'default_huge_page_size' [-Wimplicit-function-declaration]
79 | hugepage_size = default_huge_page_size();

---
 tools/testing/selftests/vm/map_hugetlb.c |    7 -------
 1 file changed, 7 deletions(-)
tools/testing/selftests/vm/map_hugetlb.c +0 -7
@@ -15,7 +15,6 @@
 #include <unistd.h>
 #include <sys/mman.h>
 #include <fcntl.h>
-#include "vm_util.h"
 
 #define LENGTH (256UL*1024*1024)
 #define PROTECTION (PROT_READ | PROT_WRITE)
@@ -71,16 +70,10 @@ int main(int argc, char **argv)
 {
 	void *addr;
 	int ret;
-	size_t hugepage_size;
 	size_t length = LENGTH;
 	int flags = FLAGS;
 	int shift = 0;
 
-	hugepage_size = default_huge_page_size();
-	/* munmap with fail if the length is not page aligned */
-	if (hugepage_size > length)
-		length = hugepage_size;
-
 	if (argc > 1)
 		length = atol(argv[1]) << 20;
 	if (argc > 2) {

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

queue-6.1/revert-selftests-mm-fix-map_hugetlb-failure-on-64k-page-size-systems.patch