Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp4904247imm; Tue, 9 Oct 2018 07:00:03 -0700 (PDT) X-Google-Smtp-Source: ACcGV61XyWGyt4WM+tZT+icD1Omk+MO/E38oRMdImyYzUbOgTgGD+CRdw1aVCM2BoeaCnYFyq18r X-Received: by 2002:a17:902:32c3:: with SMTP id z61-v6mr28578116plb.324.1539093603606; Tue, 09 Oct 2018 07:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539093603; cv=none; d=google.com; s=arc-20160816; b=0w0Vw51gIt9um05xlXd3oj9bZ8LzhBAThAgX1HBHLJfOEJ3Ima+kTNzJtWljAsssqW eCvIKgAe8o4gDQizECG9nJGxXOg9LRxnq6HatA/jNFzkH/swr3RjASy9RkkadbhlubSZ pxVkQmWNS0Eg8XEcobKvlTj2FogxZq5tzZpTGNQI6oL4eX/h5zFyj6YWeg+U23IkM10c 9wlwl/JkaeChywNfcL0nK5vEscvtgLTWdoVtj/lI8XeXmRtl3hUVXxpyLqAHhbG01Ggx tc3X4g9reED5Sc5qkA7Jzz2N1m4LoJeRQTdQC/ZeeFtp0XDZ6Zo9aPZKs64gaS7HbAg/ riUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=xjWs20RU0HrI89lsHaEBcr1iR8tVkybbvwIIXjr3tIQ=; b=WYcPQ9VjmN53dOfXFloP6Z+Mcvp9OZ0yWCeBoQFYSnaORxF2yrZ7dGeH0s3caoyeTr zeSibtQx8FgjM2ZG8moAOd18o6KNjJM6uCPxU3PKcArRfyQmviWwQLVQxPG5RtGYVljv ZstUp/c7JZ/+FO4Ynwyz4yHMRKNV+jKkRK5xpyQGjdchBD9R4Ss9WUEBtpu+U0nOqLiG okZkrIp9xbZnhxs3fbmk2N9O08jfvvZza+hVND4Ve8I4Z5ZfsLQDQcdq3a+UP6t5nm8W EfYMV6rOFGKXxigsji+QRROsDpGaNG4uyke3mpdylrlLsIEYM6XVh1mSwc0PrrXpcSFj Telg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16-v6si17940842pgd.555.2018.10.09.06.59.48; Tue, 09 Oct 2018 07:00:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbeJIVPr (ORCPT + 99 others); Tue, 9 Oct 2018 17:15:47 -0400 Received: from mail-qt1-f178.google.com ([209.85.160.178]:38607 "EHLO mail-qt1-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726427AbeJIVPr (ORCPT ); Tue, 9 Oct 2018 17:15:47 -0400 Received: by mail-qt1-f178.google.com with SMTP id l9-v6so1668032qtf.5 for ; Tue, 09 Oct 2018 06:58:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version; bh=xjWs20RU0HrI89lsHaEBcr1iR8tVkybbvwIIXjr3tIQ=; b=ozr0jx7HlXk4SXjpAb5immZ7oJrBd/gsmWz1PiWB7oCLGG76Bc5+/XATO9F1+mq0KN qzWJl3PFlU3cibnuLBgqZrFQ4F8jna/91pWUvRhqbk6axxRSYE5/VB7jSsaMS9lAUO0g EuTo1TSRxzFrVPUjryhJOI/utkT+C6rBWMf7WaPnkiAgEvfW9ioygXieHq2n2iBbd3Oe 91ifI7YWVH6YOXfwIOuahiQvCGDuu0dDNzY8jWKL8eg+d0RLXsK49r6sN//dscetyBZI yTRGepnNQteVrd4U3tyyJa1hWy1b1JqMVaT1/aiyb2K+s7GMiHV4HsANhEl92ETfVq4r HBDA== X-Gm-Message-State: ABuFfoh4YwMBYqIFpx9X6WLpD0st9W5Hvj2QCc441dUV41zDj+9jCiL3 PNb5ES5feC/v8BKLIiJGPGDJ2g== X-Received: by 2002:a0c:edcd:: with SMTP id i13-v6mr23800835qvr.15.1539093521181; Tue, 09 Oct 2018 06:58:41 -0700 (PDT) Received: from [172.25.130.148] (pool-128-6-36-179.nat.rutgers.edu. [128.6.36.179]) by smtp.gmail.com with ESMTPSA id z24-v6sm10193549qtg.42.2018.10.09.06.58.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Oct 2018 06:58:39 -0700 (PDT) From: "Zi Yan" To: "Anshuman Khandual" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kirill.shutemov@linux.intel.com, akpm@linux-foundation.org, mhocko@suse.com, will.deacon@arm.com, "Naoya Horiguchi" Subject: Re: [PATCH] mm/thp: Correctly differentiate between mapped THP and PMD migration entry Date: Tue, 09 Oct 2018 09:58:36 -0400 X-Mailer: MailMate (1.12r5528) Message-ID: <7E8E6B14-D5C4-4A30-840D-A7AB046517FB@cs.rutgers.edu> In-Reply-To: <1539057538-27446-1-git-send-email-anshuman.khandual@arm.com> References: <1539057538-27446-1-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_D24ABCAE-03FA-4552-A378-F6F6EC1FF47E_="; micalg=pgp-sha512; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_D24ABCAE-03FA-4552-A378-F6F6EC1FF47E_= Content-Type: text/plain cc: Naoya Horiguchi (who proposed to use !_PAGE_PRESENT && !_PAGE_PSE for x86 PMD migration entry check) On 8 Oct 2018, at 23:58, Anshuman Khandual wrote: > A normal mapped THP page at PMD level should be correctly differentiated > from a PMD migration entry while walking the page table. A mapped THP would > additionally check positive for pmd_present() along with pmd_trans_huge() > as compared to a PMD migration entry. This just adds a new conditional test > differentiating the two while walking the page table. > > Fixes: 616b8371539a6 ("mm: thp: enable thp migration in generic path") > Signed-off-by: Anshuman Khandual > --- > On X86, pmd_trans_huge() and is_pmd_migration_entry() are always mutually > exclusive which makes the current conditional block work for both mapped > and migration entries. This is not same with arm64 where pmd_trans_huge() !pmd_present() && pmd_trans_huge() is used to represent THPs under splitting, since _PAGE_PRESENT is cleared during THP splitting but _PAGE_PSE is not. See the comment in pmd_present() for x86, in arch/x86/include/asm/pgtable.h > returns positive for both mapped and migration entries. Could some one > please explain why pmd_trans_huge() has to return false for migration > entries which just install swap bits and its still a PMD ? Nonetheless > pmd_present() seems to be a better check to distinguish between mapped > and (non-mapped non-present) migration entries without any ambiguity. If arm64 does it differently, I just wonder how THP splitting is handled in arm64. -- Best Regards Yan Zi --=_MailMate_D24ABCAE-03FA-4552-A378-F6F6EC1FF47E_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQFKBAEBCgA0FiEEOXBxLIohamfZUwd5QYsvEZxOpswFAlu8tAwWHHppLnlhbkBj cy5ydXRnZXJzLmVkdQAKCRBBiy8RnE6mzDkDB/0UH4oRh+cOCW0EYDRVhKtKBjs1 e1BD1S/Pcq/XFtgVfFoziz+3TRHYESnnwDOG86L7hyWON0yL20X6OIaKcQjRkRo7 OLReAB5Jq13CPF4q1U9jjRyNdl9dYvOEBtDsc02F8xv/8Hge3aIAqYH1eouCmAVa Zo1hIRSxdHbWlLRLOOdNc2vD218gNuqtrcCsR78fddklGnItibcyokilXd3VBPRe 5gTJxg4s172rqL7IxkUs3N3KsiHnDDmH383tGZzIl7tULdLcboMvPK+ops5pOWTZ UhCmfX0iauJoG8uHTkhQZvR2WiUz7gptJOA6QzlV80DqfgapNSpdzaJbn8mt =ULbu -----END PGP SIGNATURE----- --=_MailMate_D24ABCAE-03FA-4552-A378-F6F6EC1FF47E_=--