lkml.org 
[lkml]   [2010]   [Dec]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 18/35] writeback: start background writeback earlier
    It's possible for some one to suddenly eat lots of memory,
    leading to sudden drop of global dirty limit. So a dirtier
    task may get hard throttled immediately without some previous
    balance_dirty_pages() call to invoke background writeback.

    In this case we need to check for background writeback earlier in the
    loop to avoid stucking the application for very long time. This was not
    a problem before the IO-less balance_dirty_pages() because it will try
    to write something and then break out of the loop regardless of the
    global limit.

    Another scheme this check will help is, the dirty limit is too close to
    the background threshold, so that someone manages to jump directly into
    the pause threshold (background+dirty)/2.

    Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
    ---
    mm/page-writeback.c | 3 +++
    1 file changed, 3 insertions(+)

    --- linux-next.orig/mm/page-writeback.c 2010-12-13 21:46:16.000000000 +0800
    +++ linux-next/mm/page-writeback.c 2010-12-13 21:46:17.000000000 +0800
    @@ -748,6 +748,9 @@ static void balance_dirty_pages(struct a
    bdi_stat(bdi, BDI_WRITEBACK);
    }

    + if (unlikely(!writeback_in_progress(bdi)))
    + bdi_start_background_writeback(bdi);
    +
    bdi_update_bandwidth(bdi, start_time, bdi_dirty, bdi_thresh);

    /*



    \
     
     \ /
      Last update: 2010-12-13 16:39    [W:5.425 / U:0.204 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site