• Rik van Riel's avatar
    mm,vmscan: only evict file pages when we have plenty · e9868505
    Rik van Riel authored
    If we have more inactive file pages than active file pages, we skip
    scanning the active file pages altogether, with the idea that we do not
    want to evict the working set when there is plenty of streaming IO in the
    cache.
    
    However, the code forgot to also skip scanning anonymous pages in that
    situation.  That leads to the curious situation of keeping the active file
    pages protected from being paged out when there are lots of inactive file
    pages, while still scanning and evicting anonymous pages.
    
    This patch fixes that situation, by only evicting file pages when we have
    plenty of them and most are inactive.
    
    [akpm@linux-foundation.org: adjust comment layout]
    Signed-off-by: default avatarRik van Riel <riel@redhat.com>
    Cc: Mel Gorman <mel@csn.ul.ie>
    Cc: Johannes Weiner <hannes@cmpxchg.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    e9868505
vmscan.c 99.8 KB