lkml.org 
[lkml]   [2011]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: [PATCH 1/9] writeback: make writeback_control.nr_to_write straight
    >   Just one minor nit:
    >
    > > @@ -570,17 +622,25 @@ static int writeback_sb_inodes(struct su
    > > iput(inode);
    > > cond_resched();
    > > spin_lock(&wb->list_lock);
    > > - if (wbc->nr_to_write <= 0)
    > > - return 1;
    > > + /*
    > > + * bail out to wb_writeback() often enough to check
    > > + * background threshold and other termination conditions.
    > > + */
    > > + if (wrote) {
    > > + if (jiffies - start_time > HZ / 10UL)
    > > + break;
    > I guess this comparison should use time_before() macro - or maybe even
    > time_is_before_jiffies().

    Fair enough. Changed to:

    if (time_is_before_jiffies(start_time + HZ / 10UL))

    > > + if (work->nr_pages <= 0)
    > > + break;
    > > + }
    > > }
    > > - /* b_io is empty */
    > > - return 1;
    > > + return wrote;
    > > }
    > >
    > > -static void __writeback_inodes_wb(struct bdi_writeback *wb,
    > > - struct writeback_control *wbc)
    > > +static long __writeback_inodes_wb(struct bdi_writeback *wb,
    > > + struct wb_writeback_work *work)
    > > {
    > > - int ret = 0;
    > > + unsigned long start_time = jiffies;
    > > + long wrote = 0;
    > >
    > > while (!list_empty(&wb->b_io)) {
    > > struct inode *inode = wb_inode(wb->b_io.prev);
    > > @@ -590,33 +650,37 @@ static void __writeback_inodes_wb(struct
    > > requeue_io(inode, wb);
    > > continue;
    > > }
    > > - ret = writeback_sb_inodes(sb, wb, wbc, false);
    > > + wrote += writeback_sb_inodes(sb, wb, work);
    > > drop_super(sb);
    > >
    > > - if (ret)
    > > - break;
    > > + /* refer to the same tests at the end of writeback_sb_inodes */
    > > + if (wrote) {
    > > + if (jiffies - start_time > HZ / 10UL)
    > > + break;
    > And the same here.

    Changed together. Thanks for the review!

    Fengguang


    \
     
     \ /
      Last update: 2011-07-01 14:05    [W:0.025 / U:118.680 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site