From: ryx@gwmail.gwu.edu (Yuxin Ren)
Subject: [lttng-dev] Question about lock in synchronize_rcu implementation of URCU
Date: Wed, 27 Apr 2016 22:18:04 -0400 [thread overview]
Message-ID: <CAAKbDrfRMKzu6brHG=pfm0mu_Oy1afVZ94zDCiN7Y0w5o+SMZQ@mail.gmail.com> (raw)
In-Reply-To: <20160428020803.GN4967@linux.vnet.ibm.com>
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
<paulmck at linux.vnet.ibm.com> wrote:
> 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 calling synchronize_rcu().
>> But only the first thread added to waiter queue can proceed to detect
>> grace period.
>> How can multiple threads currently perform the grace thread?
>
> They don't concurrently perform grace periods, and it would be wasteful
> for them to do so. Instead, the first one performs the grace period,
> and all that were waiting at the time it started get the benefit of that
> same grace period.
>
> Any that arrived after the first grace period performs the first
> grace period are served by whichever of them performs the second
> grace period.
>
> Thanx, Paul
>
next prev parent reply other threads:[~2016-04-28 2:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-28 1:34 Yuxin Ren
2016-04-28 2:08 ` Paul E. McKenney
2016-04-28 2:18 ` Yuxin Ren [this message]
2016-04-28 4:23 ` Paul E. McKenney
2016-04-28 12:44 ` Boqun Feng
2016-04-28 13:47 ` Yuxin Ren
2016-04-28 13:55 ` Paul E. McKenney
2016-04-28 14:38 ` Mathieu Desnoyers
2016-04-28 14:57 ` Paul E. McKenney
2016-04-28 16:08 ` Mathieu Desnoyers
2016-04-28 13:53 ` Paul E. McKenney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAAKbDrfRMKzu6brHG=pfm0mu_Oy1afVZ94zDCiN7Y0w5o+SMZQ@mail.gmail.com' \
--to=ryx@gwmail.gwu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox