Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755020AbcKJJZ2 (ORCPT ); Thu, 10 Nov 2016 04:25:28 -0500 Received: from out4435.biz.mail.alibaba.com ([47.88.44.35]:15609 "EHLO out4435.biz.mail.alibaba.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754818AbcKJJZZ (ORCPT ); Thu, 10 Nov 2016 04:25:25 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03278;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---.79aIibb_1478768887; Reply-To: "Hillf Danton" From: "Hillf Danton" To: "'Naoya Horiguchi'" , Cc: "'Kirill A. Shutemov'" , "'Hugh Dickins'" , "'Andrew Morton'" , "'Dave Hansen'" , "'Andrea Arcangeli'" , "'Mel Gorman'" , "'Michal Hocko'" , "'Vlastimil Babka'" , "'Pavel Emelyanov'" , "'Zi Yan'" , "'Balbir Singh'" , , "'Naoya Horiguchi'" , "'Anshuman Khandual'" References: <1478561517-4317-1-git-send-email-n-horiguchi@ah.jp.nec.com> <1478561517-4317-8-git-send-email-n-horiguchi@ah.jp.nec.com> In-Reply-To: <1478561517-4317-8-git-send-email-n-horiguchi@ah.jp.nec.com> Subject: Re: [PATCH v2 07/12] mm: thp: check pmd migration entry in common path Date: Thu, 10 Nov 2016 17:08:07 +0800 Message-ID: <013801d23b31$f47a7cb0$dd6f7610$@alibaba-inc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQHUTcTjuGtnqU7v9+UBKVUUSuWnDwG2qRyooMAPTRA= Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 894 Lines: 27 On Tuesday, November 08, 2016 7:32 AM Naoya Horiguchi wrote: > > @@ -1013,6 +1027,9 @@ int do_huge_pmd_wp_page(struct fault_env *fe, pmd_t orig_pmd) > if (unlikely(!pmd_same(*fe->pmd, orig_pmd))) > goto out_unlock; > > + if (unlikely(!pmd_present(orig_pmd))) > + goto out_unlock; > + Can we encounter a migration entry after acquiring ptl ? > page = pmd_page(orig_pmd); > VM_BUG_ON_PAGE(!PageCompound(page) || !PageHead(page), page); > /* [...] > @@ -3591,6 +3591,10 @@ static int __handle_mm_fault(struct vm_area_struct *vma, unsigned long address, > int ret; > > barrier(); > + if (unlikely(is_pmd_migration_entry(orig_pmd))) { > + pmd_migration_entry_wait(mm, fe.pmd); > + return 0; > + } > if (pmd_trans_huge(orig_pmd) || pmd_devmap(orig_pmd)) { > if (pmd_protnone(orig_pmd) && vma_is_accessible(vma)) > return do_huge_pmd_numa_page(&fe, orig_pmd);