Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754987AbcKJJWc convert rfc822-to-8bit (ORCPT ); Thu, 10 Nov 2016 04:22:32 -0500 Received: from TYO202.gate.nec.co.jp ([210.143.35.52]:57531 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754955AbcKJJWa (ORCPT ); Thu, 10 Nov 2016 04:22:30 -0500 From: Naoya Horiguchi To: Hillf Danton CC: "linux-mm@kvack.org" , "'Kirill A. Shutemov'" , "'Hugh Dickins'" , "'Andrew Morton'" , "'Dave Hansen'" , "'Andrea Arcangeli'" , "'Mel Gorman'" , "'Michal Hocko'" , "'Vlastimil Babka'" , "'Pavel Emelyanov'" , "'Zi Yan'" , "'Balbir Singh'" , "linux-kernel@vger.kernel.org" , "'Naoya Horiguchi'" , "'Anshuman Khandual'" Subject: Re: [PATCH v2 07/12] mm: thp: check pmd migration entry in common path Thread-Topic: [PATCH v2 07/12] mm: thp: check pmd migration entry in common path Thread-Index: AQHSOVF91G9mSKw0IEiSF7PKRh5xwqDRWmOAgAADwwA= Date: Thu, 10 Nov 2016 09:21:34 +0000 Message-ID: <20161110092134.GD9173@hori1.linux.bs1.fc.nec.co.jp> 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> In-Reply-To: <013801d23b31$f47a7cb0$dd6f7610$@alibaba-inc.com> Accept-Language: en-US, ja-JP Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.128.101.28] Content-Type: text/plain; charset="iso-2022-jp" Content-ID: Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 604 Lines: 20 Hi Hillf, 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. Thanks, Naoya Horiguchi