[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PULL 31/38] device-core: use RCU for list of children of a bus
From: |
Eric Blake |
Subject: |
Re: [PULL 31/38] device-core: use RCU for list of children of a bus |
Date: |
Tue, 27 Oct 2020 14:34:21 -0500 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.3.1 |
On 10/12/20 3:33 PM, Paolo Bonzini wrote:
> From: Maxim Levitsky <mlevitsk@redhat.com>
>
> This fixes the race between device emulation code that tries to find
> a child device to dispatch the request to (e.g a scsi disk),
> and hotplug of a new device to that bus.
>
> Note that this doesn't convert all the readers of the list
> but only these that might go over that list without BQL held.
>
> This is a very small first step to make this code thread safe.
>
> Suggested-by: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Maxim Levitsky <mlevitsk@redhat.com>
> Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
> Message-Id: <20200913160259.32145-5-mlevitsk@redhat.com>
> [Use RCU_READ_LOCK_GUARD in more places, adjust testcase now that
> the delay in DEVICE_DELETED due to RCU is more consistent. - Paolo]
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> Message-Id: <20201006123904.610658-9-mlevitsk@redhat.com>
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Git bisect lands on this commit as the reason that iotest 240 is failing:
--- /home/eblake/qemu-tmp2/tests/qemu-iotests/240.out 2020-10-23
10:47:02.268392745 -0500
+++ /home/eblake/qemu-tmp2/build/tests/qemu-iotests/240.out.bad
2020-10-27 14:27:38.417188285 -0500
@@ -10,10 +10,10 @@
{"return": {}}
{"return": {}}
{"return": {}}
+{"error": {"class": "GenericError", "desc": "Duplicate ID 'scsi-hd0'
for device"}}
+{"error": {"class": "DeviceNotFound", "desc": "Device 'scsi-hd0' not
found"}}
{"return": {}}
-{"return": {}}
-{"return": {}}
-{"return": {}}
+{"error": {"class": "GenericError", "desc": "Node hd0 is in use"}}
{"return": {}}
=== Attach two SCSI disks using the same block device and the same
iothread ===
@@ -29,7 +29,7 @@
{"return": {}}
{"return": {}}
{"return": {}}
-{"return": {}}
+{"error": {"class": "GenericError", "desc": "Node hd0 is in use"}}
{"return": {}}
=== Attach two SCSI disks using the same block device but different
iothreads ===
@@ -45,8 +45,8 @@
{"return": {}}
{"error": {"class": "GenericError", "desc": "Cannot change iothread of
active block backend"}}
{"return": {}}
-{"return": {}}
-{"return": {}}
+{"error": {"class": "GenericError", "desc": "Cannot change iothread of
active block backend"}}
+{"error": {"class": "DeviceNotFound", "desc": "Device 'scsi-hd1' not
found"}}
{"return": {}}
{"return": {}}
{"return": {}}
Failures: 240
Failed 1 of 1 iotests
--
Eric Blake, Principal Software Engineer
Red Hat, Inc. +1-919-301-3226
Virtualization: qemu.org | libvirt.org
- [PULL 28/38] qdev: add "check if address free" callback for buses, (continued)
- [PULL 28/38] qdev: add "check if address free" callback for buses, Paolo Bonzini, 2020/10/12
- [PULL 16/38] docs/devel/qtest: Include libqtest API reference, Paolo Bonzini, 2020/10/12
- [PULL 33/38] device-core: use atomic_set on .realized property, Paolo Bonzini, 2020/10/12
- [PULL 32/38] scsi: switch to bus->check_address, Paolo Bonzini, 2020/10/12
- [PULL 13/38] qom: fix objects with improper parent type, Paolo Bonzini, 2020/10/12
- [PULL 38/38] meson: identify more sections of meson.build, Paolo Bonzini, 2020/10/12
- [PULL 30/38] device_core: use drain_call_rcu in in qmp_device_add, Paolo Bonzini, 2020/10/12
- [PULL 37/38] scsi/scsi_bus: fix races in REPORT LUNS, Paolo Bonzini, 2020/10/12
- [PULL 34/38] scsi/scsi-bus: scsi_device_find: don't return unrealized devices, Paolo Bonzini, 2020/10/12
- [PULL 31/38] device-core: use RCU for list of children of a bus, Paolo Bonzini, 2020/10/12
- Re: [PULL 31/38] device-core: use RCU for list of children of a bus,
Eric Blake <=
- [PULL 36/38] virtio-scsi: use scsi_device_get, Paolo Bonzini, 2020/10/12
- [PULL 27/38] qemu-iotests, qtest: rewrite test 067 as a qtest, Paolo Bonzini, 2020/10/12
- [PULL 35/38] scsi/scsi_bus: Add scsi_device_get, Paolo Bonzini, 2020/10/12
- Re: [PULL v2 00/38] SCSI, qdev, qtest, meson patches for 2020-10-10, no-reply, 2020/10/12
- Re: [PULL v2 00/38] SCSI, qdev, qtest, meson patches for 2020-10-10, Peter Maydell, 2020/10/13