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/04, Peter Zijlstra wrote:
>
> On Thu, Oct 03, 2013 at 11:10:09PM +0200, Oleg Nesterov wrote:
> > On 10/03, Oleg Nesterov wrote:
> > >
> > > So unless Peter objects I'll write the changelogs (always nontrivial task),
> > > test, and send these 2 patches + "add ops->barr() / rcu_sync_wait_for_cb"
> > > tomorrow.
> >
> > And, can't resist, probably another patch below (incomplete, needs the
> > obvious change in cpu.c and the new trivial __complete_locked() helper).
> >
> > Hmm. But when I look at wait_for_completion() I think it is buggy.

No, sorry for noise, it is fine.

> > rcusync: introduce rcu_sync_struct->exclusive mode
>
> What's exclusive to mean? One writer at a time?

Yes,

> Why don't use use the
> waitqueue in exclusive mode and use a single wake_up instead of
> wake_up_all()?

But this won't work, wait_event_exclusive(wq, CONDITION)-like code
obviously can't guarantee that only a single thread sees CONDITION,
even if "unlock" does __wake_up(nr_exclusive => 1).

Of course we can fix this, but wait_for_completion/complete already
does the necessary work: x->done acts as a resource counter which is
always checked/incremented/decremented under the same lock.

Oleg.



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