All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: rlove-L7G0xEPcOZbYtjvyW6yDsg@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
	serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org,
	kay-tD+1rO4QERM@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	lennart-mdGvqq1h2p+GdvJs77BJ7Q@public.gmane.org,
	eparis-FjpueFixGhCM4zKIHC2jIg@public.gmane.org,
	cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	john-jueV0HHMeujJJrXXpGQQMAC/G2K4zDHf@public.gmane.org
Subject: Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy
Date: Tue, 15 Apr 2014 08:57:21 +0800	[thread overview]
Message-ID: <534C83F1.9020106@huawei.com> (raw)
In-Reply-To: <1397511846-2904-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>

On 2014/4/15 5:44, Tejun Heo wrote:
> cgroup users often need a way to determine when a cgroup's
> subhierarchy becomes empty so that it can be cleaned up.  cgroup
> currently provides release_agent for it; unfortunately, this mechanism
> is riddled with issues.
> 
> * It delivers events by forking and execing a userland binary
>   specified as the release_agent.  This is a long deprecated method of
>   notification delivery.  It's extremely heavy, slow and cumbersome to
>   integrate with larger infrastructure.
> 
> * There is single monitoring point at the root.  There's no way to
>   delegate management of subtree.
> 
> * The event isn't recursive.  It triggers when a cgroup doesn't have
>   any tasks or child cgroups.  Events for internal nodes trigger only
>   after all children are removed.  This again makes it impossible to
>   delegate management of subtree.
> 
> * Events are filtered from the kernel side.  "notify_on_release" file
>   is used to subscribe to or suppress release event.  This is
>   unnecessarily complicated and probably done this way because event
>   delivery itself was expensive.
> 
> This patch implements interface file "cgroup.subtree_populated" which
> can be used to monitor whether the cgroup's subhierarchy has tasks in
> it or not.  Its value is 0 if there is no task in the cgroup and its
> descendants; otherwise, 1, 

Is cgroup.tree_populated a better name?

cgroup.subtree_control controls child cgroups only, but .subtree_populated
shows 1 if there're tasks in the cgroup or its children, so the two
are a bit inconsistent to me.

> and kernfs_notify() notificaiton is
> triggers when the value changes, which can be monitored through poll
> and [di]notify.
> 
> This is a lot ligther and simpler and trivially allows delegating
> management of subhierarchy - subhierarchy monitoring can block further
> propgation simply by putting itself or another process in the root of
> the subhierarchy and monitor events that it's interested in from there
> without interfering with monitoring higher in the tree.
> 
> v2: Patch description updated as per Serge.
> 
> Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Acked-by: Serge Hallyn <serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org>
> Cc: Lennart Poettering <lennart-mdGvqq1h2p+GdvJs77BJ7Q@public.gmane.org>

WARNING: multiple messages have this Message-ID (diff)
From: Li Zefan <lizefan@huawei.com>
To: Tejun Heo <tj@kernel.org>
Cc: <containers@lists.linux-foundation.org>,
	<cgroups@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<john@johnmccutchan.com>, <rlove@rlove.org>,
	<eparis@parisplace.org>, <gregkh@linuxfoundation.org>,
	<serge.hallyn@ubuntu.com>, <lennart@poettering.net>,
	<kay@vrfy.org>
