All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roman Gushchin <guro@fb.com>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>, Tejun Heo <tj@kernel.org>,
	linux-man <linux-man@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"open list:CONTROL GROUP (CGROUP)" <cgroups@vger.kernel.org>
Subject: Re: cgroups(7): documenting /sys/kernel/cgroup files
Date: Wed, 10 Jan 2018 04:44:14 -0800	[thread overview]
Message-ID: <20180110124407.GA26913@castle.DHCP.thefacebook.com> (raw)
In-Reply-To: <CAKgNAkhk-527Rh6tGYJO-U3UXgwBC1+t5nB+5JEq62nTO2p15A@mail.gmail.com>

Hello Michael,

On Wed, Jan 10, 2018 at 05:23:32AM +0100, Michael Kerrisk (man-pages) wrote:
> Hello Roman,
> 
> On 8 January 2018 at 22:11, Michael Kerrisk (man-pages)
> <mtk.manpages@gmail.com> wrote:
> > Hello Roman,
> >
> > I wrote cgroups(7) text below to document the files added by you in
> > Linux 4.15. Could you let me know if the following text is okay please:
> >
> >    /sys/kernel/cgroup files
> >        /sys/kernel/cgroup/delegate (since Linux 4.15)
> >               This file exports a list of the cgroups v2 files  (one  per
> >               line) that are delegatable (i.e., whose ownership should be
> >               changed to the user ID of the delegatee).  In  the  future,
> >               the  set  of delegatable files may change or grow, and this
> >               file provides a way for the  kernel  to  inform  user-space
> >               applications of which files must be delegated.  As at Linux
> >               4.15, one sees the following when inspecting this file:
> >
> >                   $ cat /sys/kernel/cgroup/delegate
> >                   cgroup.procs
> >                   cgroup.subtree_control
> 
> I have a question about /sys/kernel/cgroup/delegate: why does this
> file not list cgroup.threads, since that is also a file that
> (potentially) should be delegated?

cc Tejun

cgroup.threads is not listed because it's not delegatable (doesn't have
CFTYPE_NS_DELEGATABLE flag set). I don't know if it was intended or just
an accident (I believe the latter).

Thanks!

PS In the latter case the following patch should fix it:

From fdf19edb6e9594e48e89d4510767b9eb6ca2d9dd Mon Sep 17 00:00:00 2001
From: Roman Gushchin <guro@fb.com>
Date: Wed, 10 Jan 2018 04:35:12 -0800
Subject: [PATCH] cgroup: make cgroup.threads delegatable

Make cgroup.threads file delegatable.
The behavior of cgroup.threads should follow the behavior of cgroup.procs.

Signed-off-by: Roman Gushchin <guro@fb.com>
Discovered-by: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
---
 kernel/cgroup/cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 0b1ffe147f24..b74d9ee1425c 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -4449,6 +4449,7 @@ static struct cftype cgroup_base_files[] = {
 	},
 	{
 		.name = "cgroup.threads",
+		.flags = CFTYPE_NS_DELEGATABLE,
 		.release = cgroup_procs_release,
 		.seq_start = cgroup_threads_start,
 		.seq_next = cgroup_procs_next,
-- 
2.14.3

WARNING: multiple messages have this Message-ID (diff)
From: Roman Gushchin <guro@fb.com>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: "Serge E. Hallyn" <serge@hallyn.com>, Tejun Heo <tj@kernel.org>,
	linux-man <linux-man@vger.kernel.org>,
	lkml <linux-kernel@vger.kernel.org>,
	"open list:CONTROL GROUP (CGROUP)" <cgroups@vger.kernel.org>
Subject: Re: cgroups(7): documenting /sys/kernel/cgroup files
Date: Wed, 10 Jan 2018 04:44:14 -0800	[thread overview]
Message-ID: <20180110124407.GA26913@castle.DHCP.thefacebook.com> (raw)
In-Reply-To: <CAKgNAkhk-527Rh6tGYJO-U3UXgwBC1+t5nB+5JEq62nTO2p15A@mail.gmail.com>

Hello Michael,

On Wed, Jan 10, 2018 at 05:23:32AM +0100, Michael Kerrisk (man-pages) wrote:
> Hello Roman,
> 
> On 8 January 2018 at 22:11, Michael Kerrisk (man-pages)
> <mtk.manpages@gmail.com> wrote:
> > Hello Roman,
> >
> > I wrote cgroups(7) text below to document the files added by you in
> > Linux 4.15. Could you let me know if the following text is okay please:
> >
> >    /sys/kernel/cgroup files
> >        /sys/kernel/cgroup/delegate (since Linux 4.15)
> >               This file exports a list of the cgroups v2 files  (one  per
> >               line) that are delegatable (i.e., whose ownership should be
> >               changed to the user ID of the delegatee).  In  the  future,
> >               the  set  of delegatable files may change or grow, and this
> >               file provides a way for the  kernel  to  inform  user-space
> >               applications of which files must be delegated.  As at Linux
> >               4.15, one sees the following when inspecting this file:
> >
> >                   $ cat /sys/kernel/cgroup/delegate
> >                   cgroup.procs
> >                   cgroup.subtree_control
> 
> I have a question about /sys/kernel/cgroup/delegate: why does this
> file not list cgroup.threads, since that is also a file that
> (potentially) should be delegated?

cc Tejun

cgroup.threads is not listed because it's not delegatable (doesn't have
CFTYPE_NS_DELEGATABLE flag set). I don't know if it was intended or just
an accident (I believe the latter).

