lkml.org 
[lkml]   [2009]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 06/45] writeback: use larger ratelimit when dirty_exceeded
    When dirty_exceeded, use ratelimit = ratelimit_pages/8, allowing it to
    scale up to 512KB for memory bounty systems. This is more efficient than
    the original 8 pages, and won't risk exceeding the dirty limit too much.

    Given the larger ratelimit value, we can safely ignore the low bound
    check in sync_writeback_pages.

    dirty_exceeded is more likely to be seen when there are multiple dirty
    processes. In which case the lowered ratelimit will help reduce their
    overall wait time (latency) in the throttled queue.

    CC: Peter Zijlstra <a.p.zijlstra@chello.nl>
    CC: Richard Kennedy <richard@rsk.demon.co.uk>
    Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
    ---
    mm/page-writeback.c | 12 +++++-------
    1 file changed, 5 insertions(+), 7 deletions(-)

    --- linux.orig/mm/page-writeback.c 2009-10-06 23:37:50.000000000 +0800
    +++ linux/mm/page-writeback.c 2009-10-06 23:38:18.000000000 +0800
    @@ -39,7 +39,8 @@
    * After a CPU has dirtied this many pages, balance_dirty_pages_ratelimited
    * will look to see if it needs to force writeback or throttling.
    */
    -static long ratelimit_pages = 32;
    +#define MAX_RATELIMIT_PAGES ((4096 * 1024) / PAGE_CACHE_SIZE)
    +static long ratelimit_pages = MAX_RATELIMIT_PAGES;

    /*
    * When balance_dirty_pages decides that the caller needs to perform some
    @@ -49,9 +50,6 @@ static long ratelimit_pages = 32;
    */
    static inline long sync_writeback_pages(unsigned long dirtied)
    {
    - if (dirtied < ratelimit_pages)
    - dirtied = ratelimit_pages;
    -
    return dirtied + dirtied / 2;
    }

    @@ -600,7 +598,7 @@ void balance_dirty_pages_ratelimited_nr(

    ratelimit = ratelimit_pages;
    if (mapping->backing_dev_info->dirty_exceeded)
    - ratelimit = 8;
    + ratelimit >>= 3;

    /*
    * Check the rate limiting. Also, we do not want to throttle real-time
    @@ -722,8 +720,8 @@ void writeback_set_ratelimit(void)
    ratelimit_pages = vm_total_pages / (num_online_cpus() * 32);
    if (ratelimit_pages < 16)
    ratelimit_pages = 16;
    - if (ratelimit_pages * PAGE_CACHE_SIZE > 4096 * 1024)
    - ratelimit_pages = (4096 * 1024) / PAGE_CACHE_SIZE;
    + if (ratelimit_pages > MAX_RATELIMIT_PAGES)
    + ratelimit_pages = MAX_RATELIMIT_PAGES;
    }

    static int __cpuinit



    \
     
     \ /
      Last update: 2009-10-07 10:15    [W:0.021 / U:429.948 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site