rcu: optimize rcu_read_lock
commitf6d153f1bfc7839555309c6e090c6f20c1ce3c0e
authorPaolo Bonzini <pbonzini@redhat.com>
Wed, 16 Dec 2015 11:32:22 +0000 (16 12:32 +0100)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 17 Dec 2015 16:33:49 +0000 (17 17:33 +0100)
tree5599236dbba4c51850a0db71bfa818dbfdfd388f
parent3cc8f884996584630734a90c9b3c535af81e3c92
rcu: optimize rcu_read_lock

rcu_read_lock cannot change rcu_gp_ongoing from true to false
(the previous value of p_rcu_reader->ctr is zero), hence
there is no need to check p_rcu_reader->waiting and wake up
a concurrent synchronize_rcu.

While at it mark the wakeup as unlikely in rcu_read_unlock.

Reviewed-by: Wen Congyang <wency@cn.fujitsu.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Message-Id: <1450265542-4323-1-git-send-email-pbonzini@redhat.com>
include/qemu/rcu.h