Re: [PATCH 2.6.3-rc2-mm1] address_space_serialize_writeback patch

From: Daniel McNeil
Date: Wed Feb 18 2004 - 14:39:13 EST


Andrew,

I did run the multiple copies of the direct_read_under test on:

KERNEL RESULT
====== ======
2.6.3-rc2-mm1 Sees uninitialized data

2.6.3-rc2-mm1 + wait_on_buffer() in
__block_write_full_page no uninitialized data seen

2.6.3-rc2-mm1 + __set_page_dirty_nobuffers
if cannot lock_buffer in
__block_write_full_page Sees uninitialized data

2.6.3-rc2-mm1 + wb_rwsema patch no uninitialized data seen


There looks like there are potential race conditions with
the rwsema in do_writepages() since a page can be moved back
to the dirty list while waiting on the down_write() and also
with multiple filemap_fdatawait()s. I have pointed this out before
but I do not have a test that can reproduce the problem.

The rwsema patch does make the direct_read_under test pass.
It ran overnight without errors.

I want to close all the potential race conditions, but since
this patch is a step in the process and the test ran correctly
with it, I submitted the patch.

I'll send out updated patches as I do more testing.


Daniel

On Tue, 2004-02-17 at 17:47, Andrew Morton wrote:
> Daniel McNeil <daniel@xxxxxxxx> wrote:
> >
> > Here is the patch that does what you suggested. It adds a rwsema to
> > the address_space and do_writepages() uses it serialize writebacks.
>
> Did you verify that we actually _need_ the semaphore? I seem to recall that
> it was a "try this, otherwise add the semaphore" thing. Where "this" was "always
> remark the page dirty".
>
> Probably we do need the semaphore, but I'd just like to check that you checked ;)

-
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/