From: Kevin Wolf <kwolf@redhat.com>
To: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>,
qemu-devel@nongnu.org, Christoph Hellwig <hch@lst.de>
Subject: [Qemu-devel] Re: [PATCH v2] block: Cache total_sectors to reduce bdrv_getlength calls
Date: Tue, 20 Apr 2010 10:35:05 +0200 [thread overview]
Message-ID: <4BCD6739.6070507@redhat.com> (raw)
In-Reply-To: <1271692601-6881-1-git-send-email-stefanha@linux.vnet.ibm.com>
Am 19.04.2010 17:56, schrieb Stefan Hajnoczi:
> The BlockDriver bdrv_getlength function is called from the I/O code path
> when checking that the request falls within the device. Unfortunately
> this involves an lseek system call in the raw protocol; every read or
> write request will incur this lseek cost.
>
> Jan Kiszka <jan.kiszka@siemens.com> identified this issue and its
> latency overhead. This patch caches device length in the existing
> total_sectors variable so lseek calls can be avoided for fixed size
> devices.
>
> Growable devices fall back to the full bdrv_getlength code path because
> I have not added logic to detect extending the size of the device in a
> write.
>
> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
> ---
> v2:
> - Introduced refresh_total_sectors() to clean up total_sectors updates
> - Added error handling for refresh_total_sectors() callers
Looks good, applied to the block branch.
Kevin
prev parent reply other threads:[~2010-04-20 8:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-19 15:56 [Qemu-devel] [PATCH v2] block: Cache total_sectors to reduce bdrv_getlength calls Stefan Hajnoczi
2010-04-20 8:35 ` Kevin Wolf [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=4BCD6739.6070507@redhat.com \
--to=kwolf@redhat.com \
--cc=hch@lst.de \
--cc=jan.kiszka@siemens.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@linux.vnet.ibm.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.