Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-06-09 Thread Vlastimil Babka
On 05/23/2017 02:42 PM, Vlastimil Babka wrote: > On 05/16/2017 10:29 PM, Andrea Arcangeli wrote: >> On Wed, Apr 12, 2017 at 03:33:35PM +0200, Vlastimil Babka wrote: >>> >>> pmdp_invalidate() does: >>> >>> pmd_t entry = *pmdp; >>> set_pmd_at(vma->vm_mm, address, pmdp,

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-06-09 Thread Vlastimil Babka
On 05/23/2017 02:42 PM, Vlastimil Babka wrote: > On 05/16/2017 10:29 PM, Andrea Arcangeli wrote: >> On Wed, Apr 12, 2017 at 03:33:35PM +0200, Vlastimil Babka wrote: >>> >>> pmdp_invalidate() does: >>> >>> pmd_t entry = *pmdp; >>> set_pmd_at(vma->vm_mm, address, pmdp,

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-05-23 Thread Vlastimil Babka
On 05/16/2017 10:29 PM, Andrea Arcangeli wrote: > On Wed, Apr 12, 2017 at 03:33:35PM +0200, Vlastimil Babka wrote: >> >> pmdp_invalidate() does: >> >> pmd_t entry = *pmdp; >> set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(entry)); >> >> so it's not atomic and if CPU sets

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-05-23 Thread Vlastimil Babka
On 05/16/2017 10:29 PM, Andrea Arcangeli wrote: > On Wed, Apr 12, 2017 at 03:33:35PM +0200, Vlastimil Babka wrote: >> >> pmdp_invalidate() does: >> >> pmd_t entry = *pmdp; >> set_pmd_at(vma->vm_mm, address, pmdp, pmd_mknotpresent(entry)); >> >> so it's not atomic and if CPU sets

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-05-16 Thread Andrea Arcangeli
On Wed, Apr 12, 2017 at 03:33:35PM +0200, Vlastimil Babka wrote: > On 03/02/2017 04:10 PM, Kirill A. Shutemov wrote: > > In case prot_numa, we are under down_read(mmap_sem). It's critical > > to not clear pmd intermittently to avoid race with MADV_DONTNEED > > which is also under

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-05-16 Thread Andrea Arcangeli
On Wed, Apr 12, 2017 at 03:33:35PM +0200, Vlastimil Babka wrote: > On 03/02/2017 04:10 PM, Kirill A. Shutemov wrote: > > In case prot_numa, we are under down_read(mmap_sem). It's critical > > to not clear pmd intermittently to avoid race with MADV_DONTNEED > > which is also under

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-05-16 Thread Vlastimil Babka
On 04/12/2017 03:33 PM, Vlastimil Babka wrote: > On 03/02/2017 04:10 PM, Kirill A. Shutemov wrote: >> In case prot_numa, we are under down_read(mmap_sem). It's critical >> to not clear pmd intermittently to avoid race with MADV_DONTNEED >> which is also under down_read(mmap_sem): >> >> CPU0:

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-05-16 Thread Vlastimil Babka
On 04/12/2017 03:33 PM, Vlastimil Babka wrote: > On 03/02/2017 04:10 PM, Kirill A. Shutemov wrote: >> In case prot_numa, we are under down_read(mmap_sem). It's critical >> to not clear pmd intermittently to avoid race with MADV_DONTNEED >> which is also under down_read(mmap_sem): >> >> CPU0:

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-04-12 Thread Vlastimil Babka
On 03/02/2017 04:10 PM, Kirill A. Shutemov wrote: > In case prot_numa, we are under down_read(mmap_sem). It's critical > to not clear pmd intermittently to avoid race with MADV_DONTNEED > which is also under down_read(mmap_sem): > > CPU0: CPU1: >

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-04-12 Thread Vlastimil Babka
On 03/02/2017 04:10 PM, Kirill A. Shutemov wrote: > In case prot_numa, we are under down_read(mmap_sem). It's critical > to not clear pmd intermittently to avoid race with MADV_DONTNEED > which is also under down_read(mmap_sem): > > CPU0: CPU1: >

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-03-03 Thread Dave Hansen
On 03/02/2017 07:10 AM, Kirill A. Shutemov wrote: > @@ -1744,7 +1744,39 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t > *pmd, > if (prot_numa && pmd_protnone(*pmd)) > goto unlock; > > - entry = pmdp_huge_get_and_clear_notify(mm, addr, pmd); Are there any

Re: [PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-03-03 Thread Dave Hansen
On 03/02/2017 07:10 AM, Kirill A. Shutemov wrote: > @@ -1744,7 +1744,39 @@ int change_huge_pmd(struct vm_area_struct *vma, pmd_t > *pmd, > if (prot_numa && pmd_protnone(*pmd)) > goto unlock; > > - entry = pmdp_huge_get_and_clear_notify(mm, addr, pmd); Are there any

[PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-03-02 Thread Kirill A. Shutemov
In case prot_numa, we are under down_read(mmap_sem). It's critical to not clear pmd intermittently to avoid race with MADV_DONTNEED which is also under down_read(mmap_sem): CPU0: CPU1: change_huge_pmd(prot_numa=1)

[PATCH 2/4] thp: fix MADV_DONTNEED vs. numa balancing race

2017-03-02 Thread Kirill A. Shutemov
In case prot_numa, we are under down_read(mmap_sem). It's critical to not clear pmd intermittently to avoid race with MADV_DONTNEED which is also under down_read(mmap_sem): CPU0: CPU1: change_huge_pmd(prot_numa=1)