• Mel Gorman's avatar
    Testing by Frans Pop indicated that in the 2.6.30..2.6.31 window at least · a6e043a4
    Mel Gorman authored
    that the commits 373c0a7e 8aa7e847 dramatically increased the number of
    GFP_ATOMIC failures that were occuring within a wireless driver. 
    Reverting this patch seemed to help a lot even though it was pointed out
    that the congestion changes were very far away from high-order atomic
    allocations.
    
    The key to why the revert makes such a big difference is down to timing
    and how long direct reclaimers wait versus kswapd.  With the patch
    reverted, the congestion_wait() is on the SYNC queue instead of the ASYNC.
     As a significant part of the workload involved reads, it makes sense that
    the SYNC list is what was truely congested and with the revert processes
    were waiting on congestion as expected.  Hence, direct reclaimers stalled
    properly and kswapd was able to do its job with fewer stalls.
    
    This patch aims to fix the congestion_wait() behaviour for SYNC and ASYNC
    for direct reclaimers.  Instead of making the congestion_wait() on the
    SYNC queue which would only fix a particular type of workload, this patch
    adds a third type of congestion_wait - BLK_RW_BOTH which first waits on
    the ASYNC and then the SYNC queue if the timeout has not been reached.  In
    tests, this counter-intuitively results in kswapd stalling less and
    freeing up pages resulting in fewer allocation failures and fewer
    direct-reclaim-orientated stalls.
    Signed-off-by: default avatarMel Gorman <mel@csn.ul.ie>
    Cc: Frans Pop <elendil@planet.nl>
    Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
    Cc: Rik van Riel <riel@redhat.com>
    Cc: Christoph Lameter <cl@linux-foundation.org>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    a6e043a4
page_alloc.c 140 KB