From: Eric Blake <eblake@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: peter.maydell@linaro.org, qemu-devel@nongnu.org, qemu-block@nongnu.org
Subject: Re: [PATCH] qemu-img map: Don't limit block status request size
Date: Tue, 7 Jul 2020 10:30:03 -0500 [thread overview]
Message-ID: <8cfe5adb-a2ae-86cd-51af-4ba25c34336d@redhat.com> (raw)
In-Reply-To: <20200707152147.GC7002@linux.fritz.box>
On 7/7/20 10:21 AM, Kevin Wolf wrote:
> Am 07.07.2020 um 16:54 hat Eric Blake geschrieben:
>> On 7/7/20 9:46 AM, Kevin Wolf wrote:
>>> Limiting each loop iteration of qemu-img map to 1 GB was arbitrary from
>>> the beginning, though it only cut the maximum in half then because the
>>> interface a signed 32 bit byte count. These days, bdrv_block_status()
interface was a
>>> supports a 64 bit byte count, so the arbitrary limit is even worse.
>>>
>>> On file-posix, bdrv_block_status() eventually maps to SEEK_HOLE and
>>> SEEK_DATA, which don't support a limit, but always do all of the work
>>> necessary to find the start of the next hole/data. Much of this work may
>>> be repeated if we don't use this information fully, but query with an
>>> only slightly larger offset in the next loop iteration. Therefore, if
>>> bdrv_block_status() is called in a loop, it should always pass the
>>> full number of bytes that the whole loop is interested in.
>>>
>>> This removes the arbitrary limit and speeds up 'qemu-img map'
>>> significantly on heavily fragmented images.
>>>
>>> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
>>> ---
>>> qemu-img.c | 5 +----
>>> 1 file changed, 1 insertion(+), 4 deletions(-)
>>
>> Do you want this in 5.1? It seems like a nice optimization.
>
> I guess now that I have your R-b, I can sneak both patches in for soft
> freeze. :-)
Can we treat optimizations for speed problems as bug fixes if they land
after soft freeze but before -rc1?
At any rate, this post reminds me that Vladimir's series to support
64-bit actions elsewhere has probably slipped into 5.2 territory, but I
still need to fix the fact that nbd is sending uint32_t trim/zero values
into signed int block layer functions (Vladimir's work is nicer but
harder to review, so I'll probably end up writing one-off patches for
5.1 with minimal churn to just block/nbd.c rather than the whole block
layer...)
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
prev parent reply other threads:[~2020-07-07 15:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-07 14:46 [PATCH] qemu-img map: Don't limit block status request size Kevin Wolf
2020-07-07 14:54 ` Eric Blake
2020-07-07 15:21 ` Kevin Wolf
2020-07-07 15:30 ` Eric Blake [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=8cfe5adb-a2ae-86cd-51af-4ba25c34336d@redhat.com \
--to=eblake@redhat.com \
--cc=kwolf@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.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).