Re: [PATCH 14/18] writeback: make writeback_control.nr_to_writestraight

From: Dave Chinner
Date: Thu May 19 2011 - 19:29:18 EST


On Fri, May 20, 2011 at 06:06:44AM +0800, Wu Fengguang wrote:
> : writeback_single_inode(inode, wb, &wbc);
> : work->nr_pages -= write_chunk - wbc.nr_to_write;
> : wrote += write_chunk - wbc.nr_to_write;
> : if (wbc.pages_skipped) {
> : /*
> : * writeback is not making progress due to locked
> : * buffers. Skip this inode for now.
> : */
> : redirty_tail(inode, wb);
> : - }
> : + } else if (!(inode->i_state & I_DIRTY))
> : + wrote++;
>
> It looks a bit more clean to do
>
> : wrote += write_chunk - wbc.nr_to_write;
> : + if (!(inode->i_state & I_DIRTY))
> : + wrote++;
> : if (wbc.pages_skipped) {
> : /*
> : * writeback is not making progress due to locked
> : * buffers. Skip this inode for now.
> : */
> : redirty_tail(inode, wb);
> : }

But it's still in the wrong place - such post-write inode dirty
processing is supposed to be isolated to writeback_single_inode().
Spreading it across multiple locations is not, IMO, the nicest thing
to do...

Cheers,

Dave.
--
Dave Chinner
david@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/