Subject: Re: [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy
Date: Tue, 15 Apr 2014 08:57:21 +0800	[thread overview]
Message-ID: <534C83F1.9020106@huawei.com> (raw)
In-Reply-To: <1397511846-2904-4-git-send-email-tj@kernel.org>

On 2014/4/15 5:44, Tejun Heo wrote:
> cgroup users often need a way to determine when a cgroup's
> subhierarchy becomes empty so that it can be cleaned up.  cgroup
> currently provides release_agent for it; unfortunately, this mechanism
> is riddled with issues.
> 
> * It delivers events by forking and execing a userland binary
>   specified as the release_agent.  This is a long deprecated method of
>   notification delivery.  It's extremely heavy, slow and cumbersome to
>   integrate with larger infrastructure.
> 
> * There is single monitoring point at the root.  There's no way to
>   delegate management of subtree.
> 
> * The event isn't recursive.  It triggers when a cgroup doesn't have
>   any tasks or child cgroups.  Events for internal nodes trigger only
>   after all children are removed.  This again makes it impossible to
>   delegate management of subtree.
> 
> * Events are filtered from the kernel side.  "notify_on_release" file
>   is used to subscribe to or suppress release event.  This is
>   unnecessarily complicated and probably done this way because event
>   delivery itself was expensive.
> 
> This patch implements interface file "cgroup.subtree_populated" which
> can be used to monitor whether the cgroup's subhierarchy has tasks in
> it or not.  Its value is 0 if there is no task in the cgroup and its
> descendants; otherwise, 1, 

Is cgroup.tree_populated a better name?

cgroup.subtree_control controls child cgroups only, but .subtree_populated
shows 1 if there're tasks in the cgroup or its children, so the two
are a bit inconsistent to me.

> and kernfs_notify() notificaiton is
> triggers when the value changes, which can be monitored through poll
> and [di]notify.
> 
> This is a lot ligther and simpler and trivially allows delegating
> management of subhierarchy - subhierarchy monitoring can block further
> propgation simply by putting itself or another process in the root of
> the subhierarchy and monitor events that it's interested in from there
> without interfering with monitoring higher in the tree.
> 
> v2: Patch description updated as per Serge.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Acked-by: Serge Hallyn <serge.hallyn@ubuntu.com>
> Cc: Lennart Poettering <lennart@poettering.net>


  parent reply	other threads:[~2014-04-15  0:57 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-14 21:44 [PATCHSET cgroup/for-3.16] cgroup: implement cgroup.populated, v2 Tejun Heo
2014-04-14 21:44 ` Tejun Heo
     [not found] ` <1397511846-2904-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-04-14 21:44   ` [PATCH 1/3] kernfs: implement kernfs_root->supers list Tejun Heo
2014-04-14 21:44     ` Tejun Heo
2014-04-14 21:44   ` [PATCH 2/3] kernfs: make kernfs_notify() trigger inotify events too Tejun Heo
2014-04-14 21:44     ` Tejun Heo
2014-04-14 21:44   ` [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy Tejun Heo
2014-04-14 21:44     ` Tejun Heo
     [not found]     ` <1397511846-2904-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-04-15  0:57       ` Li Zefan [this message]
2014-04-15  0:57         ` Li Zefan
     [not found]         ` <534C83F1.9020106-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-04-15 14:54           ` Tejun Heo
2014-04-15 14:54           ` Tejun Heo
2014-04-15 14:54             ` Tejun Heo
     [not found]             ` <20140415145450.GL1863-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-04-15 16:52               ` Tejun Heo
2014-04-15 16:52                 ` Tejun Heo
     [not found]                 ` <20140415165221.GD30990-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-04-16  1:30                   ` Li Zefan
2014-04-16  1:30                   ` Li Zefan
2014-04-16  1:30                     ` Li Zefan
2014-04-16  2:48       ` Li Zefan
2014-04-16  2:48         ` Li Zefan
     [not found]         ` <534DEF62.4090900-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-04-16  3:33           ` Kay Sievers
2014-04-16  3:33             ` Kay Sievers
     [not found]             ` <CAPXgP12kvPdX0QExwN2JphDfEW=d+7K2c_Y8DbomGd=YVy=VGQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-04-16  3:50               ` Eric W. Biederman
2014-04-16  3:50               ` Eric W. Biederman
2014-04-16  3:50                 ` Eric W. Biederman
     [not found]                 ` <87tx9uhr0j.fsf-JOvCrm2gF+uungPnsOpG7nhyD016LWXt@public.gmane.org>
2014-04-16  4:15                   ` Kay Sievers
2014-04-16  4:15                     ` Kay Sievers
2014-04-16  4:20                   ` Li Zefan
2014-04-16  4:20                     ` Li Zefan
2014-04-16  4:16               ` Li Zefan
2014-04-16  4:16                 ` Li Zefan
2014-04-16 14:50       ` [PATCH v3 3/3] cgroup: implement cgroup.populated " Tejun Heo
2014-04-16 14:50         ` Tejun Heo
     [not found]         ` <20140416145047.GC1257-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-04-17  1:23           ` Li Zefan
2014-04-17  1:23             ` Li Zefan
2014-04-16 14:50       ` Tejun Heo
  -- strict thread matches above, loose matches on Subject: below --
2014-04-09 15:07 [PATCHSET cgroup/for-3.16] cgroup: implement cgroup.populated Tejun Heo
     [not found] ` <1397056052-2829-1-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-04-09 15:07   ` [PATCH 3/3] cgroup: implement cgroup.subtree_populated for the default hierarchy Tejun Heo
2014-04-09 15:07     ` Tejun Heo
     [not found]     ` <1397056052-2829-4-git-send-email-tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2014-04-10  3:08       ` Serge E. Hallyn
2014-04-10  3:08     ` Serge E. Hallyn
     [not found]       ` <20140410030855.GA29658-7LNsyQBKDXoIagZqoN9o3w@public.gmane.org>
2014-04-10 13:08         ` Tejun Heo
2014-04-10 13:08           ` Tejun Heo
     [not found]           ` <20140410130831.GA25308-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-04-10 14:04             ` Serge Hallyn
2014-04-10 14:04               ` Serge Hallyn
2014-04-10 14:19               ` Tejun Heo
2014-04-10 14:19                 ` Tejun Heo
     [not found]                 ` <20140410141957.GE25308-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-04-11  9:00                   ` Li Zefan
2014-04-11  9:00                     ` Li Zefan

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=534C83F1.9020106@huawei.com \
    --to=lizefan-hv44wf8li93qt0dzr+alfa@public.gmane.org \
    --cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=eparis-FjpueFixGhCM4zKIHC2jIg@public.gmane.org \
    --cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
    --cc=john-jueV0HHMeujJJrXXpGQQMAC/G2K4zDHf@public.gmane.org \
    --cc=kay-tD+1rO4QERM@public.gmane.org \
    --cc=lennart-mdGvqq1h2p+GdvJs77BJ7Q@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=rlove-L7G0xEPcOZbYtjvyW6yDsg@public.gmane.org \
    --cc=serge.hallyn-GeWIH/nMZzLQT0dZR+AlfA@public.gmane.org \
    --cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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.