From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Christian Brauner <christian@brauner.io>
Cc: mtk.manpages@gmail.com, cgroups@vger.kernel.org,
christian.brauner@ubuntu.com, linux-api@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-man@vger.kernel.org,
oleg@redhat.com, tj@kernel.org
Subject: Re: [PATCH] clone.2: Document CLONE_INTO_CGROUP
Date: Fri, 10 Apr 2020 22:18:05 +0200 [thread overview]
Message-ID: <b7550fcd-ba12-e64a-3228-e6668b31a8a7@gmail.com> (raw)
In-Reply-To: <20200410104132.294639-1-christian@brauner.io>
Hi Christian,
Thank you for writing this!
On 4/10/20 12:41 PM, Christian Brauner wrote:
> From: Christian Brauner <christian.brauner@ubuntu.com>
>
> Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
> ---
> man2/clone.2 | 20 ++++++++++++++++++++
> 1 file changed, 20 insertions(+)
>
> diff --git a/man2/clone.2 b/man2/clone.2
> index 39cec4c86..8d9aa9f99 100644
> --- a/man2/clone.2
> +++ b/man2/clone.2
> @@ -197,6 +197,7 @@ struct clone_args {
> u64 tls; /* Location of new TLS */
> u64 set_tid; /* Pointer to a \fIpid_t\fP array */
> u64 set_tid_size; /* Number of elements in \fIset_tid\fP */
> + u64 cgroup; /* Target cgroup file descriptor for the child process */
> };
> .EE
> .in
> @@ -448,6 +449,25 @@ Specifying this flag together with
> .B CLONE_SIGHAND
> is nonsensical and disallowed.
> .TP
> +.BR CLONE_INTO_CGROUP " (since Linux 5.7)"
> +.\" commit ef2c41cf38a7559bbf91af42d5b6a4429db8fc68
> +By default, the child process will belong to the same cgroup as its parent.
s/belong to/be placed in/
s/cgroup/version 2 cgroup/
> +If this flag is specified the child process will be created in a
> +different cgroup than its parent.
> +
> +When using
> +.RB clone3 ()
> +the target cgroup can be specified by setting the
> +.I cl_args.cgroup
> +member to the file descriptor of the target cgroup. The cgroup file
We need to say something about how this file descriptor is
obtained. Is it by opening a directory in the v2 cgroup hierarchy?
With what flags? O_RDONLY? or is O_PATH also possible? Yes, these
are some rhetorical questions (I read your nice commit message);
these things need to be explicit in the manual page though.
Also, your commit message mentions a nice list of use cases.
I think it would be well worth capturing those in a paragraph
in the manual page text.
> +descriptor must refer to a cgroup in a cgroup v2 hierarchy
> +(see
> +.BR cgroup (2)).
s/cgroup/cgroups/
s/2/7/
> +
> +Note that all usual cgroup v2 process migration restrictions apply. See
> +.BR cgroup (2)
s/cgroup/cgroups/
s/2/7/
Thanks,
Michael
--
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
next prev parent reply other threads:[~2020-04-10 20:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-08 11:12 CLONE_INTO_CGROUP documentation? Michael Kerrisk (man-pages)
2020-04-10 10:41 ` [PATCH] clone.2: Document CLONE_INTO_CGROUP Christian Brauner
2020-04-10 20:18 ` Michael Kerrisk (man-pages) [this message]
2020-04-21 14:30 ` Michael Kerrisk (man-pages)
2020-04-23 10:14 ` Christian Brauner
2020-05-15 11:41 ` Michael Kerrisk (man-pages)
2020-05-15 11:59 ` Christian Brauner
2020-05-18 17:55 ` [PATCH v2] " Christian Brauner
2020-05-19 13:36 ` Michael Kerrisk (man-pages)
2020-05-19 13:51 ` Christian Brauner
2020-05-19 19:44 ` Michael Kerrisk (man-pages)
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=b7550fcd-ba12-e64a-3228-e6668b31a8a7@gmail.com \
--to=mtk.manpages@gmail.com \
--cc=cgroups@vger.kernel.org \
--cc=christian.brauner@ubuntu.com \
--cc=christian@brauner.io \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=oleg@redhat.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).