public inbox for linux-mm@kvack.org
 help / color / mirror / Atom feed
* [PATCH v2] selftests: mm: skip charge_reserved_hugetlb without killall
       [not found] <20260406053126.217196-1-create0818@163.com>
@ 2026-04-10  4:41 ` Cao Ruichuang
  2026-04-10  5:30   ` Mike Rapoport
  0 siblings, 1 reply; 2+ messages in thread
From: Cao Ruichuang @ 2026-04-10  4:41 UTC (permalink / raw)
  To: rppt; +Cc: akpm, david, shuah, linux-mm, linux-kselftest, linux-kernel

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)



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] selftests: mm: skip charge_reserved_hugetlb without killall
  2026-04-10  4:41 ` [PATCH v2] selftests: mm: skip charge_reserved_hugetlb without killall Cao Ruichuang
@ 2026-04-10  5:30   ` Mike Rapoport
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Rapoport @ 2026-04-10  5:30 UTC (permalink / raw)
  To: Cao Ruichuang; +Cc: akpm, david, shuah, linux-mm, linux-kselftest, linux-kernel

On Fri, Apr 10, 2026 at 12:41:39PM +0800, Cao Ruichuang 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.
> 
> Signed-off-by: Cao Ruichuang <create0818@163.com>

Acked-by: Mike Rapoport (Microsoft) <rppt@kernel.org>

> ---
> 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)
> 

-- 
Sincerely yours,
Mike.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-04-10  5:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260406053126.217196-1-create0818@163.com>
2026-04-10  4:41 ` [PATCH v2] selftests: mm: skip charge_reserved_hugetlb without killall Cao Ruichuang
2026-04-10  5:30   ` Mike Rapoport

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox