Skip to contentSkip to conversation

selftests/mm: skip split_huge_page_test without the split_huge_pages file

PATCH In review Sasha Levin 5 participants 14 messages Nov 5 – Nov 7

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

PATCH 1/1 selftests/mm: skip split_huge_page_test without the split_huge_pages file

Every case in split_huge_page_test goes through /sys/kernel/debug/split_huge_pages. When that file does not exist, because debugfs is not mounted or the kernel has no CONFIG_DEBUG_FS, the first write bails out of the whole test and it is reported as a failure:

Bail out! write_file(/sys/kernel/debug/split_huge_pages): No such file or directory

Skip the test in that case.

Fixes fa6c02315f74 ("mm: huge_memory: a new debugfs interface for splitting THP tests")

---
Found with KernelCI's NVIDIA lab, which runs the tests in a chroot without debugfs. Tested on an AMD EPYC 9655P with KernelCI's x86_64 build of next-20261104: without debugfs the test now skips, and with debugfs mounted it still passes all 62 cases.

 tools/testing/selftests/mm/split_huge_page_test.c | 3 +++
 1 file changed, 3 insertions(+)
tools/testing/selftests/mm/split_huge_page_test.c +3 -0
index 33a2473327bb7..deabb7db06192 100644
@@ -610,6 +610,9 @@ int main(int argc, char **argv)
 	if (!thp_is_enabled())
 		ksft_exit_skip("Transparent Hugepages not available\n");
 
+	if (access(SPLIT_DEBUGFS, W_OK))
+		ksft_exit_skip("%s: %s\n", SPLIT_DEBUGFS, strerror(errno));
+
 	if (argc > 1)
 		optional_xfs_path = argv[1];
 
Signature · 1 line
2.53.0
reviewer Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Sasha Levin

Every case in split_huge_page_test goes through /sys/kernel/debug/split_huge_pages. When that file does not exist, because debugfs is not mounted or the kernel has no CONFIG_DEBUG_FS, the first write bails out of the whole test and it is reported as a failure:

Bail out! write_file(/sys/kernel/debug/split_huge_pages): No such file or directory

Skip the test in that case.

Fixes fa6c02315f74 ("mm: huge_memory: a new debugfs interface for splitting THP tests")
Signature · 1 line
  Kiryl Shutsemau / Kirill A. Shutemov
reviewer Acked-by on v1 1/1
#2 lore raw
In reply to Sasha Levin
Quoted 11 lines · Sasha Levin

Every case in split_huge_page_test goes through /sys/kernel/debug/split_huge_pages. When that file does not exist, because debugfs is not mounted or the kernel has no CONFIG_DEBUG_FS, the first write bails out of the whole test and it is reported as a failure:

Bail out! write_file(/sys/kernel/debug/split_huge_pages): No such file or directory

Skip the test in that case.

Fixes fa6c02315f74 ("mm: huge_memory: a new debugfs interface for splitting THP tests")
Quoted 9 lines

---
Found with KernelCI's NVIDIA lab, which runs the tests in a chroot without debugfs. Tested on an AMD EPYC 9655P with KernelCI's x86_64 build of next-20261104: without debugfs the test now skips, and with debugfs mounted it still passes all 62 cases.

 tools/testing/selftests/mm/split_huge_page_test.c | 3 +++
 1 file changed, 3 insertions(+)

Thanks. But I do think we need a way of specifying the necessary
Kconfig options for selftests. Oh, we do have one:
https://elixir.bootlin.com/linux/v7.3.1/source/tools/testing/selftests/mm/config. Can you add CONFIG_DEBUG_FS=y to it while at it?

Otherwise, LGTM.

Best Regards,
Yan, Zi

#3 lore raw
Quoted 19 lines · Zi Yan
Quoted 17 lines · Sasha Levin

Every case in split_huge_page_test goes through /sys/kernel/debug/split_huge_pages. When that file does not exist, because debugfs is not mounted or the kernel has no CONFIG_DEBUG_FS, the first write bails out of the whole test and it is reported as a failure:

Bail out! write_file(/sys/kernel/debug/split_huge_pages): No such file or directory

Skip the test in that case.

Fixes fa6c02315f74 ("mm: huge_memory: a new debugfs interface for splitting THP tests")

---
Found with KernelCI's NVIDIA lab, which runs the tests in a chroot without debugfs. Tested on an AMD EPYC 9655P with KernelCI's x86_64 build of next-20261104: without debugfs the test now skips, and with debugfs mounted it still passes all 62 cases.

Quoted 7 lines
Quoted 3 lines
 tools/testing/selftests/mm/split_huge_page_test.c | 3 +++
 1 file changed, 3 insertions(+)

Thanks. But I do think we need a way of specifying the necessary
Kconfig options for selftests. Oh, we do have one:
https://elixir.bootlin.com/linux/v7.3.1/source/tools/testing/selftests/mm/config. Can you add CONFIG_DEBUG_FS=y to it while at it?

