lkml.org 
[lkml]   [2016]   [Feb]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v5] futex: Remove requirement for lock_page in get_futex_key
On Thu, 4 Feb 2016, Davidlohr Bueso wrote:

> On Thu, 04 Feb 2016, Thomas Gleixner wrote:
>
> > On Wed, 3 Feb 2016, Davidlohr Bueso wrote:
> > > + * We are not calling into get_futex_key_refs() in file-backed
> > > + * cases, therefore a successful atomic_inc return below will
> > > + * guarantee that get_futex_key() will continue to imply MB
> > > (B).
> >
> > Can you please make that "MB (B)" part a bit more outstanding. I really had
> > to
> > search for it.
>
> Hmm as you know this is mostly explained at the begining of the file, and we
> sprinkle MB (B) around the code based on that description. So I'm a bit
> confused
> as to why you don't like like that comment.

The other "MB (B)" places are more outstanding. It did not spring in my eye
immideately. So it's a pure cosmetic issue.

> > > + */
> > > + if (WARN_ON_ONCE(!atomic_inc_not_zero(&inode->i_count))) {
> > > + rcu_read_unlock();
> > > + put_page(page);
> > > +
> > > + goto again;
> > > + }
> >
> > Don't we need
> >
> > smp_mb__after_atomic();
> >
> > here to make it a full barrier on all architectures?
>
> I had this initially but, as Peter mentioned, we get that barrier with the
> successful atomic_inc_not_zero call anyway. Or is it something else you had
> in mind?

Oh. I missed that comment from Peter. And yes, I missed that
atomic_inc_not_zero() already has the barrier in the success case. :(

Thanks,

tglx

\
 
 \ /
  Last update: 2016-02-04 19:21    [W:1.038 / U:0.608 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site