Re: [RFC, PATCH 1/2] qrcu: "quick" srcu implementation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 30, 2006 at 06:37:57AM +0300, Oleg Nesterov wrote:
> On 11/30, Oleg Nesterov wrote:
> >
> > On 11/29, Paul E. McKenney wrote:
> > >
> > > Hmmm...  Now I am wondering if the memory barriers inherent in the
> > > __wait_event() suffice for this last barrier...  :-/  Thoughts?
> > >
> > > > +	smp_mb();
> >
> > Fastpath skips __wait_event(), and it is possible that the reader does
> > lock/unlock between the first 'mb()' and 'if (atomic_read() == 1)'.
> 
> In fact, a slow path needs (I think) it too. We can have an unrelated
> wakeup, and then the reader does unlock() before we check !atomic_read()
> in the __wait_event()'s loop. The reader removes us from ->wq, in that
> case finish_wait() does nothing.

Good point -- I was forgetting about the fastpath checks in __wait_event().

How about something like this?

	/*
	 * The following memory barrier is needed to perserve ordering
	 * in the case where __wait_event() follows its fastpath,
	 * which includes neither locks nor memory barriers.
	 */

						Thanx, Paul
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux