Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df878fb04dea044378274d40d063279a9cb787fb
Commit:     df878fb04dea044378274d40d063279a9cb787fb
Parent:     4fca88c87b7969c698912e2de9b1b31088c777cb
Author:     KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>
AuthorDate: Thu Feb 7 00:14:28 2008 -0800
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Thu Feb 7 08:42:20 2008 -0800

    memory cgroup enhancements: implicit force_empty() at rmdir
    
    Add pre_destroy handler for mem_cgroup and try to make mem_cgroup empty at
    rmdir().
    
    Signed-off-by: KAMEZAWA Hiroyuki <[EMAIL PROTECTED]>
    Cc: "Eric W. Biederman" <[EMAIL PROTECTED]>
    Cc: Balbir Singh <[EMAIL PROTECTED]>
    Cc: David Rientjes <[EMAIL PROTECTED]>
    Cc: Herbert Poetzl <[EMAIL PROTECTED]>
    Cc: Kirill Korotaev <[EMAIL PROTECTED]>
    Cc: Nick Piggin <[EMAIL PROTECTED]>
    Cc: Paul Menage <[EMAIL PROTECTED]>
    Cc: Pavel Emelianov <[EMAIL PROTECTED]>
    Cc: Peter Zijlstra <[EMAIL PROTECTED]>
    Cc: Vaidyanathan Srinivasan <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 mm/memcontrol.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 904e9a9..14cb614 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -895,6 +895,13 @@ mem_cgroup_create(struct cgroup_subsys *ss, struct cgroup 
*cont)
        return &mem->css;
 }
 
+static void mem_cgroup_pre_destroy(struct cgroup_subsys *ss,
+                                       struct cgroup *cont)
+{
+       struct mem_cgroup *mem = mem_cgroup_from_cont(cont);
+       mem_cgroup_force_empty(mem);
+}
+
 static void mem_cgroup_destroy(struct cgroup_subsys *ss,
                                struct cgroup *cont)
 {
@@ -946,6 +953,7 @@ struct cgroup_subsys mem_cgroup_subsys = {
        .name = "memory",
        .subsys_id = mem_cgroup_subsys_id,
        .create = mem_cgroup_create,
+       .pre_destroy = mem_cgroup_pre_destroy,
        .destroy = mem_cgroup_destroy,
        .populate = mem_cgroup_populate,
        .attach = mem_cgroup_move_task,
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to