Just what I was thinking.

Signature · 3 lines
Cheers,

David
#4 lore raw

PATCH 1/1 selftests/mm: add CONFIG_DEBUG_FS to the config fragment

In reply to Zi Yan

The split_huge_page and gup tests need debugfs, and CONFIG_GUP_TEST depends on it. Add CONFIG_DEBUG_FS=y to the fragment.

---
Merged into an x86_64 tinyconfig, the fragment leaves CONFIG_DEBUG_FS and CONFIG_GUP_TEST unset without this change and sets both with it. x86_64_defconfig already has CONFIG_DEBUG_FS=y and is unaffected.

 tools/testing/selftests/mm/config | 1 +
 1 file changed, 1 insertion(+)
tools/testing/selftests/mm/config +1 -0
index 06f78bd232e2e..ff85b358d04cc 100644
@@ -4,6 +4,7 @@ CONFIG_PTE_MARKER_UFFD_WP=y
 CONFIG_TEST_VMALLOC=m
 CONFIG_DEVICE_PRIVATE=y
 CONFIG_TEST_HMM=m
+CONFIG_DEBUG_FS=y
 CONFIG_GUP_TEST=y
 CONFIG_TRANSPARENT_HUGEPAGE=y
 CONFIG_MEM_SOFT_DIRTY=y

base-commit: dba8aba0a9a00ff781c03d82ae534fc6f8c2e263

Signature · 1 line
2.53.0
reviewer Reviewed-by on v1 1/1
#5 lore raw

Re: [PATCH] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

Quoted 10 lines · Sasha Levin

The split_huge_page and gup tests need debugfs, and CONFIG_GUP_TEST depends on it. Add CONFIG_DEBUG_FS=y to the fragment.

---
Merged into an x86_64 tinyconfig, the fragment leaves CONFIG_DEBUG_FS and CONFIG_GUP_TEST unset without this change and sets both with it. x86_64_defconfig already has CONFIG_DEBUG_FS=y and is unaffected.

Thanks.

Best Regards,
Yan, Zi

#6 lore raw

Re: [PATCH] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

Quoted 13 lines · Zi Yan
Quoted 10 lines · Sasha Levin

The split_huge_page and gup tests need debugfs, and CONFIG_GUP_TEST depends on it. Add CONFIG_DEBUG_FS=y to the fragment.

---
Merged into an x86_64 tinyconfig, the fragment leaves CONFIG_DEBUG_FS and CONFIG_GUP_TEST unset without this change and sets both with it. x86_64_defconfig already has CONFIG_DEBUG_FS=y and is unaffected.

Quoted 3 lines

Thanks.

Thanks, I'll wait a bit and then queue both.

Signature · 3 lines
Cheers,

David
maintainer Applied
#7 lore raw

Re: [PATCH] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

In reply to Sasha Levin
Quoted 2 lines · Sasha Levin

The split_huge_page and gup tests need debugfs, and CONFIG_GUP_TEST depends on it. Add CONFIG_DEBUG_FS=y to the fragment.

Applied, thanks!

tree: mm/core.git
branch: thp-7.5.misc

Applied patches will appear soon in mm-next, followed by linux-next.

Please report any outstanding bugs that were missed during review, so we can either drop the patch series or decide how to fix it up.

It is encouraged to provide Acked-bys, Reviewed-bys, and Tested-bys even though the patches have already been applied. If possible, patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. Further, this is not a guarantee that the patches will go upstream. If in doubt, please check the listed branch.

[1/1] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

      https://git.kernel.org/mm/core/c/31ea5515
Signature · 3 lines
Cheers,

David
maintainer Applied
#8 lore raw

Re: [PATCH] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

In reply to Sasha Levin
Quoted 2 lines · Sasha Levin

The split_huge_page and gup tests need debugfs, and CONFIG_GUP_TEST depends on it. Add CONFIG_DEBUG_FS=y to the fragment.

Applied, thanks!

tree: mm/core.git
branch: core-7.5.misc

Applied patches will appear soon in mm-next, followed by linux-next.

Please report any outstanding bugs that were missed during review, so we can either drop the patch series or decide how to fix it up.

It is encouraged to provide Acked-bys, Reviewed-bys, and Tested-bys even though the patches have already been applied. If possible, patch trailers will be updated.

Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. Further, this is not a guarantee that the patches will go upstream. If in doubt, please check the listed branch.

[1/1] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

      https://git.kernel.org/mm/core/c/194b6319
Signature · 3 lines
Cheers,

David
#9 lore raw

Re: [PATCH] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

Quoted 2 lines · David Hildenbrand

[1/1] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

     https://git.kernel.org/mm/core/c/31ea5515

Thanks! It looks like this one landed on both thp-7.5.misc and core-7.5.misc:

31ea5515bf59 ("selftests/mm: add CONFIG_DEBUG_FS to the config fragment") 194b63198811 ("selftests/mm: add CONFIG_DEBUG_FS to the config fragment")

