linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] memcg: cgroup fix rmdir hang
@ 2009-06-23  7:07 KAMEZAWA Hiroyuki
  2009-06-23  7:08 ` [PATCH 1/2] " KAMEZAWA Hiroyuki
                   ` (3 more replies)
  0 siblings, 4 replies; 14+ messages in thread
From: KAMEZAWA Hiroyuki @ 2009-06-23  7:07 UTC (permalink / raw)
  To: linux-mm; +Cc: linux-kernel, nishimura, balbir, lizf, menage, akpm

previous discussion was this => http://marc.info/?t=124478543600001&r=1&w=2

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

Now, cgroup's rmdir path does following

==
again:
	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.

	css_get(&memcg->css)
	....
	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.

Thanks,
-Kame

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2009-06-29  4:12 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-23  7:07 [PATCH 0/2] memcg: cgroup fix rmdir hang KAMEZAWA Hiroyuki
2009-06-23  7:08 ` [PATCH 1/2] " KAMEZAWA Hiroyuki
2009-06-24  4:05   ` Daisuke Nishimura
2009-06-25 21:50   ` Andrew Morton
2009-06-26  0:14     ` KAMEZAWA Hiroyuki
2009-06-23  7:10 ` [PATCH 2/2] memcg: wakeup rmdir waiter if necessary KAMEZAWA Hiroyuki
2009-06-25 21:28 ` [PATCH 0/2] memcg: cgroup fix rmdir hang Andrew Morton
2009-06-25 23:29   ` KAMEZAWA Hiroyuki
2009-06-26  5:10 ` [PATCH] " KAMEZAWA Hiroyuki
2009-06-26  6:00   ` Daisuke Nishimura
2009-06-29  4:10     ` Daisuke Nishimura
2009-06-26 20:16   ` Paul Menage
2009-06-28 23:50     ` KAMEZAWA Hiroyuki
2009-06-28 23:56       ` KAMEZAWA Hiroyuki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox