[ltt-dev] [PATCH] call_rcu: keep BUSY flag set as long as possible

Paolo Bonzini pbonzini at redhat.com
Wed Jun 8 05:17:18 EDT 2011


Signed-off-by: Paolo Bonzini <pbonzini at redhat.com>
---
        Not a correctness issue, and it will just save a syscall in
        rare cases.  Can be committed separately, or squashed in patch 8
        (that would be my favorite option), or left out altogether.

 urcu-call-rcu-impl.h |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/urcu-call-rcu-impl.h b/urcu-call-rcu-impl.h
index 165956e..c45928a 100644
--- a/urcu-call-rcu-impl.h
+++ b/urcu-call-rcu-impl.h
@@ -214,6 +214,9 @@ static void *call_rcu_thread(void *arg)
 				if (&crdp->cbs.head
 				    == _CMM_LOAD_SHARED(crdp->cbs.tail))
 					break;
+                                /* False alarm... another bunch is ready.  */
+				cmm_smp_mb();
+				uatomic_or(&crdp->flags, URCU_CALL_RCU_BUSY);
 			}
 			while ((cbs = _CMM_LOAD_SHARED(crdp->cbs.head)) == NULL)
 				poll(NULL, 0, 1);
-- 
1.7.4.4





More information about the lttng-dev mailing list