All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@zip.com.au>
To: Anton Altaparmakov <aia21@cantab.net>
Cc: Stephen Lord <lord@sgi.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: O_DIRECT read and holes in 2.5.26
Date: Sun, 21 Jul 2002 21:30:06 -0700	[thread overview]
Message-ID: <3D3B8A4E.78944941@zip.com.au> (raw)
In-Reply-To: 5.1.0.14.2.20020722040423.042eb710@pop.cus.cam.ac.uk

Anton Altaparmakov wrote:
> 
> Hi Andrew,
> 
> At 03:26 22/07/02, Andrew Morton wrote:
> >Stephen Lord wrote:
> > > Did you realize that the new O_DIRECT code in 2.5 cannot read over holes
> > > in a file.
> >
> >Well that was intentional, although I confess to not having
> >put a lot of thought into the decision.  The user wants
> >O_DIRECT and we cannot do that.  The CPU has to clear the
> >memory by hand.  Bad.
> >
> >Obviously it's easy enough to put in the code to clear the
> >memory out.  Do you think that should be done?
> 
> I would vote for yes because whether a file is sparse or not cannot be
> trivially controlled by the file creator (unless you actually write the
> whole file with non-zero content) but is dependent on the underlying file
> system...

O_DIRECT tends to be used in specialised applications.  They're
being silly if they're reading from holes.

> And on the grounds that a memset() is going to be a lot faster
> than a read from device I don't see why it shouldn't be done.

It's actually tons more expensive - wiping the page by hand
goes against the whole reason for using O_DIRECT.

But it is the expected behaviour of the read() system call
so yeah, I'll do it.

> ...
> [ get_blocks() stuff ]
>

This is going to be fairly involved.  Probably the top-level
IO code gets ripped up and redone to expect a get_blocks()
interface.  A default implementation of get_blocks() would
be provided for naive filesystems - it just calls get_block()
a lot.  Quite possibly, we say to heck with purity and get_block()
and get_blocks() become a_ops, too.

I'd really like to see a solid reason for doing all this.
That means numbers ;)  Even good old ext2 would be able to show
benefit from batching up the get_block() work, but not a lot.

You won't buy much on writes, I expect - 8k write requests
will probably remain the ideal size.

-

  reply	other threads:[~2002-07-22  4:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-18  8:43 O_DIRECT read and holes in 2.5.26 Stephen Lord
2002-07-22  2:26 ` Andrew Morton
2002-07-22  3:22   ` Anton Altaparmakov
2002-07-22  4:30     ` Andrew Morton [this message]
2002-07-26 20:22   ` Stephen Lord
2002-07-26 20:46     ` Andrew Morton

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=3D3B8A4E.78944941@zip.com.au \
    --to=akpm@zip.com.au \
    --cc=aia21@cantab.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lord@sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.