• Balbir Singh's avatar
    memcg: add file-based RSS accounting · d69b042f
    Balbir Singh authored
    Add file RSS tracking per memory cgroup
    
    We currently don't track file RSS, the RSS we report is actually anon RSS.
     All the file mapped pages, come in through the page cache and get
    accounted there.  This patch adds support for accounting file RSS pages.
    It should
    
    1. Help improve the metrics reported by the memory resource controller
    2. Will form the basis for a future shared memory accounting heuristic
       that has been proposed by Kamezawa.
    
    Unfortunately, we cannot rename the existing "rss" keyword used in
    memory.stat to "anon_rss".  We however, add "mapped_file" data and hope to
    educate the end user through documentation.
    
    [hugh.dickins@tiscali.co.uk: fix mem_cgroup_update_mapped_file_stat oops]
    Signed-off-by: default avatarBalbir Singh <balbir@linux.vnet.ibm.com>
    Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: Li Zefan <lizf@cn.fujitsu.cn>
    Cc: Paul Menage <menage@google.com>
    Cc: Dhaval Giani <dhaval@linux.vnet.ibm.com>
    Cc: Daisuke Nishimura <nishimura@mxp.nes.nec.co.jp>
    Cc: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
    Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Cc: David Rientjes <rientjes@google.com>
    Signed-off-by: default avatarHugh Dickins <hugh.dickins@tiscali.co.uk>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    d69b042f
page_cgroup.c 10.1 KB