Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-28 Thread Mathieu Desnoyers
- On Apr 28, 2016, at 9:47 AM, Yuxin Ren r...@gwmail.gwu.edu wrote: > Hi Boqun and Paul, > > Thank you so much for your help. > > I found one reason to use that lock. > In the slow path, a thread will move all waiters to a local queue. >

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-28 Thread Paul E. McKenney
On Thu, Apr 28, 2016 at 02:38:40PM +, Mathieu Desnoyers wrote: > - On Apr 28, 2016, at 9:47 AM, Yuxin Ren r...@gwmail.gwu.edu wrote: > > > Hi Boqun and Paul, > > > > Thank you so much for your help. > > > > I found one reason to use that lock. > > In the slow path, a thread will move

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-28 Thread Mathieu Desnoyers
- On Apr 28, 2016, at 9:47 AM, Yuxin Ren r...@gwmail.gwu.edu wrote: > Hi Boqun and Paul, > > Thank you so much for your help. > > I found one reason to use that lock. > In the slow path, a thread will move all waiters to a local queue. >

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-28 Thread Paul E. McKenney
On Thu, Apr 28, 2016 at 09:47:23AM -0400, Yuxin Ren wrote: > Hi Boqun and Paul, > > Thank you so much for your help. > > I found one reason to use that lock. > In the slow path, a thread will move all waiters to a local queue. > https://github.com/urcu/userspace-rcu/blob/master/urcu.c#L406 >

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-28 Thread Paul E. McKenney
On Thu, Apr 28, 2016 at 08:44:01PM +0800, Boqun Feng wrote: > Hi Paul and Yuxin, > > On Wed, Apr 27, 2016 at 09:23:27PM -0700, Paul E. McKenney wrote: > > Try building without it and see what happens when you run the tests. > > > > I've run a 'regtest' with the following modification out of

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-28 Thread Yuxin Ren
Hi Boqun and Paul, Thank you so much for your help. I found one reason to use that lock. In the slow path, a thread will move all waiters to a local queue. https://github.com/urcu/userspace-rcu/blob/master/urcu.c#L406 After this, following thread can also perform grace period, as the global

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-28 Thread Boqun Feng
Hi Paul and Yuxin, On Wed, Apr 27, 2016 at 09:23:27PM -0700, Paul E. McKenney wrote: > Try building without it and see what happens when you run the tests. > I've run a 'regtest' with the following modification out of curiousity: diff --git a/urcu.c b/urcu.c index a5568bdbd075..9dc3c9feae56

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-27 Thread Paul E. McKenney
Try building without it and see what happens when you run the tests. Might well be that it is unnecessary, but I will defer to Mathieu on that point. Thanx, Paul On Wed, Apr 27, 2016 at 10:18:04PM -0400, Yuxin Ren wrote: > As they don't

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-27 Thread Yuxin Ren
As they don't currently perform grace period, why do we use the rcu_gp_lock? Thank you. Yuxin On Wed, Apr 27, 2016 at 10:08 PM, Paul E. McKenney wrote: > On Wed, Apr 27, 2016 at 09:34:16PM -0400, Yuxin Ren wrote: >> Hi, >> >> I am learning the URCU code. >> >> Why do

Re: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU

2016-04-27 Thread Paul E. McKenney
On Wed, Apr 27, 2016 at 09:34:16PM -0400, Yuxin Ren wrote: > Hi, > > I am learning the URCU code. > > Why do we need rcu_gp_lock in synchronize_rcu? > https://github.com/urcu/userspace-rcu/blob/master/urcu.c#L401 > > In the comment, it says this lock ensures mutual exclusion between > threads