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: O_DIRECT and delayed allocation question
Date: Fri, 19 Jun 2009 17:25:01 +0530 [thread overview]
Message-ID: <20090619115500.GE17784@skywalker> (raw)
In-Reply-To: <6601abe90906181253u657e67a7u67025774cc53bc4f@mail.gmail.com>
On Thu, Jun 18, 2009 at 12:53:17PM -0700, Curt Wohlgemuth wrote:
> This might be a question with an obvious answer, but I'd like
> verification one way or the other.
>
> Does the use of O_DIRECT essentially disable delayed allocation for a
> given file?
>
> My simple tests show a larger degree of block fragmentation for files
> written using O_DIRECT than without, and on its face, this makes sense
> to me. This fragmentation can be removed by using fallocate() on a
> file before extending it with writes.
>
> (Strictly speaking, I guess the use of O_DIRECT wouldn't "disable"
> delayed allocation, since the blocks are allocated at the "normal"
> time -- when going to disk. But effectively there would be a lot less
> block grouping available to build large extents if each write goes to
> disk immediately, instead of going through the page cache.)
>
exactly. So it is possible that we are getting smaller number of block
request in O_DIRECT case. But you should still see better block
allocation because of mballoc. mballoc normalize the input block request
count based on the file size. w.r.t fallocate I have noticed one problem with O_DIRECT
which is explained in the url below. So there may be performance impact on using
O_DIRECT with fallocate.
http://article.gmane.org/gmane.comp.file-systems.ext4/13762
-aneesh
prev parent reply other threads:[~2009-06-19 11:55 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-18 19:53 O_DIRECT and delayed allocation question Curt Wohlgemuth
2009-06-19 11:55 ` 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=20090619115500.GE17784@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).