Thanks!

PS In the latter case the following patch should fix it:

>From fdf19edb6e9594e48e89d4510767b9eb6ca2d9dd Mon Sep 17 00:00:00 2001
From: Roman Gushchin <guro@fb.com>
Date: Wed, 10 Jan 2018 04:35:12 -0800
Subject: [PATCH] cgroup: make cgroup.threads delegatable

Make cgroup.threads file delegatable.
The behavior of cgroup.threads should follow the behavior of cgroup.procs.

Signed-off-by: Roman Gushchin <guro@fb.com>
Discovered-by: Michael Kerrisk <mtk.manpages@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
---
 kernel/cgroup/cgroup.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c
index 0b1ffe147f24..b74d9ee1425c 100644
--- a/kernel/cgroup/cgroup.c
+++ b/kernel/cgroup/cgroup.c
@@ -4449,6 +4449,7 @@ static struct cftype cgroup_base_files[] = {
 	},
 	{
 		.name = "cgroup.threads",
+		.flags = CFTYPE_NS_DELEGATABLE,
 		.release = cgroup_procs_release,
 		.seq_start = cgroup_threads_start,
 		.seq_next = cgroup_procs_next,
-- 
2.14.3

  reply	other threads:[~2018-01-10 12:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-08 21:11 cgroups(7): documenting /sys/kernel/cgroup files Michael Kerrisk (man-pages)
2018-01-08 21:11 ` Michael Kerrisk (man-pages)
2018-01-09 11:28 ` Roman Gushchin
2018-01-09 11:28   ` Roman Gushchin
     [not found]   ` <20180109112811.GA31373-B3w7+ongkCiLfgCeKHXN1g2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2018-01-09 18:52     ` Michael Kerrisk (man-pages)
2018-01-09 18:52       ` Michael Kerrisk (man-pages)
     [not found] ` <ff431fd8-f1c1-ed8d-2d69-64ea83a8a505-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2018-01-10  4:23   ` Michael Kerrisk (man-pages)
2018-01-10  4:23     ` Michael Kerrisk (man-pages)
2018-01-10 12:44     ` Roman Gushchin [this message]
2018-01-10 12:44       ` Roman Gushchin
     [not found]       ` <20180110124407.GA26913-B3w7+ongkCiLfgCeKHXN1g2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2018-01-10 14:02         ` Tejun Heo
2018-01-10 14:02           ` Tejun Heo
2018-01-10 14:32           ` Roman Gushchin
2018-01-10 17:31           ` Michael Kerrisk (man-pages)
     [not found]             ` <CAKgNAkhDY09gauX-1Ut4SoL9DEoxj9wJ8SjS6h-Ntc90xeWi1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-10 17:33               ` Tejun Heo
2018-01-10 17:33                 ` Tejun Heo
     [not found]                 ` <20180110173340.GG3668920-4dN5La/x3IkLX0oZNxdnEQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2018-01-10 17:39                   ` Tejun Heo
2018-01-10 17:39                     ` Tejun Heo
     [not found]           ` <20180110140239.GX3668920-4dN5La/x3IkLX0oZNxdnEQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2018-01-10 17:44             ` Tejun Heo
2018-01-10 17:44               ` Tejun Heo
     [not found]               ` <20180110174457.GI3668920-4dN5La/x3IkLX0oZNxdnEQ2O0Ztt9esIQQ4Iyu8u01E@public.gmane.org>
2018-01-10 19:14                 ` Michael Kerrisk (man-pages)
2018-01-10 19:14                   ` Michael Kerrisk (man-pages)
2018-01-10 17:45       ` Tejun Heo

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=20180110124407.GA26913@castle.DHCP.thefacebook.com \
    --to=guro@fb.com \
    --cc=cgroups@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=serge@hallyn.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 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.