linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Cao Ruichuang <create0818@163.com>
To: rppt@kernel.org
Cc: akpm@linux-foundation.org, david@kernel.org, shuah@kernel.org,
	linux-mm@kvack.org, linux-kselftest@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2] selftests: mm: skip charge_reserved_hugetlb without killall
Date: Fri, 10 Apr 2026 12:41:39 +0800	[thread overview]
Message-ID: <20260410044139.67480-1-create0818@163.com> (raw)
In-Reply-To: <20260406053126.217196-1-create0818@163.com>

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.

Signed-off-by: Cao Ruichuang <create0818@163.com>
---
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(+)

diff --git a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
index 44776965763..44f4e703deb 100755
--- a/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
+++ b/tools/testing/selftests/mm/charge_reserved_hugetlb.sh
@@ -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
-- 
2.39.5 (Apple Git-154)



       reply	other threads:[~2026-04-10  4:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20260406053126.217196-1-create0818@163.com>
2026-04-10  4:41 ` Cao Ruichuang [this message]
2026-04-10  5:30   ` Mike Rapoport

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260410044139.67480-1-create0818@163.com \
    --to=create0818@163.com \
    --cc=akpm@linux-foundation.org \
    --cc=david@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=rppt@kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox