]> git.ipfire.org Git - thirdparty/qemu.git/commit
system/qdev-monitor: move drain_call_rcu call under if (!dev) in qmp_device_add()
authorDmitrii Gavrilov <ds-gavr@yandex-team.ru>
Fri, 3 Nov 2023 10:56:02 +0000 (13:56 +0300)
committerMichael Tokarev <mjt@tls.msk.ru>
Sun, 10 Mar 2024 09:25:05 +0000 (12:25 +0300)
commit5dc46b3ff8d178a3498b6ad8b42ee8f93681e0e8
tree37a1e366a3e68419af26edb772f754aece958b84
parent4db93405e5a99fde1ec9c91f86510b12858f92d8
system/qdev-monitor: move drain_call_rcu call under if (!dev) in qmp_device_add()

Original goal of addition of drain_call_rcu to qmp_device_add was to cover
the failure case of qdev_device_add. It seems call of drain_call_rcu was
misplaced in 7bed89958bfbf40df what led to waiting for pending RCU callbacks
under happy path too. What led to overall performance degradation of
qmp_device_add.

In this patch call of drain_call_rcu moved under handling of failure of
qdev_device_add.

Signed-off-by: Dmitrii Gavrilov <ds-gavr@yandex-team.ru>
Message-ID: <20231103105602.90475-1-ds-gavr@yandex-team.ru>
Fixes: 7bed89958bf ("device_core: use drain_call_rcu in in qmp_device_add", 2020-10-12)
Cc: qemu-stable@nongnu.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
(cherry picked from commit 012b170173bcaa14b9bc26209e0813311ac78489)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
system/qdev-monitor.c