Re: [PATCH] mm: Respect FOLL_FORCE/FOLL_COW for thp

2017-01-11 Thread Kirill A. Shutemov
On Tue, Jan 10, 2017 at 11:06:10PM -0800, Hugh Dickins wrote: > On Tue, 10 Jan 2017, Hugh Dickins wrote: > > On Thu, 5 Jan 2017, Kirill A. Shutemov wrote: > > > On Thu, Jan 05, 2017 at 12:36:58AM -0500, Keno Fischer wrote: > > > > struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned

Re: [PATCH] mm: Respect FOLL_FORCE/FOLL_COW for thp

2017-01-10 Thread Hugh Dickins
On Tue, 10 Jan 2017, Hugh Dickins wrote: > On Thu, 5 Jan 2017, Kirill A. Shutemov wrote: > > On Thu, Jan 05, 2017 at 12:36:58AM -0500, Keno Fischer wrote: > > > struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long > > > addr, > > > pmd_t *pmd, int flags) > > > { > >

Re: [PATCH] mm: Respect FOLL_FORCE/FOLL_COW for thp

2017-01-10 Thread Hugh Dickins
On Thu, 5 Jan 2017, Kirill A. Shutemov wrote: > On Thu, Jan 05, 2017 at 12:36:58AM -0500, Keno Fischer wrote: > > struct page *follow_devmap_pmd(struct vm_area_struct *vma, unsigned long > > addr, > > pmd_t *pmd, int flags) > > { > > @@ -783,7 +793,7 @@ struct page *follow_devmap_pmd

Re: [PATCH] mm: Respect FOLL_FORCE/FOLL_COW for thp

2017-01-05 Thread Keno Fischer
>> @@ -783,7 +793,7 @@ struct page *follow_devmap_pmd(struct vm_area_struct >> *vma, unsigned long addr, >> >> assert_spin_locked(pmd_lockptr(mm, pmd)); >> >> - if (flags & FOLL_WRITE && !pmd_write(*pmd)) >> + if (flags & FOLL_WRITE && !can_follow_write_pmd(*pmd, flags)) >>

Re: [PATCH] mm: Respect FOLL_FORCE/FOLL_COW for thp

2017-01-05 Thread Kirill A. Shutemov
On Thu, Jan 05, 2017 at 12:36:58AM -0500, Keno Fischer wrote: > In 19be0eaff ("mm: remove gup_flags FOLL_WRITE games from > __get_user_pages()"), > the mm code was changed from unsetting FOLL_WRITE after a COW was resolved to > setting the (newly introduced) FOLL_COW instead. Simultaneously, the c

[PATCH] mm: Respect FOLL_FORCE/FOLL_COW for thp

2017-01-04 Thread Keno Fischer
In 19be0eaff ("mm: remove gup_flags FOLL_WRITE games from __get_user_pages()"), the mm code was changed from unsetting FOLL_WRITE after a COW was resolved to setting the (newly introduced) FOLL_COW instead. Simultaneously, the check in gup.c was updated to still allow writes with FOLL_FORCE set if