From: Mingming Cao <cmm@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>
Cc: pbadari@us.ibm.com, linux-fsdevel@vger.kernel.org,
sct@redhat.com, andrea@suse.de
Subject: Re: kjournald() with DIO
Date: Wed, 14 Sep 2005 14:40:24 -0700 [thread overview]
Message-ID: <1126734025.4010.21.camel@localhost.localdomain> (raw)
In-Reply-To: <20050914111809.41c5b395.akpm@osdl.org>
On Wed, 2005-09-14 at 11:18 -0700, Andrew Morton wrote:
> Mingming Cao <cmm@us.ibm.com> wrote:
> >
> > On Tue, 2005-09-13 at 16:07 -0700, Andrew Morton wrote:
> >
> > > Or simply ignore the invalidate_inode_pages2_range() return value in
> > > generic_file_direct_IO().
> > >
> > Could we simply do that?
> >
> > I found some discussions about why we check the return value of
> > invalidate_inode_pages2_range() in generic_file_direct_IO():
> > http://marc.theaimsgroup.com/?l=linux-kernel&m=109850054025709&w=2
>
> Well found. That brings it back.
>
> > It seems the check for EIO was added to 2.6.11 to handle the case of
> > parallel direct IO and mapped IO. It is possible that the mapped IO
> > dirty the pages after the a_ops->direct_IO. In that case, an error will
> > return back to the caller of DIO to indicate the race.
>
> According to the logic we discussed last year,
> invalidate_inode_pages2_range() only needs to return -EIO if it failed to
> invalidate a page, and that page was dirty.
>
> The -EIO is there to tell the caller that another process dirtied pagecache
> against the file (within the range of the direct-io write()) after
> generic_file_direct_IO() has synced the pagecache to disk.
>
> The -EIO is telling the direct-io write()r "hey, the data which you wrote
> was overwritten by a racing buffered-write() or mmapped-write". It's not
> obvious to me _why_ we should tell the direct-io write()r this - after all,
> we assume that's what the application developer wanted to do.
>
> Still, we don't have to worry about that at present because
> invalidate_inode_pages2_range() is just doing the wrong thing: it's
> treating this elevated-refcount buffer_head as if it was a dirty page, and
> it's not.
>
> How about this?
I proposed similar idea to Andrea in the bug report before. Andrea
expressed this concern: with this(try_to_free_buffers() still fail to
drop the buffer because of this elevated-refcount by kjournald),
block_read_full_page will not re-read from disk the buffers the next
time a buffered-IO read from disk, after the direct-io has completed.
This is because the buffer is marked uptodate. How could we handle this?
Mingming
next prev parent reply other threads:[~2005-09-14 21:41 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-12 23:23 kjournald() with DIO Badari Pulavarty
2005-09-12 23:37 ` Andrew Morton
2005-09-13 0:06 ` Badari Pulavarty
2005-09-13 0:29 ` Andrew Morton
2005-09-13 16:52 ` Badari Pulavarty
2005-09-13 23:07 ` Andrew Morton
2005-09-14 17:23 ` Mingming Cao
2005-09-14 18:18 ` Andrew Morton
2005-09-14 21:40 ` Mingming Cao [this message]
2005-09-14 22:02 ` Andrew Morton
2005-09-15 11:11 ` Suparna Bhattacharya
2005-09-15 18:52 ` Andrew Morton
2005-09-15 15:03 ` Badari Pulavarty
2005-09-15 19:22 ` Andrea Arcangeli
2005-09-15 20:00 ` Andrew Morton
2005-09-15 20:20 ` Andrea Arcangeli
2005-09-15 20:35 ` Andrew Morton
2005-09-15 20:49 ` Badari Pulavarty
2005-09-15 21:06 ` Andrea Arcangeli
2005-09-15 21:20 ` Andrew Morton
2005-09-15 22:22 ` Badari Pulavarty
2005-09-15 21:03 ` Andrea Arcangeli
2005-09-15 21:26 ` Andrew Morton
2005-09-15 22:04 ` Andrea Arcangeli
2005-09-15 23:28 ` Mingming Cao
2005-09-16 0:18 ` Andrea Arcangeli
2005-09-13 17:53 ` Mingming Cao
2005-09-16 13:42 ` Stephen C. Tweedie
2005-09-21 18:22 ` Mingming Cao
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1126734025.4010.21.camel@localhost.localdomain \
--to=cmm@us.ibm.com \
--cc=akpm@osdl.org \
--cc=andrea@suse.de \
--cc=linux-fsdevel@vger.kernel.org \
--cc=pbadari@us.ibm.com \
--cc=sct@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).