All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3 cgroup/for-3.19] cgroup: add cgroup_subsys->css_released()
@ 2014-11-17 20:56 ` Tejun Heo
  0 siblings, 0 replies; 10+ messages in thread
From: Tejun Heo @ 2014-11-17 20:56 UTC (permalink / raw)
  To: Li Zefan
  Cc: cgroups-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA

Add a new cgroup subsys callback css_released().  This is called when
the reference count of the css (cgroup_subsys_state) reaches zero
before RCU scheduling free.

Signed-off-by: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Li Zefan <lizefan-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
---
 include/linux/cgroup.h |    1 +
 kernel/cgroup.c        |    2 ++
 2 files changed, 3 insertions(+)

--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -612,6 +612,7 @@ struct cgroup_subsys {
 	struct cgroup_subsys_state *(*css_alloc)(struct cgroup_subsys_state *parent_css);
 	int (*css_online)(struct cgroup_subsys_state *css);
 	void (*css_offline)(struct cgroup_subsys_state *css);
+	void (*css_released)(struct cgroup_subsys_state *css);
 	void (*css_free)(struct cgroup_subsys_state *css);
 	void (*css_reset)(struct cgroup_subsys_state *css);
 
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4380,6 +4380,8 @@ static void css_release_work_fn(struct w
 	if (ss) {
 		/* css release path */
 		cgroup_idr_remove(&ss->css_idr, css->id);
+		if (ss->css_released)
+			ss->css_released(css);
 	} else {
 		/* cgroup release path */
 		cgroup_idr_remove(&cgrp->root->cgroup_idr, cgrp->id);

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-11-18  7:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-17 20:56 [PATCH 1/3 cgroup/for-3.19] cgroup: add cgroup_subsys->css_released() Tejun Heo
2014-11-17 20:56 ` Tejun Heo
     [not found] ` <20141117205652.GA23126-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-11-17 20:57   ` [PATCH 2/3 cgroup/for-3.19] cgroup: add cgroup_subsys->css_e_css_changed() Tejun Heo
2014-11-17 20:57     ` Tejun Heo
     [not found]     ` <20141117205734.GB23126-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-11-17 20:58       ` [PATCH 3/3 cgroup/for-3.19] cgroup: implement cgroup_get_e_css() Tejun Heo
2014-11-17 20:58         ` Tejun Heo
     [not found]         ` <20141117205855.GC23126-Gd/HAXX7CRxy/B6EtB590w@public.gmane.org>
2014-11-18  6:35           ` Zefan Li
2014-11-18  6:35             ` Zefan Li
     [not found]             ` <546AE8A9.1090600-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2014-11-18  7:50               ` Tejun Heo
2014-11-18  7:50                 ` Tejun Heo

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.