qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>, qemu-devel@nongnu.org
Cc: Stefan Hajnoczi <stefanha@redhat.com>,
	Maxim Levitsky <mlevitsk@redhat.com>
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	[thread overview]
Message-ID: <c55d660e-e650-6470-f14c-acba6a085e74@redhat.com> (raw)
In-Reply-To: <20201012203343.1105018-32-pbonzini@redhat.com>

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



  reply	other threads:[~2020-10-27 19:36 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-12 20:33 [PULL v2 00/38] SCSI, qdev, qtest, meson patches for 2020-10-10 Paolo Bonzini
2020-10-12 20:33 ` [PULL 01/38] meson.build: Add comments to clarify code organization Paolo Bonzini
2020-10-12 20:33 ` [PULL 02/38] meson.build: Sort sourcesets alphabetically Paolo Bonzini
2020-10-12 20:33 ` [PULL 03/38] hw/core: Move the creation of the library to the main meson.build Paolo Bonzini
2020-10-12 20:33 ` [PULL 04/38] chardev: " Paolo Bonzini
2020-10-12 20:33 ` [PULL 05/38] migration: " Paolo Bonzini
2020-10-12 20:33 ` [PULL 06/38] io: " Paolo Bonzini
2020-10-12 20:33 ` [PULL 07/38] crypto: " Paolo Bonzini
2020-10-12 20:33 ` [PULL 08/38] authz: " Paolo Bonzini
2020-10-12 20:33 ` [PULL 09/38] qom: " Paolo Bonzini
2020-10-12 20:33 ` [PULL 10/38] hw/nvram: Always register FW_CFG_DATA_GENERATOR_INTERFACE Paolo Bonzini
2020-10-12 20:33 ` [PULL 11/38] softmmu: move more files to softmmu/ Paolo Bonzini
2020-10-12 20:33 ` [PULL 12/38] exec: split out non-softmmu-specific parts Paolo Bonzini
2020-10-12 20:33 ` [PULL 13/38] qom: fix objects with improper parent type Paolo Bonzini
2020-10-12 20:33 ` [PULL 14/38] docs: Move QTest documentation to its own document Paolo Bonzini
2020-10-12 20:33 ` [PULL 15/38] docs/devel/qtest: Include protocol spec in document Paolo Bonzini
2020-10-12 20:33 ` [PULL 16/38] docs/devel/qtest: Include libqtest API reference Paolo Bonzini
2020-10-12 20:33 ` [PULL 17/38] qtest: unify extra_qtest_srcs and extra_qtest_deps Paolo Bonzini
2020-10-12 20:33 ` [PULL 18/38] docs/devel: update instruction on how to add new unit tests Paolo Bonzini
2020-10-12 20:33 ` [PULL 19/38] build-sys: fix git version from -version Paolo Bonzini
2020-10-12 20:33 ` [PULL 20/38] meson.build: Re-enable KVM support for MIPS Paolo Bonzini
2020-10-12 20:33 ` [PULL 21/38] qtest: rename qtest_qmp_receive to qtest_qmp_receive_dict Paolo Bonzini
2020-10-12 20:33 ` [PULL 22/38] qtest: Reintroduce qtest_qmp_receive with QMP event buffering Paolo Bonzini
2020-10-12 20:33 ` [PULL 23/38] qtest: remove qtest_qmp_receive_success Paolo Bonzini
2020-10-12 20:33 ` [PULL 24/38] device-plug-test: use qtest_qmp to send the device_del command Paolo Bonzini
2020-10-12 20:33 ` [PULL 25/38] qtest: switch users back to qtest_qmp_receive Paolo Bonzini
2020-10-12 20:33 ` [PULL 26/38] qtest: check that drives are really appearing and disappearing Paolo Bonzini
2020-10-12 20:33 ` [PULL 27/38] qemu-iotests, qtest: rewrite test 067 as a qtest Paolo Bonzini
2020-10-12 20:33 ` [PULL 28/38] qdev: add "check if address free" callback for buses Paolo Bonzini
2020-10-12 20:33 ` [PULL 29/38] scsi/scsi_bus: switch search direction in scsi_device_find Paolo Bonzini
2020-10-12 20:33 ` [PULL 30/38] device_core: use drain_call_rcu in in qmp_device_add Paolo Bonzini
2020-10-12 20:33 ` [PULL 31/38] device-core: use RCU for list of children of a bus Paolo Bonzini
2020-10-27 19:34   ` Eric Blake [this message]
2020-10-27 19:48     ` Paolo Bonzini
2020-10-12 20:33 ` [PULL 32/38] scsi: switch to bus->check_address Paolo Bonzini
2020-10-12 20:33 ` [PULL 33/38] device-core: use atomic_set on .realized property Paolo Bonzini
2020-10-12 20:33 ` [PULL 34/38] scsi/scsi-bus: scsi_device_find: don't return unrealized devices Paolo Bonzini
2020-10-12 20:33 ` [PULL 35/38] scsi/scsi_bus: Add scsi_device_get Paolo Bonzini
2020-10-12 20:33 ` [PULL 36/38] virtio-scsi: use scsi_device_get Paolo Bonzini
2020-10-12 20:33 ` [PULL 37/38] scsi/scsi_bus: fix races in REPORT LUNS Paolo Bonzini
2020-10-12 20:33 ` [PULL 38/38] meson: identify more sections of meson.build Paolo Bonzini
2020-10-12 21:09 ` [PULL v2 00/38] SCSI, qdev, qtest, meson patches for 2020-10-10 no-reply
2020-10-13 10:45 ` Peter Maydell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c55d660e-e650-6470-f14c-acba6a085e74@redhat.com \
    --to=eblake@redhat.com \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).