lkml.org 
[lkml]   [2008]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 04/11] make get_scan_ratio() to memcg safe
    Date
    Currently, get_scan_ratio() always calculate the balancing value for global reclaim and
    memcg reclaim doesn't use it.
    Therefore it doesn't have scan_global_lru() condition.

    However, we plan to expand get_scan_ratio() to be usable for memcg too, latter.
    Then, The dependency code of global reclaim in the get_scan_ratio() insert into
    scan_global_lru() condision explictly.


    this patch doesn't have any functional change.


    Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    ---
    mm/vmscan.c | 15 +++++++++------
    1 file changed, 9 insertions(+), 6 deletions(-)

    Index: b/mm/vmscan.c
    ===================================================================
    --- a/mm/vmscan.c
    +++ b/mm/vmscan.c
    @@ -1435,13 +1435,16 @@ static void get_scan_ratio(struct zone *
    zone_nr_pages(zone, sc, LRU_INACTIVE_ANON);
    file = zone_nr_pages(zone, sc, LRU_ACTIVE_FILE) +
    zone_nr_pages(zone, sc, LRU_INACTIVE_FILE);
    - free = zone_page_state(zone, NR_FREE_PAGES);

    - /* If we have very few page cache pages, force-scan anon pages. */
    - if (unlikely(file + free <= zone->pages_high)) {
    - percent[0] = 100;
    - percent[1] = 0;
    - return;
    + if (scan_global_lru(sc)) {
    + free = zone_page_state(zone, NR_FREE_PAGES);
    + /* If we have very few page cache pages,
    + force-scan anon pages. */
    + if (unlikely(file + free <= zone->pages_high)) {
    + percent[0] = 100;
    + percent[1] = 0;
    + return;
    + }
    }

    /*



    \
     
     \ /
      Last update: 2008-12-01 13:17    [W:4.780 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site