From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx173.postini.com [74.125.245.173]) by kanga.kvack.org (Postfix) with SMTP id 77FEF6B00C2 for ; Wed, 3 Apr 2013 05:12:35 -0400 (EDT) Message-ID: <515BF233.6070308@huawei.com> Date: Wed, 3 Apr 2013 17:11:15 +0800 From: Li Zefan MIME-Version: 1.0 Subject: [RFC][PATCH 0/7] memcg: make memcg's life cycle the same as cgroup Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: linux-mm@kvack.org Cc: LKML , Cgroups , Tejun Heo , Glauber Costa , Michal Hocko , KAMEZAWA Hiroyuki , Johannes Weiner (I'll be off from my office soon, and I won't be responsive in the following 3 days.) I'm working on converting memcg to use cgroup->id, and then we can kill css_id. Now memcg has its own refcnt, so when a cgroup is destroyed, the memcg can still be alive. This patchset converts memcg to always use css_get/put, so memcg will have the same life cycle as its corresponding cgroup, and then it's always safe for memcg to use cgroup->id. The historical reason that memcg didn't use css_get in some cases, is that cgroup couldn't be removed if there're still css refs. The situation has changed so that rmdir a cgroup will succeed regardless css refs, but won't be freed until css refs goes down to 0. This is an early post, and it's NOT TESTED. I just want to see if the changes are fine in general. btw, after this patchset I think we don't need to free memcg via RCU, because cgroup is already freed in RCU callback. Note this patchset is based on a few memcg fixes I sent (but hasn't been accepted) -- kernel/cgroup.c | 10 ++++++++ mm/memcontrol.c | 129 ++++++++++++++++++++++++++++++++++++++------------------------------------------------------- 2 files changed, 62 insertions(+), 77 deletions(-) -- 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: email@kvack.org