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

Mathieu Desnoyers compudj at krystal.dyndns.org
Thu Jun 9 10:09:09 EDT 2011


* Paolo Bonzini (pbonzini at redhat.com) wrote:
> 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);

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




More information about the lttng-dev mailing list