All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 5/7] mem/ksm06: Move ksm restoration into the tst_test struct
Date: Thu,  3 Mar 2022 15:50:30 +0100	[thread overview]
Message-ID: <20220303145032.21493-6-chrubis@suse.cz> (raw)
In-Reply-To: <20220303145032.21493-1-chrubis@suse.cz>

Signed-off-by: Cyril Hrubis <chrubis@suse.cz>
---
 testcases/kernel/mem/ksm/ksm06.c | 28 +++-------------------------
 1 file changed, 3 insertions(+), 25 deletions(-)

diff --git a/testcases/kernel/mem/ksm/ksm06.c b/testcases/kernel/mem/ksm/ksm06.c
index 61507b2aa..f5f7319d7 100644
--- a/testcases/kernel/mem/ksm/ksm06.c
+++ b/testcases/kernel/mem/ksm/ksm06.c
@@ -39,9 +39,6 @@
 #ifdef HAVE_NUMA_V2
 #include <numaif.h>
 
-static int run = -1;
-static int sleep_millisecs = -1;
-static int merge_across_nodes = -1;
 static unsigned long nr_pages = 100;
 
 static char *n_opt;
@@ -141,27 +138,6 @@ static void setup(void)
 
 	if (n_opt)
 		nr_pages = SAFE_STRTOUL(n_opt, 0, ULONG_MAX);
-
-	/* save the current value */
-	SAFE_FILE_SCANF(PATH_KSM "run", "%d", &run);
-	SAFE_FILE_SCANF(PATH_KSM "merge_across_nodes",
-			"%d", &merge_across_nodes);
-	SAFE_FILE_SCANF(PATH_KSM "sleep_millisecs",
-			"%d", &sleep_millisecs);
-}
-
-static void cleanup(void)
-{
-	if (merge_across_nodes != -1) {
-		FILE_PRINTF(PATH_KSM "merge_across_nodes",
-			    "%d", merge_across_nodes);
-	}
-
-	if (sleep_millisecs != -1)
-		FILE_PRINTF(PATH_KSM "sleep_millisecs", "%d", sleep_millisecs);
-
-	if (run != -1)
-		FILE_PRINTF(PATH_KSM "run", "%d", run);
 }
 
 static struct tst_test test = {
@@ -171,9 +147,11 @@ static struct tst_test test = {
 		{}
 	},
 	.setup = setup,
-	.cleanup = cleanup,
 	.save_restore = (const char * const[]) {
 		"?/sys/kernel/mm/ksm/max_page_sharing",
+		"?/sys/kernel/mm/ksm/run",
+		"?/sys/kernel/mm/ksm/merge_across_nodes",
+		"?/sys/kernel/mm/ksm/sleep_millisecs",
 		NULL,
 	},
 	.test_all = test_ksm,
-- 
2.34.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

  parent reply	other threads:[~2022-03-03 14:49 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-03 14:50 [LTP] [PATCH 0/7] ksm06 and libnuma cleanups and fixes Cyril Hrubis
2022-03-03 14:50 ` [LTP] [PATCH 1/7] ksm06: Move option parsing into the setup() Cyril Hrubis
2022-03-07 13:02   ` Richard Palethorpe
2022-03-03 14:50 ` [LTP] [PATCH 2/7] mem/lib: Export group_check() as ksm_group_check() Cyril Hrubis
2022-03-07 13:03   ` Richard Palethorpe
2022-03-03 14:50 ` [LTP] [PATCH 3/7] mem/ksm06: Move test code from library to the test Cyril Hrubis
2022-03-07 13:03   ` Richard Palethorpe
2022-03-03 14:50 ` [LTP] [PATCH 4/7] mem/ksm06: SPDX + docparse comment Cyril Hrubis
2022-03-07 13:04   ` Richard Palethorpe
2022-03-03 14:50 ` Cyril Hrubis [this message]
2022-03-04  2:27   ` [LTP] [PATCH 5/7] mem/ksm06: Move ksm restoration into the tst_test struct Li Wang
2022-03-04 12:02     ` Cyril Hrubis
2022-03-07  1:44       ` Li Wang
2022-03-07  8:58         ` Cyril Hrubis
2022-03-07  9:06           ` Li Wang
2022-03-07  9:13             ` Cyril Hrubis
2022-03-03 14:50 ` [LTP] [PATCH 6/7] libs: libltpnuma: Fix free memory estimate Cyril Hrubis
2022-03-04  2:56   ` Li Wang
2022-03-03 14:50 ` [LTP] [PATCH 7/7] mem/ksm06: Make use of the new libltpnuma Cyril Hrubis
2022-03-04  3:17   ` Li Wang
2022-03-03 15:06 ` [LTP] [PATCH 0/7] ksm06 and libnuma cleanups and fixes Petr Vorel

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=20220303145032.21493-6-chrubis@suse.cz \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /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.