lkml.org 
[lkml]   [2003]   [Dec]   [31]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateWed, 31 Dec 2003 15:39:49 +0530
FromSuparna Bhattacharya <>
SubjectRe: [PATCH linux-2.6.0-test10-mm1] filemap_fdatawait.patch
On Wed, Dec 31, 2003 at 01:59:13AM -0800, Andrew Morton wrote:
> Suparna Bhattacharya <suparna@in.ibm.com> wrote:
> >
> > > If you are referring to this code in mpage_writepage():
> >  > 
> >  > 		lock_page(page);
> >  > 
> >  > 		if (wbc->sync_mode != WB_SYNC_NONE)
> >  > 			wait_on_page_writeback(page);
> >  > 
> >  > 		if (page->mapping == mapping && !PageWriteback(page) &&
> >  > 					test_clear_page_dirty(page)) {
> >  > 
> >  > 
> >  > then I don't see the race - the page lock synchronises the two threads?
> >  > 
> > 
> >  But filemap_fdatawait does not look at the page lock. So there's a
> >  tiny window when the page is on locked_pages with PG_dirty cleared
> >  and PG_writeback not set.
> 
> OK, but the thread which is running fdatawrite/fdatawait isn't interested
> in that page, because it must have been dirtied _after_ this thread has
> passed through filemap_fdatawrite(), yes?

Not exactly. The page could actually have been dirtied _before_ this 
thread passes through filemap_datawrite, but is just being parallely 
written back by a background thread.

Regards
Suparna

> 
> Which is desired behaviour for fsync(), but perhaps not suitable when this
> code is reused for the O_DIRECT pagecache synchronisation function.
> 

-- 
Suparna Bhattacharya (suparna@in.ibm.com)
Linux Technology Center
IBM Software Lab, India

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

\
 
 \ /
  Last update: 2005-03-22 12:59    [from the cache]
©2003-2008