lkml.org 
[lkml]   [2005]   [Dec]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 12/12] mm: fix minor scan count bugs
    - in isolate_lru_pages(): reports one more scan. Fix it.
    - in shrink_cache(): 0 pages taken does not mean 0 pages scanned. Fix it.

    Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn>
    ---

    mm/vmscan.c | 10 ++++++----
    1 files changed, 6 insertions(+), 4 deletions(-)

    --- linux.orig/mm/vmscan.c
    +++ linux/mm/vmscan.c
    @@ -920,7 +920,8 @@ static int isolate_lru_pages(int nr_to_s
    struct page *page;
    int scan = 0;

    - while (scan++ < nr_to_scan && !list_empty(src)) {
    + while (scan < nr_to_scan && !list_empty(src)) {
    + scan++;
    page = lru_to_page(src);
    prefetchw_prev_lru_page(page, src, flags);

    @@ -967,14 +968,15 @@ static void shrink_cache(struct zone *zo
    update_zone_age(zone, nr_scan);
    spin_unlock_irq(&zone->lru_lock);

    - if (nr_taken == 0)
    - return;
    -
    sc->nr_scanned += nr_scan;
    if (current_is_kswapd())
    mod_page_state_zone(zone, pgscan_kswapd, nr_scan);
    else
    mod_page_state_zone(zone, pgscan_direct, nr_scan);
    +
    + if (nr_taken == 0)
    + return;
    +
    nr_freed = shrink_list(&page_list, sc);
    if (current_is_kswapd())
    mod_page_state(kswapd_steal, nr_freed);
    --
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-12-01 11:18    [W:3.233 / U:0.528 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site