From mboxrd@z Thu Jan 1 00:00:00 1970 From: compudj@krystal.dyndns.org (Mathieu Desnoyers) Date: Thu, 9 Jun 2011 10:09:09 -0400 Subject: [ltt-dev] [PATCH] call_rcu: keep BUSY flag set as long as possible In-Reply-To: <1307524638-17313-1-git-send-email-pbonzini@redhat.com> References: <1307523558-16960-1-git-send-email-pbonzini@redhat.com> <1307524638-17313-1-git-send-email-pbonzini@redhat.com> Message-ID: * Paolo Bonzini (pbonzini at redhat.com) wrote: > Signed-off-by: Paolo Bonzini > --- > 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); Would this be equivalent to not setting: uatomic_set(&crdp->futex, 0); before breaking the loop, but then not decrementing uatomic_dec(&crdp->futex); at the next loop iteration ? Mathieu > } > while ((cbs = _CMM_LOAD_SHARED(crdp->cbs.head)) == NULL) > poll(NULL, 0, 1); > -- > 1.7.4.4 > > > _______________________________________________ > ltt-dev mailing list > ltt-dev at lists.casi.polymtl.ca > http://lists.casi.polymtl.ca/cgi-bin/mailman/listinfo/ltt-dev > -- Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com