[lkml]   [2009]   [Jun]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subject[PATCH 0/2] memcg: cgroup fix rmdir hang
previous discussion was this =>

This patch tries to fix problem as
- rmdir can sleep very very long if swap entry is shared between multiple

Now, cgroup's rmdir path does following

check there are no tasks and children group.
call pre_destroy()
check css's refcnt
if (refcnt > 0) {
sleep until css's refcnt goes down to 0.
goto again

Unfortunately, memory cgroup does following at charge.

charge(memcg) (increase USAGE)
And this "memcg" is not necessary to include the caller, task.

pre_destroy() tries to reduce memory usage until USAGE goes down to 0.
Then, there is a race that
- css's refcnt > 0 (and memcg's usage > 0)
- rmdir() caller sleeps until css->refcnt goes down 0.
- But to make css->refcnt be 0, pre_destroy() should be called again.

This patch tries to fix this in asyhcnrounos way (i.e. without big lock.)
Any comments are welcome.


 \ /
  Last update: 2009-06-23 09:11    [W:0.094 / U:6.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site