Skip to contentSkip to conversation

selftests: mm: fix the incorrect usage() info of khugepaged

PATCH Applied Nanyong Sun 4 participants 5 messages Oct 15, 2024 – Oct 17, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 selftests: mm: fix the incorrect usage() info of khugepaged

The mount option of tmpfs should be huge=advise, not madvise which is not supported and may mislead the users.

Fixes 1b03d0d558a2 ("selftests/vm: add thp collapse file and tmpfs testing")
---
 tools/testing/selftests/mm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/khugepaged.c +1 -1
index 56d4480e8d3c..8a4d34cce36b 100644
@@ -1091,7 +1091,7 @@ static void usage(void)
 	fprintf(stderr, "\n\t\"file,all\" mem_type requires kernel built with\n");
 	fprintf(stderr,	"\tCONFIG_READ_ONLY_THP_FOR_FS=y\n");
 	fprintf(stderr, "\n\tif [dir] is a (sub)directory of a tmpfs mount, tmpfs must be\n");
-	fprintf(stderr,	"\tmounted with huge=madvise option for khugepaged tests to work\n");
+	fprintf(stderr,	"\tmounted with huge=advise option for khugepaged tests to work\n");
 	fprintf(stderr,	"\n\tSupported Options:\n");
 	fprintf(stderr,	"\t\t-h: This help message.\n");
 	fprintf(stderr,	"\t\t-s: mTHP size, expressed as page order.\n");
Signature · 1 line
2.33.0
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Nanyong Sun

The mount option of tmpfs should be huge=advise, not madvise which is not supported and may mislead the users.

Fixes 1b03d0d558a2 ("selftests/vm: add thp collapse file and tmpfs testing")

LGTM.

Quoted 17 lines
---
  tools/testing/selftests/mm/khugepaged.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/khugepaged.c +1 -1
index 56d4480e8d3c..8a4d34cce36b 100644
@@ -1091,7 +1091,7 @@ static void usage(void)
  	fprintf(stderr, "\n\t\"file,all\" mem_type requires kernel built with\n");
  	fprintf(stderr,	"\tCONFIG_READ_ONLY_THP_FOR_FS=y\n");
  	fprintf(stderr, "\n\tif [dir] is a (sub)directory of a tmpfs mount, tmpfs must be\n");
-	fprintf(stderr,	"\tmounted with huge=madvise option for khugepaged tests to work\n");
+	fprintf(stderr,	"\tmounted with huge=advise option for khugepaged tests to work\n");
  	fprintf(stderr,	"\n\tSupported Options:\n");
  	fprintf(stderr,	"\t\t-h: This help message.\n");
  	fprintf(stderr,	"\t\t-s: mTHP size, expressed as page order.\n");
Reviewed-by on v1 1/1
#2 lore raw
In reply to Nanyong Sun
Quoted 2 lines · Nanyong Sun

The mount option of tmpfs should be huge=advise, not madvise which is not supported and may mislead the users.

Agreed.

Quoted 2 lines
Fixes 1b03d0d558a2 ("selftests/vm: add thp collapse file and tmpfs testing")

But nothing is really broken here. This just fixes usage information. Please drop the "Fixes:".

Quoted 10 lines
---
 tools/testing/selftests/mm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/khugepaged.c +0 -0
index 56d4480e8d3c..8a4d34cce36b 100644

tools/testing/selftests/mm/khugepaged.c static void usage(void) · line 1097

Quoted 8 lines
tools/testing/selftests/mm/khugepaged.c +1 -1
@@ -1091,7 +1091,7 @@ static void usage(void)
 	fprintf(stderr, "\n\t\"file,all\" mem_type requires kernel built with\n");
 	fprintf(stderr,	"\tCONFIG_READ_ONLY_THP_FOR_FS=y\n");
 	fprintf(stderr, "\n\tif [dir] is a (sub)directory of a tmpfs mount, tmpfs must be\n");
-	fprintf(stderr,	"\tmounted with huge=madvise option for khugepaged tests to work\n");
+	fprintf(stderr,	"\tmounted with huge=advise option for khugepaged tests to work\n");
 	fprintf(stderr,	"\n\tSupported Options:\n");
 	fprintf(stderr,	"\t\t-h: This help message.\n");
 	fprintf(stderr,	"\t\t-s: mTHP size, expressed as page order.\n");

Without the above "Fixes:" tag,

maintainer
#3 lore raw
Quoted 10 lines · On Thu, 17 Oct 2024 12:31:31 +0530 Anshuman Khandual…
Quoted 2 lines · Nanyong Sun

The mount option of tmpfs should be huge=advise, not madvise which is not supported and may mislead the users.

Agreed.

Quoted 2 lines
Fixes 1b03d0d558a2 ("selftests/vm: add thp collapse file and tmpfs testing")

But nothing is really broken here. This just fixes usage information.

The usage information is broken!

Quoted 1 line

Please drop the "Fixes:".

Fixes is appropriate. It tells people which commit introduced the error.

I don't think it's serious enough to add a cc:stable. Others might disagree.

Quoted 21 lines
Quoted 10 lines
---
 tools/testing/selftests/mm/khugepaged.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/mm/khugepaged.c +0 -0
index 56d4480e8d3c..8a4d34cce36b 100644

tools/testing/selftests/mm/khugepaged.c static void usage(void) · line 1097

Quoted 8 lines
tools/testing/selftests/mm/khugepaged.c +1 -1
@@ -1091,7 +1091,7 @@ static void usage(void)
 	fprintf(stderr, "\n\t\"file,all\" mem_type requires kernel built with\n");
 	fprintf(stderr,	"\tCONFIG_READ_ONLY_THP_FOR_FS=y\n");
 	fprintf(stderr, "\n\tif [dir] is a (sub)directory of a tmpfs mount, tmpfs must be\n");
-	fprintf(stderr,	"\tmounted with huge=madvise option for khugepaged tests to work\n");
+	fprintf(stderr,	"\tmounted with huge=advise option for khugepaged tests to work\n");
 	fprintf(stderr,	"\n\tSupported Options:\n");
 	fprintf(stderr,	"\t\t-h: This help message.\n");
 	fprintf(stderr,	"\t\t-s: mTHP size, expressed as page order.\n");

Without the above "Fixes:" tag,

Quoted 1 line

Thanks.

#4 lore raw
Quoted 7 lines · Andrew Morton
Quoted 5 lines · On Thu, 17 Oct 2024 12:31:31 +0530 Anshuman Khandual…
Quoted 2 lines · Nanyong Sun

The mount option of tmpfs should be huge=advise, not madvise which is not supported and may mislead the users.

Agreed.

Quoted 8 lines
Quoted 2 lines
Quoted 1 line
Fixes 1b03d0d558a2 ("selftests/vm: add thp collapse file and tmpfs testing")

But nothing is really broken here. This just fixes usage information.

The usage information is broken!

Quoted 1 line

Please drop the "Fixes:".

Fixes is appropriate. It tells people which commit introduced the error.

I don't think it's serious enough to add a cc:stable. Others might disagree.

Alright, usage information is part of the functionality itself.