Re: [PATCH v7 06/10] mm: thp: check pmd migration entry in common path

2017-06-21 Thread Zi Yan
On 21 Jun 2017, at 7:49, Kirill A. Shutemov wrote: > On Tue, Jun 20, 2017 at 07:07:11PM -0400, Zi Yan wrote: >> @@ -1220,6 +1238,9 @@ int do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t >> orig_pmd) >> if (unlikely(!pmd_same(*vmf->pmd, orig_pmd))) >> goto out_unlock; >> >> +

Re: [PATCH v7 06/10] mm: thp: check pmd migration entry in common path

2017-06-21 Thread Zi Yan
On 21 Jun 2017, at 7:49, Kirill A. Shutemov wrote: > On Tue, Jun 20, 2017 at 07:07:11PM -0400, Zi Yan wrote: >> @@ -1220,6 +1238,9 @@ int do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t >> orig_pmd) >> if (unlikely(!pmd_same(*vmf->pmd, orig_pmd))) >> goto out_unlock; >> >> +

Re: [PATCH v7 06/10] mm: thp: check pmd migration entry in common path

2017-06-21 Thread Kirill A. Shutemov
On Tue, Jun 20, 2017 at 07:07:11PM -0400, Zi Yan wrote: > @@ -1220,6 +1238,9 @@ int do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t > orig_pmd) > if (unlikely(!pmd_same(*vmf->pmd, orig_pmd))) > goto out_unlock; > > + if (unlikely(!pmd_present(orig_pmd))) > +

Re: [PATCH v7 06/10] mm: thp: check pmd migration entry in common path

2017-06-21 Thread Kirill A. Shutemov
On Tue, Jun 20, 2017 at 07:07:11PM -0400, Zi Yan wrote: > @@ -1220,6 +1238,9 @@ int do_huge_pmd_wp_page(struct vm_fault *vmf, pmd_t > orig_pmd) > if (unlikely(!pmd_same(*vmf->pmd, orig_pmd))) > goto out_unlock; > > + if (unlikely(!pmd_present(orig_pmd))) > +

[PATCH v7 06/10] mm: thp: check pmd migration entry in common path

2017-06-20 Thread Zi Yan
From: Zi Yan If one of callers of page migration starts to handle thp, memory management code start to see pmd migration entry, so we need to prepare for it before enabling. This patch changes various code point which checks the status of given pmds in order to prevent

[PATCH v7 06/10] mm: thp: check pmd migration entry in common path

2017-06-20 Thread Zi Yan
From: Zi Yan If one of callers of page migration starts to handle thp, memory management code start to see pmd migration entry, so we need to prepare for it before enabling. This patch changes various code point which checks the status of given pmds in order to prevent race between thp migration