• KAMEZAWA Hiroyuki's avatar
    memcg: new force_empty to free pages under group · c1e862c1
    KAMEZAWA Hiroyuki authored
    By memcg-move-all-accounts-to-parent-at-rmdir.patch, there is no leak of
    memory usage and force_empty is removed.
    
    This patch adds "force_empty" again, in reasonable manner.
    
    memory.force_empty file works when
    
      #echo 0 (or some) > memory.force_empty
      and have following function.
    
      1. only works when there are no task in this cgroup.
      2. free all page under this cgroup as much as possible.
      3. page which cannot be freed will be moved up to parent.
      4. Then, memcg will be empty after above echo returns.
    
    This is much better behavior than old "force_empty" which just forget
    all accounts. This patch also check signal_pending() and above "echo"
    can be stopped by "Ctrl-C".
    
    [akpm@linux-foundation.org: cleanup]
    Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Li Zefan <lizf@cn.fujitsu.com>
    Cc: Balbir Singh <balbir@in.ibm.com>
    Cc: Pavel Emelyanov <xemul@openvz.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    c1e862c1
memory.txt 11.4 KB