Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-16 Thread Dmitry Konishchev
hing to do, so I believe that the second version of the patch is good enough. -- Dmitry Konishchev mailto:konishc...@gmail.com

Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-15 Thread Dmitry Konishchev
On Wed, Jun 15, 2011 at 5:33 PM, Stefan Hajnoczi wrote: > "disable caching"? Image geometry caching. I meant If I call bdrv_get_geometry() every time I need image geometry instead of obtaining it from bs_geometry variable. -- Дмитрий Конищев (Dmitry Konishchev) mailto:konishc...@gmail.com

Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-15 Thread Dmitry Konishchev
geometry() uses bdrv_getlength() which is implemented using lseek() in block/raw-posix.c... May be I'am mistaken about lseek(), but I get 9% slower version if disable caching. -- Дмитрий Конищев (Dmitry Konishchev) mailto:konishc...@gmail.com

[Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-15 Thread Dmitry Konishchev
0m33.894s Signed-off-by: Dmitry Konishchev --- qemu-img.c | 184 ++- 1 files changed, 143 insertions(+), 41 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 4f162d1..7f3d853 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -27,6 +27,7 @@

Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-15 Thread Dmitry Konishchev
On Wed, Jun 15, 2011 at 12:39 PM, Stefan Hajnoczi wrote: > Why is bdrv_get_geometry() slow? Mmm.. Frankly, I haven't looked so deep, but it is going to be slow at least for raw images due to using lseek(). -- Dmitry Konishchev mailto:konishc...@gmail.com

Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-15 Thread Dmitry Konishchev
bably don't need to allocate the array, just call > bdrv_get_geometry(). That might make it easier to write a self-contained > function. I've tried to not cache, but it turned out that bdrv_get_geometry() calls are quite noticeable in profiler without caching. -- Дмитрий Конищев

Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-14 Thread Dmitry Konishchev
On Mon, Jun 13, 2011 at 1:13 PM, Dmitry Konishchev wrote: > I haven't done this because in this case I have to pass too lot of > local variables to this function. Just not sure that it'll look > better. But if you mind I surely can do this. Should I? -- Dmitry Konish

Re: [Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-13 Thread Dmitry Konishchev
n Hajnoczi wrote: > I think the recursive is_allocated() needs its own function.  This > function is already long/complex enough :). I haven't done this because in this case I have to pass too lot of local variables to this function. Just not sure that it'll look better. But if you mind I

[Qemu-devel] [PATCH] CPU consumption optimization of 'qemu-img convert' using bdrv_is_allocated()

2011-06-08 Thread Dmitry Konishchev
0m33.894s Signed-off-by: Dmitry Konishchev --- qemu-img.c | 168 +--- 1 files changed, 127 insertions(+), 41 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index 4f162d1..9d905ed 100644 --- a/qemu-img.c +++ b/qemu-img.c @@ -38,6 +38,8

[Qemu-devel] [PATCH] is_not_zero() optimization in qemu-img

2011-05-18 Thread Dmitry Konishchev
Please sorry - I've sent the previous email via Thunderbird which promised that won't wrap the lines but it did. :( Sending this via git send-email. Signed-off-by: Dmitry Konishchev --- qemu-img.c | 29 ++--- 1 files changed, 26 insertions(+), 3 deletion

Re: [Qemu-devel] [PATCH] [qemu-img] CPU consuming optimization

2011-05-18 Thread Dmitry Konishchev
derstand that, in the place where the function is inlined, it is always called with len == 512 and optimize the code for this case by automatically unroll the loop and so on. But in the bottom line I don't really mind to include the assert - just believe that it's not really worth it. -- D

Re: [Qemu-devel] [PATCH] [qemu-img] CPU consuming optimization

2011-05-18 Thread Dmitry Konishchev
if (d0 || d1 || d2 || d3) return 1; Coding style requires braces here. } + return 0; } OK, fixed. Signed-off-by: Dmitry Konishchev --- qemu-img.c | 29 ++--- 1 files changed, 26 insertions(+), 3 deletions(-) diff --git a/qemu-img.c b/qemu-

Re: [Qemu-devel] [PATCH] [qemu-img] CPU consuming optimization

2011-05-18 Thread Dmitry Konishchev
sure that the conversion falls back to a simple is_not_zero() when a backing file is used. Thanks, I'll take this into account. Signed-off-by: Dmitry Konishchev --- qemu-img.c | 30 +++--- 1 files changed, 27 insertions(+), 3 deletions(-) diff --git a/qemu-im

Re: [Qemu-devel] [PATCH] [qemu-img] CPU consuming optimization

2011-05-17 Thread Dmitry Konishchev
n I'll write an enchancement for it with bdrv_is_allocated() because it is going to include this patch. -- Dmitry Konishchev mailto:konishc...@gmail.com

[Qemu-devel] [PATCH] [qemu-img] CPU consuming optimization

2011-05-17 Thread Dmitry Konishchev
59 Mon Sep 17 00:00:00 2001 From: Dmitry Konishchev Date: Tue, 17 May 2011 16:29:48 +0400 Subject: [PATCH] is_not_zero() optimization in qemu-img --- qemu-img.c | 24 +--- 1 files changed, 21 insertions(+), 3 deletions(-) diff --git a/qemu-img.c b/qemu-img.c index e825123.

[Qemu-devel] [PATCH] Few new QMP features

2011-03-22 Thread Dmitry Konishchev
quot; command just returns error. It will be awesome if you include this patches to the upstream (I've attached them to this message). -- Dmitry Konishchev mailto:konishc...@gmail.com From f7e7119fecbce280e7ee45364260fb6e4d58d49a Mon Sep 17 00:00:00 2001 From: Dmitry Konishchev Date: Wed, 1