All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: SeongJae Park <sj@kernel.org>, Shuah Khan <shuah@kernel.org>,
	damon@lists.linux.dev, linux-mm@kvack.org,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 6/9] selftests/damon: test quota goals directory
Date: Thu, 30 Nov 2023 02:36:49 +0000	[thread overview]
Message-ID: <20231130023652.50284-7-sj@kernel.org> (raw)
In-Reply-To: <20231130023652.50284-1-sj@kernel.org>

Add DAMON selftests for testing creation/existence of quota goals
directories and files, and simple valid input writes.

Signed-off-by: SeongJae Park <sj@kernel.org>
---
 tools/testing/selftests/damon/sysfs.sh | 27 ++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/tools/testing/selftests/damon/sysfs.sh b/tools/testing/selftests/damon/sysfs.sh
index 56f0230a8b92..e9a976d296e2 100755
--- a/tools/testing/selftests/damon/sysfs.sh
+++ b/tools/testing/selftests/damon/sysfs.sh
@@ -150,6 +150,32 @@ test_weights()
 	ensure_file "$weights_dir/age_permil" "exist" "600"
 }
 
+test_goal()
+{
+	goal_dir=$1
+	ensure_dir "$goal_dir" "exist"
+	ensure_file "$goal_dir/target_value" "exist" "600"
+	ensure_file "$goal_dir/current_value" "exist" "600"
+}
+
+test_goals()
+{
+	goals_dir=$1
+	ensure_dir "$goals_dir" "exist"
+	ensure_file "$goals_dir/nr_goals" "exist" "600"
+
+	ensure_write_succ  "$goals_dir/nr_goals" "1" "valid input"
+	test_goal "$goals_dir/0"
+
+	ensure_write_succ  "$goals_dir/nr_goals" "2" "valid input"
+	test_goal "$goals_dir/0"
+	test_goal "$goals_dir/1"
+
+	ensure_write_succ  "$goals_dir/nr_goals" "0" "valid input"
+	ensure_dir "$goals_dir/0" "not_exist"
+	ensure_dir "$goals_dir/1" "not_exist"
+}
+
 test_quotas()
 {
 	quotas_dir=$1
@@ -158,6 +184,7 @@ test_quotas()
 	ensure_file "$quotas_dir/bytes" "exist" 600
 	ensure_file "$quotas_dir/reset_interval_ms" "exist" 600
 	test_weights "$quotas_dir/weights"
+	test_goals "$quotas_dir/goals"
 }
 
 test_access_pattern()
-- 
2.34.1


  parent reply	other threads:[~2023-11-30  2:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-30  2:36 [PATCH 0/9] mm/damon: let users feed and tame/auto-tune DAMOS SeongJae Park
2023-11-30  2:36 ` [PATCH 1/9] mm/damon/core: implement goal-oriented feedback-driven quota auto-tuning SeongJae Park
2023-11-30  2:36 ` [PATCH 2/9] mm/damon/sysfs-schemes: implement files for scheme quota goals setup SeongJae Park
2023-11-30  2:36 ` [PATCH 3/9] mm/damon/sysfs-schemes: commit damos quota goals user input to DAMOS SeongJae Park
2023-11-30  2:36 ` [PATCH 4/9] mm/damon/sysfs-schemes: implement a command for scheme quota goals only commit SeongJae Park
2023-11-30  2:36 ` [PATCH 5/9] mm/damon/core-test: add a unit test for the feedback loop algorithm SeongJae Park
2023-11-30  2:36 ` SeongJae Park [this message]
2023-11-30  2:36 ` [PATCH 7/9] Docs/mm/damon/design: document DAMOS quota auto tuning SeongJae Park
2023-11-30  2:36 ` [PATCH 8/9] Docs/ABI/damon: document DAMOS quota goals SeongJae Park
2023-11-30  2:36 ` [PATCH 9/9] Docs/admin-guide/mm/damon/usage: document for " SeongJae Park
2023-11-30 22:22 ` [PATCH 0/9] mm/damon: let users feed and tame/auto-tune DAMOS Andrew Morton

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=20231130023652.50284-7-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.