mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
rcu: run RCU callbacks under the BQL
This needs to go away sooner or later, but one complication is the complex VFIO data structures that are modified in instance_finalize. Take a shortcut for now. Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Tested-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
a7d1d63679
commit
a464982499
2 changed files with 6 additions and 1 deletions
|
@ -35,6 +35,7 @@
|
|||
#include "qemu/rcu.h"
|
||||
#include "qemu/atomic.h"
|
||||
#include "qemu/thread.h"
|
||||
#include "qemu/main-loop.h"
|
||||
|
||||
/*
|
||||
* Global grace period counter. Bit 0 is always one in rcu_gp_ctr.
|
||||
|
@ -237,20 +238,24 @@ static void *call_rcu_thread(void *opaque)
|
|||
|
||||
atomic_sub(&rcu_call_count, n);
|
||||
synchronize_rcu();
|
||||
qemu_mutex_lock_iothread();
|
||||
while (n > 0) {
|
||||
node = try_dequeue();
|
||||
while (!node) {
|
||||
qemu_mutex_unlock_iothread();
|
||||
qemu_event_reset(&rcu_call_ready_event);
|
||||
node = try_dequeue();
|
||||
if (!node) {
|
||||
qemu_event_wait(&rcu_call_ready_event);
|
||||
node = try_dequeue();
|
||||
}
|
||||
qemu_mutex_lock_iothread();
|
||||
}
|
||||
|
||||
n--;
|
||||
node->func(node);
|
||||
}
|
||||
qemu_mutex_unlock_iothread();
|
||||
}
|
||||
abort();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue