• Andy Whitcroft's avatar
    synchronous lumpy reclaim: wait for page writeback when directly reclaiming contiguous areas · c661b078
    Andy Whitcroft authored
    Lumpy reclaim works by selecting a lead page from the LRU list and then
    selecting pages for reclaim from the order-aligned area of pages.  In the
    situation were all pages in that region are inactive and not referenced by any
    process over time, it works well.
    
    In the situation where there is even light load on the system, the pages may
    not free quickly.  Out of a area of 1024 pages, maybe only 950 of them are
    freed when the allocation attempt occurs because lumpy reclaim returned early.
     This patch alters the behaviour of direct reclaim for large contiguous
    blocks.
    
    The first attempt to call shrink_page_list() is asynchronous but if it fails,
    the pages are submitted a second time and the calling process waits for the IO
    to complete.  This may stall allocators waiting for contiguous memory but that
    should be expected behaviour for high-order users.  It is preferable behaviour
    to potentially queueing unnecessary areas for IO.  Note that kswapd will not
    stall in this fashion.
    
    [apw@shadowen.org: update to version 2]
    [apw@shadowen.org: update to version 3]
    Signed-off-by: default avatarMel Gorman <mel@csn.ul.ie>
    Signed-off-by: default avatarAndy Whitcroft <apw@shadowen.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    c661b078
vmscan.c 51.6 KB