lkml.org 
[lkml]   [2013]   [Oct]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/3] rcu: Create rcu_sync infrastructure
On 10/03, Paul E. McKenney wrote:
>
> On Thu, Oct 03, 2013 at 11:10:09PM +0200, Oleg Nesterov wrote:
> >
> > rcusync: introduce rcu_sync_struct->exclusive mode
> >
> > CHANGELOG.
>
> Should the changelog really be in all caps? (Sorry, couldn't resist...)

Apparently you do not realize it is going to be an EXCELLENT changelog!

> > @@ -53,9 +55,13 @@ void rcu_sync_enter(struct rcu_sync_struct *rss)
> > if (need_sync) {
> > rss->ops->sync();
> > rss->gp_state = GP_PASSED;
> > - wake_up_all(&rss->gp_wait);
> > + if (!rss->exclusive)
> > + wake_up_all(&rss->gp_comp.wait);
>
> Not sure about the wake_up_all() on a completion,

Yes, we reuse completion->wait in the !exclusive case. Like we reuse
its spinlock as rss_lock.

We can add a completion/complete union, but this will complicate the
code a bit and imo doesn't make sense.

> but if we are exclusive,
> don't we need to complete() the completion here?

No, if we are exclusive we should delay the "wake up the next writer"
till rcu_sync_exit().

> Oh, I guess gp_comp.wait is exactly a wait_queue_head_t, so I guess
> you can do wake_up_all() on it...

Yes, and we never "mix" completion/wait_queue_head_t operations/members.
IOW, we always use ->gp_comp if "exclusive", and only ->gp_comp.wait is
used otherwise.

> Never mind!!!

Agreed ;)

Oleg.



\
 
 \ /
  Last update: 2013-10-04 14:01    [W:0.199 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site