Re: [patch] futex: Fix v4.6+ ltp futex_wait04 regression

Mike Galbraith
2016-06-06T13:46:12Z

On Mon, 2016-06-06 at 15:34 +0200, Mike Galbraith wrote:
> On Mon, 2016-06-06 at 15:07 +0200, Peter Zijlstra wrote:
>
> > > @@ -654,12 +666,14 @@ get_futex_key(u32 __user *uaddr, int fsh
> > >
> > > > > > > > > key->both.offset |= FUT_OFF_INODE;
> > > /* inode-based key */
> > > > > > > > > key->shared.inode = inode;
> > > -> > > > > > key->shared.pgoff =
> > > basepage_index(page);
> > > +> > > > > > key->shared.pgoff =
> > > basepage_index(pinned);
> >
> > But this seems to be the actual fix;
>
> Yup, the three 'pinned' lines alone work just fine.

I was going by what the code used to look like.

#ifdef CONFIG_TRANSPARENT_HUGEPAGE
...
#else
page_head = compound_head(page);
if (page != page_head) {
get_page(page_head);
put_page(page);
}
#endif

That all went away, but the pinned page that we used in the end was
stable until Mel's optimization landed, leaving me thinking I needed to
do both. Hohum, close but no banana.

-Mike