[Qemu-devel] [PATCH v3 0/2] virtio: improve virtio devices initialization time

Gal Hammer posted 2 patches 6 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/1517235657-22547-1-git-send-email-ghammer@redhat.com
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test docker-quick@centos6 passed
Test ppc passed
Test s390x passed
hw/block/dataplane/virtio-blk.c |  2 ++
hw/scsi/virtio-scsi-dataplane.c |  2 ++
hw/virtio/vhost.c               |  2 ++
hw/virtio/virtio-bus.c          | 14 ++++++++++----
hw/virtio/virtio.c              | 22 +++++++++++++++++++++-
include/hw/virtio/virtio-bus.h  |  2 ++
6 files changed, 39 insertions(+), 5 deletions(-)
[Qemu-devel] [PATCH v3 0/2] virtio: improve virtio devices initialization time
Posted by Gal Hammer 6 years, 2 months ago
Using a cleanup callback function (Version 2 of this patches) in order to
support transactions fails when the same event notifier fd was used by more
than one Memory Region.

This time I ask the caller to do the event notifier cleanup by himself.

Gal Hammer (2):
  virtio: remove event notifier cleanup call on de-assign
  virtio: improve virtio devices initialization time

 hw/block/dataplane/virtio-blk.c |  2 ++
 hw/scsi/virtio-scsi-dataplane.c |  2 ++
 hw/virtio/vhost.c               |  2 ++
 hw/virtio/virtio-bus.c          | 14 ++++++++++----
 hw/virtio/virtio.c              | 22 +++++++++++++++++++++-
 include/hw/virtio/virtio-bus.h  |  2 ++
 6 files changed, 39 insertions(+), 5 deletions(-)

-- 
2.7.5


Re: [Qemu-devel] [PATCH v3 0/2] virtio: improve virtio devices initialization time
Posted by Greg Kurz 6 years, 2 months ago
On Mon, 29 Jan 2018 16:20:55 +0200
Gal Hammer <ghammer@redhat.com> wrote:

> Using a cleanup callback function (Version 2 of this patches) in order to
> support transactions fails when the same event notifier fd was used by more
> than one Memory Region.
> 
> This time I ask the caller to do the event notifier cleanup by himself.
> 

Much better ! QEMU no longer aborts. Also I could observe a speed-up when
booting a fedora27 guest with 5 virtio-serial devices (max_ports=511), from
1m40s down to 1m10s. Impressive. :)

For all the patches in this series:

Reviewed-by: Greg Kurz <groug@kaod.org>

and

Tested-by: Greg Kurz <groug@kaod.org>

> Gal Hammer (2):
>   virtio: remove event notifier cleanup call on de-assign
>   virtio: improve virtio devices initialization time
> 
>  hw/block/dataplane/virtio-blk.c |  2 ++
>  hw/scsi/virtio-scsi-dataplane.c |  2 ++
>  hw/virtio/vhost.c               |  2 ++
>  hw/virtio/virtio-bus.c          | 14 ++++++++++----
>  hw/virtio/virtio.c              | 22 +++++++++++++++++++++-
>  include/hw/virtio/virtio-bus.h  |  2 ++
>  6 files changed, 39 insertions(+), 5 deletions(-)
> 


Re: [Qemu-devel] [PATCH v3 0/2] virtio: improve virtio devices initialization time
Posted by Gal Hammer 6 years, 2 months ago
Hi Greg,

On Mon, Jan 29, 2018 at 7:47 PM, Greg Kurz <groug@kaod.org> wrote:
> On Mon, 29 Jan 2018 16:20:55 +0200
> Gal Hammer <ghammer@redhat.com> wrote:
>
>> Using a cleanup callback function (Version 2 of this patches) in order to
>> support transactions fails when the same event notifier fd was used by more
>> than one Memory Region.
>>
>> This time I ask the caller to do the event notifier cleanup by himself.
>>
>
> Much better ! QEMU no longer aborts. Also I could observe a speed-up when
> booting a fedora27 guest with 5 virtio-serial devices (max_ports=511), from
> 1m40s down to 1m10s. Impressive. :)

Thanks for the quick review, testing, and the kudos ;-).

After spending some time trying to understand why the previous patch
fails I was able to figure it out. I was using
"disable-legacy=on,disable-modern=off", so I missed the fact that a
"transition" device registers two different memory regions with the
same event fd.

> For all the patches in this series:
>
> Reviewed-by: Greg Kurz <groug@kaod.org>
>
> and
>
> Tested-by: Greg Kurz <groug@kaod.org>
>
>> Gal Hammer (2):
>>   virtio: remove event notifier cleanup call on de-assign
>>   virtio: improve virtio devices initialization time
>>
>>  hw/block/dataplane/virtio-blk.c |  2 ++
>>  hw/scsi/virtio-scsi-dataplane.c |  2 ++
>>  hw/virtio/vhost.c               |  2 ++
>>  hw/virtio/virtio-bus.c          | 14 ++++++++++----
>>  hw/virtio/virtio.c              | 22 +++++++++++++++++++++-
>>  include/hw/virtio/virtio-bus.h  |  2 ++
>>  6 files changed, 39 insertions(+), 5 deletions(-)
>>
>

BTW: There is a pending patch for kvm that will trim few more seconds
from the boot time...

    Gal.