Re: regression in page writeback

Chris Mason
2009-09-29T14:00:49Z

On Tue, Sep 29, 2009 at 10:32:27AM +0800, Wu Fengguang wrote:
> On Mon, Sep 28, 2009 at 09:08:04PM +0800, Christoph Hellwig wrote:
> > On Mon, Sep 28, 2009 at 03:15:07PM +0800, Wu Fengguang wrote:
> > > + if (!PageActive(page))
> > > + SetPageReclaim(page);
> > > + err = mapping->a_ops->writepage(page, wbc);
> > > + if (err < 0)
> > > + handle_write_error(mapping, page, res);
> > > + if (err == AOP_WRITEPAGE_ACTIVATE) {
> > > + ClearPageReclaim(page);
> > > + res = PAGE_ACTIVATE;
> > > + break;
> > > + }
> >
> > This should help a bit for XFS as it historically does multi-page
> > writeouts from ->writepages (and apprently btrfs that added some
>
> ->writepage ?
>
> > write-around recently?) but not those brave filesystems only
> > implementing the multi-page writeout from writepages as designed.
>
> Thanks. Just tried write_cache_pages(), looks simple. Need to further
> convert all aops->writepages to support lumpy pageout :)
>
> > But really, the best would be to leave the writeout to the flusher
> > threads and just reclaim the clean pages from the VM.
>
> Yup, that's much larger behavior change, and could be pursued as a
> long term goal.

I don't think we can just change kswapd to wait on flusher thread
progress because the flusher thread can happily spend forever writing
pages that can't actually be freed. Lumpy pageout is a better middle
ground I think.

-chris