From mboxrd@z Thu Jan 1 00:00:00 1970 From: pbonzini@redhat.com (Paolo Bonzini) Date: Wed, 8 Jun 2011 10:59:17 +0200 Subject: [ltt-dev] [PATCH 09/10] call_rcu: factor polling from RT and non-RT cases In-Reply-To: <1307523558-16960-1-git-send-email-pbonzini@redhat.com> References: <1307523558-16960-1-git-send-email-pbonzini@redhat.com> Message-ID: <1307523558-16960-10-git-send-email-pbonzini@redhat.com> This has the additional advantage of introducing a small delay before consecutive checks of the list. In case call_rcu is very busy, this and the following patch practically eliminate the difference between the RT and non-RT version. Signed-off-by: Paolo Bonzini --- urcu-call-rcu-impl.h | 7 ++----- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h index 9824515..d8570e3 100644 --- a/urcu-call-rcu-impl.h +++ b/urcu-call-rcu-impl.h @@ -205,6 +205,7 @@ static void *call_rcu_thread(void *arg) thread_call_rcu_data = crdp; for (;;) { for (;;) { + poll(NULL, 0, 10); if (&crdp->cbs.head == _CMM_LOAD_SHARED(crdp->cbs.tail)) { uatomic_and(&crdp->flags, ~URCU_CALL_RCU_BUSY); @@ -237,12 +238,8 @@ static void *call_rcu_thread(void *arg) cmm_smp_mb(); if (uatomic_read(&crdp->flags) & URCU_CALL_RCU_STOP) break; - if (uatomic_read(&crdp->flags) & URCU_CALL_RCU_RT) - poll(NULL, 0, 10); - else { + if ((uatomic_read(&crdp->flags) & URCU_CALL_RCU_RT) == 0) call_rcu_wait(crdp); - poll(NULL, 0, 10); - } } uatomic_or(&crdp->flags, URCU_CALL_RCU_STOPPED); return NULL; -- 1.7.4.4