[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img conve
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated() |
Date: |
Fri, 17 Jun 2011 08:25:03 +0100 |
On Thu, Jun 16, 2011 at 9:10 AM, Dmitry Konishchev <address@hidden> wrote:
> On Wed, Jun 15, 2011 at 5:57 PM, Stefan Hajnoczi <address@hidden> wrote:
>> Anyway, bdrv_getlength() will return the total_sectors value instead
>> of calling into raw-posix.c .bdrv_getlength(). That's why it should
>> be cheap.
>
> Yeah, I see it now after a closer look in the drivers code. It looks
> like I get this 9% slowdown just because for my particular test
> bdrv_get_geometry() is called 37,348,536 times, which is a big number
> even for function which calls another function which checks a few IFs
> and returns a multiplication of two numbers.
Ultimately the QEMU block layer should make total_sectors always
up-to-date so it can be fetched cheaply. This requires looking at all
the block drivers and considering when device size may change at
runtime.
Your patch improves backing file convert cases without regressing
other cases too much.
If you continue optimizing qemu-img, consider profiling the block
operations and improving the core block driver performance instead of
the outer loop of the qemu-img command. That way running VMs will
benefit from your optimizations too. And the simple outer loop may be
acceptable if the operation inside it is fast enough.
Kevin: Are you happy with this patch?
Stefan
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), (continued)
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Stefan Hajnoczi, 2011/06/14
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Dmitry Konishchev, 2011/06/15
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Stefan Hajnoczi, 2011/06/15
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Dmitry Konishchev, 2011/06/15
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Stefan Hajnoczi, 2011/06/15
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Dmitry Konishchev, 2011/06/15
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Stefan Hajnoczi, 2011/06/15
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Dmitry Konishchev, 2011/06/15
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Stefan Hajnoczi, 2011/06/15
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Dmitry Konishchev, 2011/06/16
- Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(),
Stefan Hajnoczi <=
[Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated(), Dmitry Konishchev, 2011/06/15