virtio-blk: Configure all host notifiers in a single MR transaction
commitd0267da614890b8f817364ae25850cdbb580a569
authorGreg Kurz <groug@kaod.org>
Wed, 7 Apr 2021 14:34:59 +0000 (7 16:34 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 14 May 2021 14:26:18 +0000 (14 10:26 -0400)
tree8b52e4c2cbf3443977f1dea1b94dd62f5bbf93cf
parent570fe439e5d1b8626cf344c6bc97d90cfcaf0c79
virtio-blk: Configure all host notifiers in a single MR transaction

This allows the virtio-blk-pci device to batch the setup of all its
host notifiers. This significantly improves boot time of VMs with a
high number of vCPUs, e.g. from 3m26.186s down to 0m58.023s for a
pseries machine with 384 vCPUs.

Note that memory_region_transaction_commit() must be called before
virtio_bus_cleanup_host_notifier() because the latter might close
ioeventfds that the transaction still assumes to be around when it
commits.

Signed-off-by: Greg Kurz <groug@kaod.org>
Message-Id: <20210407143501.244343-3-groug@kaod.org>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/block/dataplane/virtio-blk.c