Thread (54 messages) 54 messages, 5 authors, 2012-11-02

Re: [PATCH 2/8] cgroup: kill CSS_REMOVED

From: Kamezawa Hiroyuki <hidden>
Date: 2012-11-02 09:30:49
Also in: lkml

(2012/10/31 13:22), Tejun Heo wrote:
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 the 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.

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.

Signed-off-by: Tejun Heo <redacted>
Cc: Johannes Weiner <redacted>
Cc: Michal Hocko <redacted>
Cc: Balbir Singh <redacted>
Cc: KAMEZAWA Hiroyuki <redacted>
Reviewed-by: KAMEZAWA Hiroyuki <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help