From: Richard Palethorpe <rpalethorpe@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5 6/7] mem: Convert tests to new CGroups API
Date: Tue, 04 May 2021 10:03:22 +0100 [thread overview]
Message-ID: <87zgxalvl1.fsf@suse.de> (raw)
In-Reply-To: <YI/clrb4houmTsY7@yuki>
Hello,
Cyril Hrubis <chrubis@suse.cz> writes:
> Hi!
>> diff --git a/testcases/kernel/mem/ksm/ksm02.c b/testcases/kernel/mem/ksm/ksm02.c
>> index 51f5d4cca..e6de61ece 100644
>> --- a/testcases/kernel/mem/ksm/ksm02.c
>> +++ b/testcases/kernel/mem/ksm/ksm02.c
>> @@ -59,6 +59,9 @@
>> #ifdef HAVE_NUMA_V2
>> #include <numaif.h>
>>
>> +static const struct tst_cgroup_group *cg;
>> +static const struct tst_cgroup_group *cg_drain;
>> +
>> static void verify_ksm(void)
>> {
>> unsigned long nmask[MAXNODES / BITS_PER_LONG] = { 0 };
>> @@ -76,9 +79,10 @@ static void verify_ksm(void)
>> }
>> create_same_memory(size, num, unit);
>>
>> - write_cpusets(PATH_TMP_CG_CST, node);
>> - tst_cgroup_move_current(PATH_TMP_CG_CST);
>> + write_cpusets(cg, node);
>> + SAFE_CGROUP_PRINTF(cg, "cgroup.procs", "%d", getpid());
>> create_same_memory(size, num, unit);
>> + SAFE_CGROUP_PRINTF(cg_drain, "cgroup.procs", "%d", getpid());
>> }
>>
>> static void cleanup(void)
>> @@ -87,7 +91,7 @@ static void cleanup(void)
>> FILE_PRINTF(PATH_KSM "merge_across_nodes",
>> "%d", merge_across_nodes);
>>
>> - tst_cgroup_umount(PATH_TMP_CG_CST);
>> + tst_cgroup_cleanup();
>> }
>>
>> static void setup(void)
>> @@ -103,7 +107,8 @@ static void setup(void)
>> SAFE_FILE_PRINTF(PATH_KSM "merge_across_nodes", "1");
>> }
>>
>> - tst_cgroup_mount(TST_CGROUP_CPUSET, PATH_TMP_CG_CST);
>> + tst_cgroup_require("cpuset", NULL);
>> + cg = tst_cgroup_get_test_group();
>
> Forgotten cg_drain = tst_cgroup_get_drain_group() ?
+1
>
> Other than that the rest is pretty much straightforward, so with the
> above fixed:
>
> Reviewed-by: Cyril Hrubis <chrubis@suse.cz>
--
Thank you,
Richard.
next prev parent reply other threads:[~2021-05-04 9:03 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-30 11:26 [LTP] [PATCH v5 0/7] CGroup API rewrite Richard Palethorpe
2021-04-30 11:26 ` [LTP] [PATCH v5 1/7] API: Add safe openat, printfat, readat and unlinkat Richard Palethorpe
2021-04-30 14:22 ` Cyril Hrubis
2021-05-04 8:31 ` Richard Palethorpe
2021-04-30 11:26 ` [LTP] [PATCH v5 2/7] API: Make tst_count_scanf_conversions public Richard Palethorpe
2021-04-30 14:23 ` Cyril Hrubis
2021-04-30 11:26 ` [LTP] [PATCH v5 3/7] Add new CGroups APIs Richard Palethorpe
2021-04-30 15:48 ` Cyril Hrubis
2021-04-30 11:26 ` [LTP] [PATCH v5 4/7] Add new CGroups API library tests Richard Palethorpe
2021-04-30 15:57 ` Cyril Hrubis
2021-04-30 11:26 ` [LTP] [PATCH v5 5/7] docs: Update CGroups API Richard Palethorpe
2021-04-30 11:26 ` [LTP] [PATCH v5 6/7] mem: Convert tests to new " Richard Palethorpe
2021-05-03 11:20 ` Cyril Hrubis
2021-05-04 9:03 ` Richard Palethorpe [this message]
2021-04-30 11:26 ` [LTP] [PATCH v5 7/7] madvise06: Convert " Richard Palethorpe
2021-05-03 13:28 ` Cyril Hrubis
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=87zgxalvl1.fsf@suse.de \
--to=rpalethorpe@suse.de \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox