[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/21] rcu: do not let RCU callbacks pile up indefini
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PULL 07/21] rcu: do not let RCU callbacks pile up indefinitely |
Date: |
Mon, 16 Feb 2015 19:17:48 +0100 |
Always process them within a short time. Even though waiting a little
is useful, it is not okay to delay e.g. qemu_opts_del forever.
Reviewed-by: Michael Roth <address@hidden>
Tested-by: Michael Roth <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
util/rcu.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/util/rcu.c b/util/rcu.c
index c9c3e6e..486d7b6 100644
--- a/util/rcu.c
+++ b/util/rcu.c
@@ -223,14 +223,16 @@ static void *call_rcu_thread(void *opaque)
* Fetch rcu_call_count now, we only must process elements that were
* added before synchronize_rcu() starts.
*/
- while (n < RCU_CALL_MIN_SIZE && ++tries <= 5) {
- g_usleep(100000);
- qemu_event_reset(&rcu_call_ready_event);
- n = atomic_read(&rcu_call_count);
- if (n < RCU_CALL_MIN_SIZE) {
- qemu_event_wait(&rcu_call_ready_event);
+ while (n == 0 || (n < RCU_CALL_MIN_SIZE && ++tries <= 5)) {
+ g_usleep(10000);
+ if (n == 0) {
+ qemu_event_reset(&rcu_call_ready_event);
n = atomic_read(&rcu_call_count);
+ if (n == 0) {
+ qemu_event_wait(&rcu_call_ready_event);
+ }
}
+ n = atomic_read(&rcu_call_count);
}
atomic_sub(&rcu_call_count, n);
--
2.3.0
- [Qemu-devel] [PULL 00/21] SCSI, RCU, KVM changes for 2015-02-16, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 02/21] qdev: support to get a device firmware path directly, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 03/21] vhost-scsi: add bootindex property, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 04/21] vhost-scsi: expose the TYPE_FW_PATH_PROVIDER interface, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 06/21] vhost-scsi: set the bootable value of channel/target/lun, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 07/21] rcu: do not let RCU callbacks pile up indefinitely,
Paolo Bonzini <=
- [Qemu-devel] [PULL 05/21] vhost-scsi: add a property for booting, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 01/21] kvm_stat: Add kvm_exit reasons for aarch64, Paolo Bonzini, 2015/02/16
- [Qemu-devel] [PULL 08/21] rcu: run RCU callbacks under the BQL, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 10/21] pcie: remove mmconfig memory leak and wrap mmconfig update with transaction, Paolo Bonzini, 2015/02/16
[Qemu-devel] [PULL 11/21] pci: split shpc_cleanup and shpc_free, Paolo Bonzini, 2015/02/16