• KAMEZAWA Hiroyuki's avatar
    per-zone and reclaim enhancements for memory controller: modifies vmscan.c for... · 1cfb419b
    KAMEZAWA Hiroyuki authored
    per-zone and reclaim enhancements for memory controller: modifies vmscan.c for isolate globa/cgroup lru activity
    
    When using memory controller, there are 2 levels of memory reclaim.
     1. zone memory reclaim because of system/zone memory shortage.
     2. memory cgroup memory reclaim because of hitting limit.
    
    These two can be distinguished by sc->mem_cgroup parameter.
    (scan_global_lru() macro)
    
    This patch tries to make memory cgroup reclaim routine avoid affecting
    system/zone memory reclaim. This patch inserts if (scan_global_lru()) and
    hook to memory_cgroup reclaim support functions.
    
    This patch can be a help for isolating system lru activity and group lru
    activity and shows what additional functions are necessary.
    
     * mem_cgroup_calc_mapped_ratio() ... calculate mapped ratio for cgroup.
     * mem_cgroup_reclaim_imbalance() ... calculate active/inactive balance in
                                            cgroup.
     * mem_cgroup_calc_reclaim_active() ... calculate the number of active pages to
                                    be scanned in this priority in mem_cgroup.
    
     * mem_cgroup_calc_reclaim_inactive() ... calculate the number of inactive pages
                                    to be scanned in this priority in mem_cgroup.
    
     * mem_cgroup_all_unreclaimable() .. checks cgroup's page is all unreclaimable
                                         or not.
     * mem_cgroup_get_reclaim_priority() ...
     * mem_cgroup_note_reclaim_priority() ... record reclaim priority (temporal)
     * mem_cgroup_remember_reclaim_priority()
                                 .... record reclaim priority as
                                      zone->prev_priority.
                                      This value is used for calc reclaim_mapped.
    
    [akpm@linux-foundation.org: fix unused var warning]
    Signed-off-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: "Eric W. Biederman" <ebiederm@xmission.com>
    Cc: Balbir Singh <balbir@linux.vnet.ibm.com>
    Cc: David Rientjes <rientjes@google.com>
    Cc: Herbert Poetzl <herbert@13thfloor.at>
    Cc: Kirill Korotaev <dev@sw.ru>
    Cc: Nick Piggin <nickpiggin@yahoo.com.au>
    Cc: Paul Menage <menage@google.com>
    Cc: Pavel Emelianov <xemul@openvz.org>
    Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
    Cc: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com>
    Cc: Rik van Riel <riel@redhat.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    1cfb419b
vmscan.c 57.3 KB