Skip to contentSkip to conversation

selftests: mm: skip charge_reserved_hugetlb without killall

PATCH Applied Cao Ruichuang 4 participants 4 messages Apr 10 – Apr 13 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 1/1 selftests: mm: skip charge_reserved_hugetlb without killall

charge_reserved_hugetlb.sh tears down background writers with killall from psmisc. Minimal Ubuntu images do not always provide that tool, so the selftest fails in cleanup for an environment reason rather than for the hugetlb behavior it is trying to cover.

Skip the test when killall is unavailable, similar to the existing root check, so these environments report the dependency clearly instead of failing the test.

---
v2:
- replace the PID tracking approach with a simple skip when killall is unavailable
- follow Mike Rapoport's review suggestion

 tools/testing/selftests/mm/charge_reserved_hugetlb.sh | 5 +++++
 1 file changed, 5 insertions(+)
tools/testing/selftests/mm/charge_reserved_hugetlb.sh +5 -0
index 44776965763..44f4e703deb 100755
@@ -11,6 +11,11 @@ if [[ $(id -u) -ne 0 ]]; then
   exit $ksft_skip
 fi
 
+if ! command -v killall >/dev/null 2>&1; then
+  echo "killall not available. Skipping..."
+  exit $ksft_skip
+fi
+
 nr_hugepgs=$(cat /proc/sys/vm/nr_hugepages)
 
 fault_limit_file=limit_in_bytes
Signature · 1 line
2.39.5 (Apple Git-154)
reviewer Acked-by on v2 1/1
#2 lore raw
Quoted 10 lines · Cao Ruichuang

charge_reserved_hugetlb.sh tears down background writers with killall from psmisc. Minimal Ubuntu images do not always provide that tool, so the selftest fails in cleanup for an environment reason rather than for the hugetlb behavior it is trying to cover.

Skip the test when killall is unavailable, similar to the existing root check, so these environments report the dependency clearly instead of failing the test.

Quoted 28 lines

---
v2:
- replace the PID tracking approach with a simple skip when killall is unavailable
- follow Mike Rapoport's review suggestion

 tools/testing/selftests/mm/charge_reserved_hugetlb.sh | 5 +++++
 1 file changed, 5 insertions(+)
tools/testing/selftests/mm/charge_reserved_hugetlb.sh +5 -0
index 44776965763..44f4e703deb 100755
@@ -11,6 +11,11 @@ if [[ $(id -u) -ne 0 ]]; then
   exit $ksft_skip
 fi
 
+if ! command -v killall >/dev/null 2>&1; then
+  echo "killall not available. Skipping..."
+  exit $ksft_skip
+fi
+
 nr_hugepgs=$(cat /proc/sys/vm/nr_hugepages)
 
 fault_limit_file=limit_in_bytes
Signature · 1 line
2.39.5 (Apple Git-154)
Signature · 2 lines
Sincerely yours,
Mike.
Reviewed-by on v2 1/1
#3 lore raw
In reply to Cao Ruichuang
Quoted 10 lines · On Fri, 10 Apr 2026 12:41:39 +0800 Cao Ruichuang <[email protected]> wrote:

charge_reserved_hugetlb.sh tears down background writers with killall from psmisc. Minimal Ubuntu images do not always provide that tool, so the selftest fails in cleanup for an environment reason rather than for the hugetlb behavior it is trying to cover.

Skip the test when killall is unavailable, similar to the existing root check, so these environments report the dependency clearly instead of failing the test.

Quoted 5 lines

---
v2:
- replace the PID tracking approach with a simple skip when killall is unavailable
- follow Mike Rapoport's review suggestion

I was actually thinking if PID tracking approach is better reading this chagelog. But simple skipping also makes sense to me.

Btw, adding a link to the previous version [1] would be nice.

[1] https://docs.kernel.org/process/submitting-patches.html#commentary

Thanks,
SJ

[...]

maintainer Reviewed-by on v2 1/1
#4 lore raw
In reply to Cao Ruichuang
Quoted 11 lines · Cao Ruichuang

charge_reserved_hugetlb.sh tears down background writers with killall from psmisc. Minimal Ubuntu images do not always provide that tool, so the selftest fails in cleanup for an environment reason rather than for the hugetlb behavior it is trying to cover.

Skip the test when killall is unavailable, similar to the existing root check, so these environments report the dependency clearly instead of failing the test.

---

Signature · 3 lines
Cheers,

David