Re: PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-17 Thread Andrea Arcangeli
On Tue, Dec 17, 2013 at 05:53:35PM +0100, Oleg Nesterov wrote: > On 12/16, Oleg Nesterov wrote: > > > > On 12/16, Andrea Arcangeli wrote: > > > > > > On Mon, Dec 16, 2013 at 07:36:18PM +0100, Oleg Nesterov wrote: > > > > > > > > And compound_lock_irqsave() looks racy even after > > > > get_page_un

Re: PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-17 Thread Oleg Nesterov
On 12/16, Oleg Nesterov wrote: > > On 12/16, Andrea Arcangeli wrote: > > > > On Mon, Dec 16, 2013 at 07:36:18PM +0100, Oleg Nesterov wrote: > > > > > > And compound_lock_irqsave() looks racy even after get_page_unless_zero(). > > > > > > For example, suppose that page_head was already freed and the

Re: PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-16 Thread Oleg Nesterov
On 12/16, Andrea Arcangeli wrote: > > On Mon, Dec 16, 2013 at 07:36:18PM +0100, Oleg Nesterov wrote: > > > > So it seems that put_compound_tail() should also do get/put(head) like > > put_compound_page() does, and this probably means we should factor out > > the common code somehow. > > > > Yes it

Re: PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-16 Thread Andrea Arcangeli
On Mon, Dec 16, 2013 at 07:36:18PM +0100, Oleg Nesterov wrote: > On 12/13, Andrea Arcangeli wrote: > > > > On Fri, Dec 13, 2013 at 05:22:40PM +0100, Oleg Nesterov wrote: > > > > > > I'll try to make v2 based on -mm and your suggestions. > > > > Ok great! > > Yes, it would be great, but I need your

Re: PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-16 Thread Oleg Nesterov
On 12/13, Andrea Arcangeli wrote: > > On Fri, Dec 13, 2013 at 05:22:40PM +0100, Oleg Nesterov wrote: > > > > I'll try to make v2 based on -mm and your suggestions. > > Ok great! Yes, it would be great, but I need your help again ;) Let me quote the pseudo-code you sent me: put_compound_

Re: PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-13 Thread Andrea Arcangeli
On Fri, Dec 13, 2013 at 05:22:40PM +0100, Oleg Nesterov wrote: > Andrea. Thanks a lot for the detailed reply. > > On 12/13, Andrea Arcangeli wrote: > > > > On Wed, Dec 11, 2013 at 08:18:55PM +0100, Oleg Nesterov wrote: > > > > get_huge_page_tail checks different invariants in the VM_BUG_ON and is

Re: PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-13 Thread Oleg Nesterov
Andrea. Thanks a lot for the detailed reply. On 12/13, Andrea Arcangeli wrote: > > On Wed, Dec 11, 2013 at 08:18:55PM +0100, Oleg Nesterov wrote: > > get_huge_page_tail checks different invariants in the VM_BUG_ON and is > only used by gup.c not sure why to call that here. Compared to __get_page_

Re: PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-13 Thread Andrea Arcangeli
On Wed, Dec 11, 2013 at 08:18:55PM +0100, Oleg Nesterov wrote: > --- a/mm/swap.c > +++ b/mm/swap.c > @@ -210,7 +210,7 @@ EXPORT_SYMBOL(put_page); > * This function is exported but must not be called by anything other > * than get_page(). It implements the slow path of get_page(). > */ > -bool

PATCH? introduce get_compound_page (Was: process 'stuck' at exit)

2013-12-11 Thread Oleg Nesterov
On 12/11, Oleg Nesterov wrote: > > On 12/11, Thomas Gleixner wrote: > > > > On Wed, 11 Dec 2013, Oleg Nesterov wrote: > > > > > > I have to admit, I do not understand why we can't avoid this altogether. > > > > > > __get_page_tail() can find the stable ->first_page, why get_futex_key() > > > can't