qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Max Reitz <mreitz@redhat.com>
To: Markus Armbruster <armbru@redhat.com>, Eric Blake <eblake@redhat.com>
Cc: Kevin Wolf <kwolf@redhat.com>,
	qemu-devel@nongnu.org, Stefan Hajnoczi <stefanha@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] block/raw-posix: Try both FIEMAP and SEEK_HOLE
Date: Thu, 08 May 2014 20:35:18 +0200	[thread overview]
Message-ID: <536BCE66.6090105@redhat.com> (raw)
In-Reply-To: <87ha52jfnp.fsf@blackfin.pond.sub.org>

On 07.05.2014 07:56, Markus Armbruster wrote:
> Eric Blake <eblake@redhat.com> writes:
>
>> On 05/06/2014 03:18 PM, Eric Blake wrote:
>>
>>> ...if you are on a file system where SEEK_HOLE triggers the kernel
>>> fallback of "entire file is allocated", but where FIEMAP is wired up for
>>> that file system, would it make sense to have try_seek_hole return -1 in
>>> situations where lseek(s->fd, 0, SEEK_HOLE) returns the end of the file?
>>>   Even more, should skip_seek_hole be a tri-state?
>> On the other hand, such systems are getting vanishingly rare as people
>> upgrade to newer kernels.  Do we care about catering to them, or is it
>> fair game to just tell people to upgrade if they want performance?
> My tolerance for code complications to speed up things under old kernels
> isn't zero, but close.  Leave these games to downstreams sporting such
> kernels.

As far as I see it, it isn't an optimization for older but for newer 
kernels. Including Paolo's comment for v3, we could get away without 
these tristate shenanigans if we'd keep the old (current) order, that 
is, first try FIEMAP which will return ENOTSUP if it's not supported, 
and then fall back to SEEK_HOLE which will always return some result (if 
available, otherwise we can't even use it, obviously).

But as SEEK_HOLE is apparently the more "standard" way to acquire the 
required information, using it first is an optimization for newer 
systems (older Linux systems and/or older drivers will only provide FIEMAP).

I think there is no big performance penality in trying FIEMAP first, as 
the first call to raw_co_get_block_status() will detect that it is not 
available for the given file and therefore will be skipped from then on 
anyway.

Considering this, I guess I'll send a v4 without any tristates and which 
keeps the old order (FIEMAP first and then SEEK_HOLE).

Max

  reply	other threads:[~2014-05-08 18:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06 19:00 [Qemu-devel] [PATCH v2] block/raw-posix: Try both FIEMAP and SEEK_HOLE Max Reitz
2014-05-06 21:18 ` Eric Blake
2014-05-06 21:35   ` Max Reitz
2014-05-06 21:47   ` Eric Blake
2014-05-06 21:48     ` Max Reitz
2014-05-07  5:56     ` Markus Armbruster
2014-05-08 18:35       ` Max Reitz [this message]
2014-05-09  8:03 ` Paolo Bonzini
2014-05-11 17:26 ` Christoph Hellwig
2014-05-14 23:13   ` Max Reitz

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=536BCE66.6090105@redhat.com \
    --to=mreitz@redhat.com \
    --cc=armbru@redhat.com \
    --cc=eblake@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@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).