]> git.ipfire.org Git - thirdparty/qemu.git/commit
rcu: Allow calling rcu_(un)register_thread() during synchronize_rcu()
authorWen Congyang <wency@cn.fujitsu.com>
Mon, 27 Jul 2015 02:24:18 +0000 (10:24 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Fri, 14 Aug 2015 21:40:32 +0000 (23:40 +0200)
commitc097a60b100c10d79d8bd5c91ce804e865d7e70b
tree4b202863ce7405d0b3ce148671395c0059d29ddf
parent414b15c909c88e4cf5f10e80d033b3aa90bcc9e1
rcu: Allow calling rcu_(un)register_thread() during synchronize_rcu()

If rcu_(un)register_thread() is called together with synchronize_rcu(),
it will wait for the synchronize_rcu() to finish. But when synchronize_rcu()
waits for some events, we can modify the list registry.
We also use the lock rcu_gp_lock to assume that synchronize_rcu() isn't
executed in more than one thread at the same time. Add a new mutex lock
rcu_sync_lock to assume it and rename rcu_gp_lock to rcu_registry_lock.
Release rcu_registry_lock when synchronize_rcu() waits for some events.

Signed-off-by: Wen Congyang <wency@cn.fujitsu.com>
Message-Id: <55B59652.4090503@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
util/rcu.c