Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: SJ Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Enze Li <lienze@kylinos.cn>, SJ Park <sj@kernel.org>,
	Shuah Khan <shuah@kernel.org>,
	damon@lists.linux.dev, linux-kselftest@vger.kernel.org,
	linux-mm@kvack.org
Subject: [PATCH 1/2] selftests/damon/sysfs_memcg_path_leak: use common check_dependencies()
Date: Thu,  3 Dec 2026 07:32:13 -0800	[thread overview]
Message-ID: <20261203153215.733163-2-sj@kernel.org> (raw)
In-Reply-To: <20261203153215.733163-1-sj@kernel.org>

From: Enze Li <lienze@kylinos.cn>

The sysfs_memcg_path_leak test is the only DAMON selftest shell script
that does not source _common.sh.  Instead it open-codes the root
permission check that check_dependencies() already provides.

Source _common.sh and call check_dependencies() to drop the duplicate.

Signed-off-by: Enze Li <lienze@kylinos.cn>
Reviewed-by: SJ Park <sj@kernel.org>
Signed-off-by: SJ Park <sj@kernel.org>
---
Changes from v1
- v1: https://lore.kernel.org/20261129020003.45921-1-enze.li@linux.dev
- Collect R-b: from SJ.
- Rebase to the lates mm-new.

 tools/testing/selftests/damon/sysfs_memcg_path_leak.sh | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh
index d407dddb879e..23e4940d7843 100755
--- a/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh
+++ b/tools/testing/selftests/damon/sysfs_memcg_path_leak.sh
@@ -1,14 +1,12 @@
 #!/bin/bash
 # SPDX-License-Identifier: GPL-2.0
 
+source _common.sh
+
 # Kselftest framework requirement - SKIP code is 4.
 ksft_skip=4
 
-if [ $EUID -ne 0 ]
-then
-	echo "Run as root"
-	exit $ksft_skip
-fi
+check_dependencies
 
 damon_sysfs="/sys/kernel/mm/damon/admin"
 if [ ! -d "$damon_sysfs" ]
-- 
2.47.3


  reply	other threads:[~2026-12-03 15:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 15:32 [PATCH 0/2] mm/damon: cleanup memcg_path_leak selftest and fix DAMON_RECLAIM age_ms SJ Park
2026-12-03 15:32 ` SJ Park [this message]
2026-12-03 15:32 ` [PATCH 2/2] mm/damon/reclaim: use age_ms filter for min_age SJ Park

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=20261203153215.733163-2-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=lienze@kylinos.cn \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-mm@kvack.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