From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Curt Wohlgemuth <curtw@google.com>
Cc: ext4 development <linux-ext4@vger.kernel.org>
Subject: Re: [PATCH RFC] Insure direct IO writes do not use the page cache
Date: Thu, 30 Jul 2009 16:36:11 +0530 [thread overview]
Message-ID: <20090730110611.GA27453@skywalker> (raw)
In-Reply-To: <6601abe90907281728h22be79fenc68a16b578e28a91@mail.gmail.com>
On Tue, Jul 28, 2009 at 05:28:05PM -0700, Curt Wohlgemuth wrote:
> This insures that direct IO writes to fallocate'd file space do not use the
> page cache.
>
>
> Signed-off-by: Curt Wohlgemuth <curtw@google.com>
>
> ---
>
> I implemented Aneesh's ideas for this solution, but have some questions.
>
> I've verified that the page cache isn't used, regardless of whether
> FALLOC_FL_KEEP_SIZE is used in the fallocate() call or not.
>
> The changes:
> - New inode state flag to indicate that a DIO write is ongoing
>
> - ext4_ext_convert_to_initialized() will mark any new extent it creates
> as uninitialized, if this new EXT4_STATE_DIO_WRITE flag is set.
That will have issues with a parallel get_block due to writepages. ext4_da_writepages
will end up calling get_block on uninit extent without holding inode->i_mutex. So
you can have a direct_IO -> get_block and a writepages -> get_block going together
now if we mark extent as uninit based on a inode flag we will have to fix the
writepages call path also. Instead of inode flag you may want to track the extent
(you can look at the patch from Chris Mason implementing data=guarded for ext3. Chris
Mason's patch track buffer_head what you want is to track extent. And convert the
extent to init using end_io call back.
>
> - ext4_direct_IO() will set this flag for any write.
>
> It now calls blockdev_direct_IO_own_locking() to do the I/O.
>
> After return from blockdev_direct_IO_own_locking() it clears the flag
> and calls a new routine to mark all extents containing the returned
> blocks as initialized.
>
> I'm a bit uncertain about the use of DIO_OWN_LOCKING; I looked at the XFS
> code to see if it acquired any other locks while using this flag, but didn't
> see any. Suggestions/corrections welcome.
-aneesh
prev parent reply other threads:[~2009-07-30 11:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-29 0:28 [PATCH RFC] Insure direct IO writes do not use the page cache Curt Wohlgemuth
2009-07-29 16:10 ` Curt Wohlgemuth
2009-07-29 17:18 ` Eric Sandeen
2009-07-29 17:41 ` Eric Sandeen
2009-07-29 19:48 ` Eric Sandeen
2009-07-29 22:17 ` Mingming
2009-07-29 17:47 ` Mingming
2009-07-29 18:10 ` Theodore Tso
2009-07-30 18:30 ` Jan Kara
2009-07-30 18:39 ` Eric Sandeen
2009-07-30 18:44 ` Jan Kara
2009-07-30 19:16 ` Eric Sandeen
2009-07-30 20:33 ` Theodore Tso
2009-07-31 16:10 ` Curt Wohlgemuth
2009-08-01 6:56 ` [PATCH RFC] ext4 direct IO for holes, fallocate Mingming
2009-08-03 16:47 ` Aneesh Kumar K.V
2009-08-03 23:40 ` Mingming
2009-07-31 17:58 ` [PATCH RFC] Insure direct IO writes do not use the page cache Mingming
2009-07-31 18:03 ` Michael Rubin
2009-07-31 18:03 ` Michael Rubin
2009-08-03 9:36 ` Jan Kara
2009-07-30 11:06 ` Aneesh Kumar K.V [this message]
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=20090730110611.GA27453@skywalker \
--to=aneesh.kumar@linux.vnet.ibm.com \
--cc=curtw@google.com \
--cc=linux-ext4@vger.kernel.org \
/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).