From: Shakeel Butt <shakeelb@google.com>
To: Christian Brauner <brauner@kernel.org>
Cc: Tejun Heo <tj@kernel.org>, Roman Gushchin <guro@fb.com>,
Zefan Li <lizefan.x@bytedance.com>,
Johannes Weiner <hannes@cmpxchg.org>,
Cgroups <cgroups@vger.kernel.org>,
containers@lists.linux.dev,
Christian Brauner <christian.brauner@ubuntu.com>
Subject: Re: [PATCH v2 3/5] tests/cgroup: use cgroup.kill in cg_killall()
Date: Wed, 5 May 2021 09:42:08 -0700 [thread overview]
Message-ID: <CALvZod6nTDc4Jx4UG3HKaugA1F_2N-rG+xqACAKVkKJjqxWOXg@mail.gmail.com> (raw)
In-Reply-To: <20210503143922.3093755-3-brauner@kernel.org>
On Mon, May 3, 2021 at 7:40 AM Christian Brauner <brauner@kernel.org> wrote:
>
> From: Christian Brauner <christian.brauner@ubuntu.com>
>
> If cgroup.kill file is supported make use of it.
>
> Cc: Tejun Heo <tj@kernel.org>
> Cc: cgroups@vger.kernel.org
> Acked-by: Roman Gushchin <guro@fb.com>
> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
> ---
> /* v2 */
> - Roman Gushchin <guro@fb.com>:
> - Fix whitespace.
> ---
> tools/testing/selftests/cgroup/cgroup_util.c | 4 ++++
> 1 file changed, 4 insertions(+)
>
> diff --git a/tools/testing/selftests/cgroup/cgroup_util.c b/tools/testing/selftests/cgroup/cgroup_util.c
> index 027014662fb2..f60f7d764690 100644
> --- a/tools/testing/selftests/cgroup/cgroup_util.c
> +++ b/tools/testing/selftests/cgroup/cgroup_util.c
> @@ -252,6 +252,10 @@ int cg_killall(const char *cgroup)
> char buf[PAGE_SIZE];
> char *ptr = buf;
>
> + /* If cgroup.kill exists use it. */
> + if (!cg_write(cgroup, "cgroup.kill", "1"))
> + return 0;
Now cg_killall will kill all the processes in the tree rooted at
cgroup which I think is fine.
> +
> if (cg_read(cgroup, "cgroup.procs", buf, sizeof(buf)))
> return -1;
>
> --
> 2.27.0
>
next prev parent reply other threads:[~2021-05-05 16:42 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 14:39 [PATCH v2 1/5] cgroup: introduce cgroup.kill Christian Brauner
2021-05-03 14:39 ` [PATCH v2 2/5] docs/cgroup: add entry for cgroup.kill Christian Brauner
2021-05-05 16:29 ` Shakeel Butt
2021-05-03 14:39 ` [PATCH v2 3/5] tests/cgroup: use cgroup.kill in cg_killall() Christian Brauner
2021-05-05 16:42 ` Shakeel Butt [this message]
2021-05-03 14:39 ` [PATCH v2 4/5] tests/cgroup: move cg_wait_for(), cg_prepare_for_wait() Christian Brauner
2021-05-05 16:43 ` Shakeel Butt
2021-05-03 14:39 ` [PATCH v2 5/5] tests/cgroup: test cgroup.kill Christian Brauner
2021-05-05 18:34 ` Shakeel Butt
2021-05-05 18:52 ` Christian Brauner
2021-05-03 17:18 ` [PATCH v2 1/5] cgroup: introduce cgroup.kill Shakeel Butt
2021-05-04 1:47 ` Serge E. Hallyn
2021-05-04 18:29 ` Shakeel Butt
2021-05-05 17:57 ` Roman Gushchin
2021-05-05 18:46 ` Christian Brauner
2021-05-05 19:13 ` Roman Gushchin
2021-05-05 18:31 ` Eric W. Biederman
2021-05-05 18:49 ` Christian Brauner
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=CALvZod6nTDc4Jx4UG3HKaugA1F_2N-rG+xqACAKVkKJjqxWOXg@mail.gmail.com \
--to=shakeelb@google.com \
--cc=brauner@kernel.org \
--cc=cgroups@vger.kernel.org \
--cc=christian.brauner@ubuntu.com \
--cc=containers@lists.linux.dev \
--cc=guro@fb.com \
--cc=hannes@cmpxchg.org \
--cc=lizefan.x@bytedance.com \
--cc=tj@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;
as well as URLs for NNTP newsgroup(s).