Skip to contentSkip to conversation

selftests/mincore: Added comment for minicore test

PATCH In review Suresh 2 participants 2 messages May 10, 2025 – May 12, 2025 Kselftest

lore
Share & tools
lore

Suresh

author
#0 lore raw

PATCH 1/1 selftests/mincore: Added comment for minicore test

---
 tools/testing/selftests/mincore/mincore_selftest.c | 5 +++++
 1 file changed, 5 insertions(+)
tools/testing/selftests/mincore/mincore_selftest.c +5 -0
index 17ed3e9917ca..c4f0d21f7678 100644
@@ -146,6 +146,11 @@ TEST(check_huge_pages)
 	page_size = sysconf(_SC_PAGESIZE);
 
 	errno = 0;
+	/*
+         * Attempt to map a huge page
+         * MAP_HUGETLB flag requests a huge page allocation
+         * Size is normal page_size, but kernel uses huge page backing
+         */
 	addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE,
 		MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB,
 		-1, 0);
Signature · 1 line
2.45.2
maintainer
#1 lore raw

On 5/10/25 02:29, Suresh wrote:

No change log

Quoted 10 lines
---
  tools/testing/selftests/mincore/mincore_selftest.c | 5 +++++
  1 file changed, 5 insertions(+)
tools/testing/selftests/mincore/mincore_selftest.c +0 -0
index 17ed3e9917ca..c4f0d21f7678 100644

tools/testing/selftests/mincore/mincore_selftest.c TEST(check_huge_pages) · line 153

Quoted 8 lines
tools/testing/selftests/mincore/mincore_selftest.c +5 -0
@@ -146,6 +146,11 @@ TEST(check_huge_pages)
  	page_size = sysconf(_SC_PAGESIZE);
 
  	errno = 0;
+	/*
+         * Attempt to map a huge page
+         * MAP_HUGETLB flag requests a huge page allocation
+         * Size is normal page_size, but kernel uses huge page backing
+         */

Explain why this comment is needed in the change log.

tools/testing/selftests/mincore/mincore_selftest.c TEST(check_huge_pages) · line 156

Quoted 3 lines
tools/testing/selftests/mincore/mincore_selftest.c +0 -0
  	addr = mmap(NULL, page_size, PROT_READ | PROT_WRITE,
  		MAP_PRIVATE | MAP_ANONYMOUS | MAP_HUGETLB,
  		-1, 0);

thanks,
-- Shuah