Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1308717pxk; Mon, 31 Aug 2020 16:00:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzWS4X21k+MXy6Q/ts8LNtOKNjn8UMoZToq3RmhPrI9USRt1V1blQSW2tZgHbkgdeshEIsj X-Received: by 2002:a17:906:5f8f:: with SMTP id a15mr3135742eju.291.1598914818885; Mon, 31 Aug 2020 16:00:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598914818; cv=none; d=google.com; s=arc-20160816; b=J5Mm2nYxEcvTwKSfA82wNUM5VxHXBMDVbINpaX9hUw3KrwywZYSZVrE6/5xPs+bcgL b4pHosivvCkhEFyzikApMpMDPC1OUPeVB+N2r1FcR18R5IG81z5iwZm51+cqWn2cdUVN wnKOGTa/EcY4JX8sQ37WsmL62/IPMqh+NR2ALDbOswyF85dBOn6jSKLVSnoe1MbAh5fo xUx1wHuryRTYUWiilI8Ygirt5qSGug9TkahhPic97kwvwKNqx9Hf4sLSIWaRkryt6lI7 MWG0Hut+hFsbZQ5X25oL8HawOwCCiMe0iXI8ESQhwj/82Btkm2YQegmf2bgSPYdSyxWR Zb1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from; bh=lW7r6oHxQx8fXPiNLSVPMYvMf7jRKDuGDFS9fvpd+DY=; b=rFxkmshmYoNU2Eav+4gAJwp5P3Dk17DxFGKnATHABUYuTQfY8jT1W8zO3Zrl22FLJk x1+UrXZqg88EHvD7VYH/IMHvPv1vej+R8qHSxKfqsfvtAfMpSqGStB06ITokvbdvsR/O HDiWcCD821nC4yB1bGqYuZ7uVKWBTQSl3A7gb9t/q4W0j4wNebaU7gQZMhzSSTeAwxrh vTJUT6nxURO7tlDUg32tPgPBAlBOlJOSUl0CGgheLDtOh+T2B6Ng9usgrGlvmY170fCY LbfducygcAkQrYH27Ue8NhBDzBDDXCA5DiwPA6w96BFfpwspKMtNH9Um3xUoVfi2XiVa rzKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=RCXCvDYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g3si6038906ejj.248.2020.08.31.15.59.56; Mon, 31 Aug 2020 16:00:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=RCXCvDYm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730248AbgHaVWb (ORCPT + 99 others); Mon, 31 Aug 2020 17:22:31 -0400 Received: from hqnvemgate25.nvidia.com ([216.228.121.64]:18494 "EHLO hqnvemgate25.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728649AbgHaVWa (ORCPT ); Mon, 31 Aug 2020 17:22:30 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 31 Aug 2020 14:21:44 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 31 Aug 2020 14:22:30 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 31 Aug 2020 14:22:30 -0700 Received: from HQMAIL105.nvidia.com (172.20.187.12) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 31 Aug 2020 21:22:30 +0000 Received: from rnnvemgw01.nvidia.com (10.128.109.123) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Mon, 31 Aug 2020 21:22:29 +0000 Received: from rcampbell-dev.nvidia.com (Not Verified[10.110.48.66]) by rnnvemgw01.nvidia.com with Trustwave SEG (v7,5,8,10121) id ; Mon, 31 Aug 2020 14:22:29 -0700 From: Ralph Campbell To: , CC: Jerome Glisse , Alistair Popple , Christoph Hellwig , Jason Gunthorpe , Bharata B Rao , Andrew Morton , Ralph Campbell Subject: [PATCH 1/2] mm/migrate: remove unnecessary is_zone_device_page() check Date: Mon, 31 Aug 2020 14:22:21 -0700 Message-ID: <20200831212222.22409-2-rcampbell@nvidia.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200831212222.22409-1-rcampbell@nvidia.com> References: <20200831212222.22409-1-rcampbell@nvidia.com> MIME-Version: 1.0 X-NVConfidentiality: public Content-Transfer-Encoding: quoted-printable Content-Type: text/plain DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1598908904; bh=lW7r6oHxQx8fXPiNLSVPMYvMf7jRKDuGDFS9fvpd+DY=; h=X-PGP-Universal:From:To:CC:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:MIME-Version:X-NVConfidentiality: Content-Transfer-Encoding:Content-Type; b=RCXCvDYm0RJCr4PbsQ4jczkmiYom2pXKkeuFLr7jI2ZGyYfnrBqoUKKFa31P6/Xqx xSGgf91mH84s5YEq4LZ7nJgco6/NQmUy8pSOXEGvWhw3rMI1iyYmZXKruVg4r5NyIh WvavOoGvUcEiznRjju0C9EV6DbO5Hdu6MKCMjQgvK/eoEzb/TmLOnWVuQsCdP6+BI3 LQvtrOPuy3Fy/ddwCOMNbnha0bZAciuV1aMXLQrTGmdHy9+Bt+g1FioFzMMQZvSqbG BJdR40k7XOhMgtiFbWQDFLhsnDgvjgUKv4DgvbgsvRKFU2ZRgYB16mfNK1oh3mCsz2 er1+iG7ebGZ/w== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The check for is_zone_device_page() and is_device_private_page() is unnecessary since the latter is sufficient to determine if the page is a device private page. Simplify the code for easier reading. Signed-off-by: Ralph Campbell --- mm/migrate.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 659d3d8a3e1f..fe339a847328 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -246,13 +246,11 @@ static bool remove_migration_pte(struct page *page, s= truct vm_area_struct *vma, else if (pte_swp_uffd_wp(*pvmw.pte)) pte =3D pte_mkuffd_wp(pte); =20 - if (unlikely(is_zone_device_page(new))) { - if (is_device_private_page(new)) { - entry =3D make_device_private_entry(new, pte_write(pte)); - pte =3D swp_entry_to_pte(entry); - if (pte_swp_uffd_wp(*pvmw.pte)) - pte =3D pte_swp_mkuffd_wp(pte); - } + if (unlikely(is_device_private_page(new))) { + entry =3D make_device_private_entry(new, pte_write(pte)); + pte =3D swp_entry_to_pte(entry); + if (pte_swp_uffd_wp(*pvmw.pte)) + pte =3D pte_swp_mkuffd_wp(pte); } =20 #ifdef CONFIG_HUGETLB_PAGE --=20 2.20.1