Was the thp-7.5.misc one meant to be the split_huge_page_test skip patch?

https://lore.kernel.org/all/[email protected]/

--
Thanks,
Sasha

#10 lore raw

Re: [PATCH] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

Quoted 7 lines · Sasha Levin
Quoted 2 lines · David Hildenbrand

[1/1] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

     https://git.kernel.org/mm/core/c/31ea5515

Thanks! It looks like this one landed on both thp-7.5.misc and core-7.5.misc:

Quoted 6 lines

31ea5515bf59 ("selftests/mm: add CONFIG_DEBUG_FS to the config fragment") 194b63198811 ("selftests/mm: add CONFIG_DEBUG_FS to the config fragment")

Was the thp-7.5.misc one meant to be the split_huge_page_test skip patch?

https://lore.kernel.org/all/[email protected]/

Fixes.

b4 shazam gets confused when patches are sent in reply to patches.

Which is why we shouldn't do it ;)

Signature · 3 lines
Cheers,

David
#11 lore raw

Re: [PATCH] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

Quoted 13 lines · David Hildenbrand (Arm)
Quoted 12 lines · Sasha Levin
Quoted 2 lines · David Hildenbrand

[1/1] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

     https://git.kernel.org/mm/core/c/31ea5515

Thanks! It looks like this one landed on both thp-7.5.misc and core-7.5.misc:

31ea5515bf59 ("selftests/mm: add CONFIG_DEBUG_FS to the config fragment") 194b63198811 ("selftests/mm: add CONFIG_DEBUG_FS to the config fragment")

Was the thp-7.5.misc one meant to be the split_huge_page_test skip patch?

Quoted 7 lines
Quoted 1 line

https://lore.kernel.org/all/[email protected]/

Fixes.

b4 shazam gets confused when patches are sent in reply to patches.

Which is why we shouldn't do it ;)

Remember my gripe about how subsystems are starting to have more and more custom rules around process? :p

Our docs currently say (Documentation/process/submitting-patches.rst):

Explicit In-Reply-To headers
----------------------------

It can be helpful to manually add In-Reply-To: headers to a patch (e.g., when using ``git send-email``) to associate the patch with previous relevant discussion, e.g. to link a bug fix to the email with the bug report.

I suppose it's okay for parts of the kernel to deviate from the "standard", but it's a bit hard to keep track of these preferences.

Signature · 2 lines
Thanks,
Sasha
#12 lore raw

Re: [PATCH] selftests/mm: add CONFIG_DEBUG_FS to the config fragment

Quoted 13 lines · Sasha Levin
Quoted 12 lines · David Hildenbrand (Arm)
Quoted 10 lines · Sasha Levin

Thanks! It looks like this one landed on both thp-7.5.misc and core-7.5.misc:

31ea5515bf59 ("selftests/mm: add CONFIG_DEBUG_FS to the config fragment") 194b63198811 ("selftests/mm: add CONFIG_DEBUG_FS to the config fragment")

Was the thp-7.5.misc one meant to be the split_huge_page_test skip patch?

https://lore.kernel.org/all/[email protected]/

Quoted 8 lines
Quoted 5 lines

Fixes.

b4 shazam gets confused when patches are sent in reply to patches.

Which is why we shouldn't do it ;)

Remember my gripe about how subsystems are starting to have more and more custom rules around process? :p

Let's not twist my words. I said "we shouldn't do it", there are no rules around it and also I don't want any rules around that.

And the example below (bug vs. bug report) makes perfect sense.

Quoted 6 lines

Our docs currently say (Documentation/process/submitting-patches.rst):

Explicit In-Reply-To headers
----------------------------

Quoted 7 lines

It can be helpful to manually add In-Reply-To: headers to a patch (e.g., when using ``git send-email``) to associate the patch with previous relevant discussion, e.g. to link a bug fix to the email with the bug report.

I suppose it's okay for parts of the kernel to deviate from the "standard", but it's a bit hard to keep track of these preferences.

Just to be clear, patch in reply to patch to me is something different than patch in reply to discussion.

People tend to ignore certain patches because it's not relevant for them; burying something related but more generic in there is not always the best idea.

But it all doesn't matter, because there are not any such strict rules and I just have to learn to properly use b4 :P

Signature · 3 lines
Cheers,

David
reviewer Reviewed-by on v1 1/1
#13 lore raw
In reply to Sasha Levin
Quoted 5 lines · Sasha Levin

Every case in split_huge_page_test goes through /sys/kernel/debug/split_huge_pages. When that file does not exist, because debugfs is not mounted or the kernel has no CONFIG_DEBUG_FS, the first write bails out of the whole test and it is reported as a failure:

Quoted 7 lines

Bail out! write_file(/sys/kernel/debug/split_huge_pages): No such file or directory

Skip the test in that case.

Fixes fa6c02315f74 ("mm: huge_memory: a new debugfs interface for splitting THP tests")

---