Re: [PATCH 2.6.3-mm3] serialize_writeback_fdatawait patch

Andrew Morton
2004-02-25T01:50:08Z

Daniel McNeil <daniel@osdl.org> wrote:
>
> This patch moves the serializing of writebacks up one level to before
> where the dirty_pages are moved to the io_pages list. This prevents
> writebacks from missing any pages that are moved back to the
> dirty list by an SYNC_NONE writeback. I have not seen this race in
> testing -- just by looking at the code. It also skips the serialization
> for blockdevs.
>
> Also this patch changes filemap_fdatawrite() to leave the page on the
> locked_pages list until the i/o has finished. This prevents
> parallel filemap_fdatawait()s from missing a page that should be
> waited on. I have not seen this in testing, either.

hm, OK. I've converted all the down_read_trylock() things into a sinple
down_read(), to address the pdflush-busywait problem which Hugh identified.

This does mean that pdflush can get blocked by ongoing sync activity but
that's probably insignificant and we have per-spindle pdflush collision
avoidance which will help a bit.

Call me lazy, but could you please work out the ranking of wb_rwsem with
respect to the other VFS locks, update the locking documentation in
mm/filemap.c and make sure that we're actually adhering to it? Thanks.