lkml.org 
[lkml]   [2011]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 3/7] writeback: update wb->last_active on written pages/inodes
    From: Jan Kara <jack@suse.cz>

    The writeback last_active value should be updated on not only written
    pages, but also cleaned inodes.

    Signed-off-by: Jan Kara <jack@suse.cz>
    Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
    ---
    fs/fs-writeback.c | 13 +++++++------
    1 file changed, 7 insertions(+), 6 deletions(-)

    --- linux-next.orig/fs/fs-writeback.c 2011-10-20 21:39:48.000000000 +0800
    +++ linux-next/fs/fs-writeback.c 2011-10-20 22:36:59.000000000 +0800
    @@ -744,6 +744,7 @@ static long wb_writeback(struct bdi_writ
    unsigned long oldest_jif;
    struct inode *inode;
    long progress;
    + long total_progress = 0;

    oldest_jif = jiffies;
    work->older_than_this = &oldest_jif;
    @@ -787,6 +788,7 @@ static long wb_writeback(struct bdi_writ
    else
    progress = __writeback_inodes_wb(wb, work);
    trace_writeback_written(wb->bdi, work);
    + total_progress += progress;

    wb_update_bandwidth(wb, wb_start);

    @@ -820,7 +822,8 @@ static long wb_writeback(struct bdi_writ
    }
    spin_unlock(&wb->list_lock);

    - return nr_pages - work->nr_pages;
    + trace_writeback_pages_written(nr_pages - work->nr_pages);
    + return total_progress;
    }

    /*
    @@ -954,7 +957,7 @@ int bdi_writeback_thread(void *data)
    {
    struct bdi_writeback *wb = data;
    struct backing_dev_info *bdi = wb->bdi;
    - long pages_written;
    + long progress;

    current->flags |= PF_SWAPWRITE;
    set_freezable();
    @@ -974,11 +977,9 @@ int bdi_writeback_thread(void *data)
    */
    del_timer(&wb->wakeup_timer);

    - pages_written = wb_do_writeback(wb, 0);
    -
    - trace_writeback_pages_written(pages_written);
    + progress = wb_do_writeback(wb, 0);

    - if (pages_written)
    + if (progress)
    wb->last_active = jiffies;

    set_current_state(TASK_INTERRUPTIBLE);



    \
     
     \ /
      Last update: 2011-10-20 17:41    [W:0.028 / U:59.840 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site