virtio-scsi: Configure all host notifiers in a single MR transaction
commitc4f5dcc4360a02085a633fd7a90b7ac395ca1ba4
authorGreg Kurz <groug@kaod.org>
Wed, 7 Apr 2021 14:35:01 +0000 (7 16:35 +0200)
committerMichael S. Tsirkin <mst@redhat.com>
Fri, 14 May 2021 14:26:18 +0000 (14 10:26 -0400)
tree1f124f46fc3f24a77b27a39205297a64af47f6ec
parent61fc57bfc464c3584bd7ab810c86833661f0188c
virtio-scsi: Configure all host notifiers in a single MR transaction

This allows the virtio-scsi-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 6m5.563s down to 1m2.884s 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-5-groug@kaod.org>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/scsi/virtio-scsi-dataplane.c