• KOSAKI Motohiro's avatar
    vmscan: simplify shrink_inactive_list() · e247dbce
    KOSAKI Motohiro authored
    Now, max_scan of shrink_inactive_list() is always passed less than
    SWAP_CLUSTER_MAX.  then, we can remove scanning pages loop in it.  This
    patch also help stack diet.
    
    detail
     - remove "while (nr_scanned < max_scan)" loop
     - remove nr_freed (now, we use nr_reclaimed directly)
     - remove nr_scan (now, we use nr_scanned directly)
     - rename max_scan to nr_to_scan
     - pass nr_to_scan into isolate_pages() directly instead
       using SWAP_CLUSTER_MAX
    
    [akpm@linux-foundation.org: coding-style fixes]
    Signed-off-by: default avatarKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Signed-off-by: default avatarMel Gorman <mel@csn.ul.ie>
    Reviewed-by: default avatarJohannes Weiner <hannes@cmpxchg.org>
    Reviewed-by: default avatarRik van Riel <riel@redhat.com>
    Cc: Dave Chinner <david@fromorbit.com>
    Cc: Chris Mason <chris.mason@oracle.com>
    Cc: Nick Piggin <npiggin@suse.de>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Cc: Christoph Hellwig <hch@infradead.org>
    Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
    Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Cc: Andrea Arcangeli <aarcange@redhat.com>
    Cc: Michael Rubin <mrubin@google.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e247dbce
vmscan.c 79.3 KB