Tejun Heo e93160803f cgroup: kill CSS_REMOVED
CSS_REMOVED is one of the several contortions which were necessary to
support css reference draining on cgroup removal.  All css->refcnts
which need draining should be deactivated and verified to equal zero
atomically w.r.t. css_tryget().  If any one isn't zero, all refcnts
needed to be re-activated and css_tryget() shouldn't fail in the
process.

This was achieved by letting css_tryget() busy-loop until either the
refcnt is reactivated (failed removal attempt) or CSS_REMOVED is set
(committing to removal).

Now that css refcnt draining is no longer used, there's no need for
atomic rollback mechanism.  css_tryget() simply can look at the
reference count and fail if it's deactivated - it's never getting
re-activated.

This patch removes CSS_REMOVED and updates __css_tryget() to fail if
the refcnt is deactivated.  As deactivation and removal are a single
step now, they no longer need to be protected against css_tryget()
happening from irq context.  Remove local_irq_disable/enable() from
cgroup_rmdir().

Note that this removes css_is_removed() whose only user is VM_BUG_ON()
in memcontrol.c.  We can replace it with a check on the refcnt but
given that the only use case is a debug assert, I think it's better to
simply unexport it.

v2: Comment updated and explanation on local_irq_disable/enable()
    added per Michal Hocko.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reviewed-by: Michal Hocko <mhocko@suse.cz>
Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Acked-by: Li Zefan <lizefan@huawei.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Balbir Singh <bsingharora@gmail.com>
2012-11-05 09:16:58 -08:00
..
2012-08-02 13:51:46 -04:00
2012-07-30 18:16:01 -07:00
2012-07-30 18:15:23 -07:00
2012-07-26 10:23:47 -07:00
2012-07-30 17:25:21 -07:00
2012-08-07 10:10:57 +02:00
2012-07-31 18:42:43 -07:00
2012-11-05 09:16:58 -08:00
2012-07-30 17:25:11 -07:00
2012-09-17 15:00:38 -07:00
2012-09-17 15:00:38 -07:00
2012-07-26 11:25:33 -07:00
2012-07-30 09:32:39 -07:00
2012-08-04 01:24:44 +04:00
2012-08-06 13:33:21 -07:00
2012-07-31 08:16:42 -05:00
2012-08-22 10:24:41 -04:00
2012-09-17 15:00:37 -07:00
2012-07-29 21:24:13 +04:00
2012-07-30 19:06:52 -04:00
2012-07-30 19:06:52 -04:00
2012-07-31 18:42:43 -07:00
2012-08-30 13:14:48 -04:00
2012-07-30 17:25:20 -07:00
2012-07-31 08:16:24 -06:00
2012-07-31 18:42:50 -07:00
2012-08-04 12:15:37 +04:00