Re: [PATCH v3 2/6] mm/hugetlb: take page table lock in follow_huge_(addr|pmd|pud)()

2014-09-30 Thread Kirill A. Shutemov
On Mon, Sep 08, 2014 at 12:13:16AM -0700, Hugh Dickins wrote: > > > One subtlety to take care over: it's a long time since I've had to > > > worry about pmd folding and pud folding (what happens when you only > > > have 2 or 3 levels of page table instead of the full 4): macros get > > > defined to

Re: [PATCH v3 2/6] mm/hugetlb: take page table lock in follow_huge_(addr|pmd|pud)()

2014-09-09 Thread Hugh Dickins
On Mon, 8 Sep 2014, Naoya Horiguchi wrote: > On Mon, Sep 08, 2014 at 12:13:16AM -0700, Hugh Dickins wrote: > > On Fri, 5 Sep 2014, Naoya Horiguchi wrote: > > > On Wed, Sep 03, 2014 at 02:17:41PM -0700, Hugh Dickins wrote: > > > > > > > One subtlety to take care over: it's a long time since I've ha

Re: [PATCH v3 2/6] mm/hugetlb: take page table lock in follow_huge_(addr|pmd|pud)()

2014-09-08 Thread Naoya Horiguchi
On Mon, Sep 08, 2014 at 12:13:16AM -0700, Hugh Dickins wrote: > On Fri, 5 Sep 2014, Naoya Horiguchi wrote: > > On Wed, Sep 03, 2014 at 02:17:41PM -0700, Hugh Dickins wrote: > > > On Thu, 28 Aug 2014, Naoya Horiguchi wrote: > > > > > > > > Reported-by: Hugh Dickins > > > > Signed-off-by: Naoya Hor

Re: [PATCH v3 2/6] mm/hugetlb: take page table lock in follow_huge_(addr|pmd|pud)()

2014-09-08 Thread Hugh Dickins
On Fri, 5 Sep 2014, Naoya Horiguchi wrote: > On Wed, Sep 03, 2014 at 02:17:41PM -0700, Hugh Dickins wrote: > > On Thu, 28 Aug 2014, Naoya Horiguchi wrote: > > > > > > Reported-by: Hugh Dickins > > > Signed-off-by: Naoya Horiguchi > > > Cc: # [3.12+] > > > > No ack to this one yet, I'm afraid.

Re: [PATCH v3 2/6] mm/hugetlb: take page table lock in follow_huge_(addr|pmd|pud)()

2014-09-04 Thread Naoya Horiguchi
Hi Hugh, Thank you very much for you close looking and valuable comments. And I can't help feeling shame on many mistakes/misunderstandings and lack of thoughts throughout the patchset. I promise that all these will be fixed in the next version. On Wed, Sep 03, 2014 at 02:17:41PM -0700, Hugh Dick

Re: [PATCH v3 2/6] mm/hugetlb: take page table lock in follow_huge_(addr|pmd|pud)()

2014-09-03 Thread Hugh Dickins
On Thu, 28 Aug 2014, Naoya Horiguchi wrote: > We have a race condition between move_pages() and freeing hugepages, > where move_pages() calls follow_page(FOLL_GET) for hugepages internally > and tries to get its refcount without preventing concurrent freeing. > This race crashes the kernel, so thi

[PATCH v3 2/6] mm/hugetlb: take page table lock in follow_huge_(addr|pmd|pud)()

2014-08-28 Thread Naoya Horiguchi
We have a race condition between move_pages() and freeing hugepages, where move_pages() calls follow_page(FOLL_GET) for hugepages internally and tries to get its refcount without preventing concurrent freeing. This race crashes the kernel, so this patch fixes it by moving FOLL_GET code for hugepage