From: Richard Palethorpe <rpalethorpe@suse.de>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v3 5/7] docs: Update CGroups API
Date: Mon, 26 Apr 2021 17:44:44 +0100 [thread overview]
Message-ID: <87fszdm1vn.fsf@suse.de> (raw)
In-Reply-To: <CAEemH2dkbD_-gRQeKKAh+H6vo8gb+s0dWCa1-mJ_1-eg0eLeAA@mail.gmail.com>
Hello,
Li Wang <liwang@redhat.com> writes:
>> +static void run(void)
>> +{
>> + char buf[BUFSIZ];
>> + size_t mem = 0;
>> +
>> + cg_child = tst_cgroup_mk(cg, "child");
>> + SAFE_CGROUP_PRINTF(cg_child, "cgroup.procs", "%d", getpid());
>> +
>> + if (SAFE_CGROUP_VER(cg, "memory") != TST_CGROUP_V1)
>> + SAFE_CGROUP_PRINT(cg, "cgroup.subtree_control", "+memory");
>> + if (SAFE_CGROUP_VER(cg, "cpuset") != TST_CGROUP_V1)
>> + SAFE_CGROUP_PRINT(cg, "cgroup.subtree_control", "+cpuset");
>>
>
> Kind reminder:
>
> If you decide to add controllers automatically (as I suggested in patch3/7)
> in
> tst_cgroup_mk(), then these lines should be removed.
>
>
>> +Another example of an edge case is the following.
>> +
>> +[source,c]
>>
>> +-------------------------------------------------------------------------------
>> + if (tst_cgroup_ver(cg, "memory") == TST_CGROUP_V1)
>> + SAFE_CGROUP_PRINTF(cg, "memory.swap.max", "%lu", ~0UL);
>> + else
>> + SAFE_CGROUP_PRINT(cg, "memory.swap.max", "max");
>>
>
> typo PRINT --> PRINTF ^.
This function actually exists :-p
>
> Btw, these documented works are quite awesome!
Thanks!
--
Thank you,
Richard.
next prev parent reply other threads:[~2021-04-26 16:44 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-12 14:54 [LTP] [PATCH v3 0/7] CGroup API rewrite Richard Palethorpe
2021-04-12 14:55 ` [LTP] [PATCH v3 1/7] API: Add safe openat, printfat, readat and unlinkat Richard Palethorpe
2021-04-16 6:59 ` Li Wang
2021-04-26 15:07 ` Richard Palethorpe
2021-04-12 14:55 ` [LTP] [PATCH v3 2/7] API: Add macro for the container_of trick Richard Palethorpe
2021-04-16 7:01 ` Li Wang
2021-04-26 15:15 ` Richard Palethorpe
2021-04-27 11:03 ` Cyril Hrubis
2021-04-12 14:55 ` [LTP] [PATCH v3 3/7] Add new CGroups APIs Richard Palethorpe
2021-04-14 15:39 ` Cyril Hrubis
2021-04-15 13:10 ` Richard Palethorpe
2021-04-16 5:00 ` Li Wang
2021-04-26 16:39 ` Richard Palethorpe
2021-04-16 6:57 ` Li Wang
2021-04-26 16:01 ` Richard Palethorpe
2021-04-12 14:55 ` [LTP] [PATCH v3 4/7] Add new CGroups API library tests Richard Palethorpe
2021-04-16 7:22 ` Li Wang
2021-04-12 14:55 ` [LTP] [PATCH v3 5/7] docs: Update CGroups API Richard Palethorpe
2021-04-16 8:11 ` Li Wang
2021-04-26 16:44 ` Richard Palethorpe [this message]
2021-04-12 14:55 ` [LTP] [PATCH v3 6/7] mem: Convert tests to new " Richard Palethorpe
2021-04-12 14:55 ` [LTP] [PATCH v3 7/7] madvise06: Convert " Richard Palethorpe
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=87fszdm1vn.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