Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932466AbcKJJac (ORCPT ); Thu, 10 Nov 2016 04:30:32 -0500 Received: from out0-142.mail.aliyun.com ([140.205.0.142]:57285 "EHLO out0-142.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753880AbcKJJaG (ORCPT ); Thu, 10 Nov 2016 04:30:06 -0500 X-Greylist: delayed 1220 seconds by postgrey-1.27 at vger.kernel.org; Thu, 10 Nov 2016 04:29:01 EST X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R671e4;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e02c03301;MF=hillf.zj@alibaba-inc.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---.79aIjTm_1478770100; 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> <013801d23b31$f47a7cb0$dd6f7610$@alibaba-inc.com> <20161110092134.GD9173@hori1.linux.bs1.fc.nec.co.jp> In-Reply-To: <20161110092134.GD9173@hori1.linux.bs1.fc.nec.co.jp> Subject: Re: [PATCH v2 07/12] mm: thp: check pmd migration entry in common path Date: Thu, 10 Nov 2016 17:28:20 +0800 Message-ID: <014b01d23b34$c7a71600$56f54200$@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+UBKVUUSuWnDwG2qRyoAcdrSEQChlbctaCdqZpg Content-Language: zh-cn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 706 Lines: 18 On Thursday, November 10, 2016 5:22 PM Naoya Horiguchi wrote: > On Thu, Nov 10, 2016 at 05:08:07PM +0800, Hillf Danton wrote: > > 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 ? > > I think we can. thp migration code releases ptl after converting pmd into > migration entry, so other code can see it even within ptl. > But we have a pmd_same check there, you see.