Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754736AbcKJJfS convert rfc822-to-8bit (ORCPT ); Thu, 10 Nov 2016 04:35:18 -0500 Received: from TYO202.gate.nec.co.jp ([210.143.35.52]:59679 "EHLO tyo202.gate.nec.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297AbcKJJfO (ORCPT ); Thu, 10 Nov 2016 04:35:14 -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: AQHSOVF91G9mSKw0IEiSF7PKRh5xwqDRWmOAgAADwwCAAAHkAIAAAaEA Date: Thu, 10 Nov 2016 09:34:10 +0000 Message-ID: <20161110093410.GA28070@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> <20161110092134.GD9173@hori1.linux.bs1.fc.nec.co.jp> <014b01d23b34$c7a71600$56f54200$@alibaba-inc.com> In-Reply-To: <014b01d23b34$c7a71600$56f54200$@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: <6AA315CD6D56A24E9208831D9CB53163@gisp.nec.co.jp> 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: 883 Lines: 24 On Thu, Nov 10, 2016 at 05:28:20PM +0800, Hillf Danton wrote: > 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. You're right. So we can omit this pmd_present check. Thanks, Naoya Horiguchi