Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1418726ybl; Wed, 14 Aug 2019 16:58:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqyQ2+Yb3SdvjCU+uCjt51jP39zfJNLu3Um3/0oWjTjp4Z80NZXDOXVAeVP3ytBlhI10WSn9 X-Received: by 2002:a17:90a:ca0f:: with SMTP id x15mr427509pjt.82.1565827094495; Wed, 14 Aug 2019 16:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565827094; cv=none; d=google.com; s=arc-20160816; b=dVQou7kEYl9XofDl0DujUG34DTM9Q0OP9D0xuok5OpVTYrMEW02oAgZMVWEHLo0byr JpvPSCtBGZ1/AJ7oPXaXQ7zk3YcvytiOrJKebdHUs7cupRtJ/9r+58Cfy/mPswfMcyKj fdcCLdTKyHdV04oCci30A8NIG9/iNkvgSisNG9O6ZNBI0jC4jll9bHhqNGeXFLeg1sHW h0oKvRPBl6ig2iL1bj6RfYT1qbLk0kGMZFHHHm3CRBLpg8Xh6Ex7cmNwrZZ3I2hUYhR9 iMM2ww9hCjez9UAumUYsowXtvMxS/YVD0N7jH66/xdFmIHXHPaZlLJyT8Mx5t7ykbce+ Fctg== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=LcX0xyfGgOmYGuz4B5wFSysH8VJd6mYYunA+2mz8sgU=; b=JuRo5SvFdLjYKX4r+/moIAr5lGxK6mMW8zkIdHK3PZhOYKAnxFC/GHc8wAEgScyBgo 7h2Iej5F8byxdJqB0Ded1nqChkXJD943PP/ngGzTW1DnfvQxwnqdxpC/4b55Ct37lHom jJfn6KJxxR6YiJ9pQ7fYLo1m109ATygPbWr/NuzUN6u+Ht6Dovw/3vVKz1jKsfLaIsga tWo9jFPN4iZ21V6GjAAkqZMo3A/j7mjFexrC1ytPqsOYh/cySTSL2bGVdXbNn0zgzdEH kMQjOc5Gi/7Z/zT8BQ/he1cX6xn0m8YPbmqns6SKJ5Ri8gMHD8N3LK0WD+qyeY2d9Iw0 grPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=PuOPsYZx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v1si185339pjn.79.2019.08.14.16.57.59; Wed, 14 Aug 2019 16:58:14 -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; dkim=pass header.i=@nvidia.com header.s=n1 header.b=PuOPsYZx; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729172AbfHNXLj (ORCPT + 99 others); Wed, 14 Aug 2019 19:11:39 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:9915 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728425AbfHNXLj (ORCPT ); Wed, 14 Aug 2019 19:11:39 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 14 Aug 2019 16:11:49 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 14 Aug 2019 16:11:37 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 14 Aug 2019 16:11:37 -0700 Received: from rcampbell-dev.nvidia.com (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 14 Aug 2019 23:11:37 +0000 Subject: Re: [PATCHv2] mm/migrate: clean up useless code in migrate_vma_collect_pmd() To: Pingfan Liu , CC: =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Andrew Morton , Mel Gorman , Jan Kara , "Kirill A. Shutemov" , Michal Hocko , Mike Kravetz , Andrea Arcangeli , Matthew Wilcox , References: <20190807052858.GA9749@mypc> <1565167272-21453-1-git-send-email-kernelfans@gmail.com> X-Nvconfidentiality: public From: Ralph Campbell Message-ID: <2b208666-17b5-0f67-d425-b622c97d688d@nvidia.com> Date: Wed, 14 Aug 2019 16:11:37 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <1565167272-21453-1-git-send-email-kernelfans@gmail.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL105.nvidia.com (172.20.187.12) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1565824309; bh=LcX0xyfGgOmYGuz4B5wFSysH8VJd6mYYunA+2mz8sgU=; h=X-PGP-Universal:Subject:To:CC:References:X-Nvconfidentiality:From: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=PuOPsYZxCuhIerZWsb+K72kRksCiGtJ5O9QpOhbSYMQcta4yA6K5YNmt4zeugCORH wNWR6Fq9nU/oYgrqSfLeV6ZeN1WC0alAKtxmIz8h/yfUO+0zElW0tklqCOA7FQn8GM WfAACqLYC86kZe/u5Z0CT5in2Hz8WIruFeafZdtmHhIROO7VvJCezPvjqGq5s2V+n/ KxnKUHZkNZESHRTeI0TB8rFXVrRcb5ClxwfT9HQBddKn9LAIHz9bC2tKGrcOxq8lD2 latqICSK2HTzPoKIAnRIG/XO/62ojbQFM7Ha8wD1LA8nWAduC3/olbbFbCWtRwHWOx rDH6jGjTlXvSw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/7/19 1:41 AM, Pingfan Liu wrote: > Clean up useless 'pfn' variable. >=20 > Signed-off-by: Pingfan Liu > Cc: "J=C3=A9r=C3=B4me Glisse" > Cc: Andrew Morton > Cc: Mel Gorman > Cc: Jan Kara > Cc: "Kirill A. Shutemov" > Cc: Michal Hocko > Cc: Mike Kravetz > Cc: Andrea Arcangeli > Cc: Matthew Wilcox > To: linux-mm@kvack.org > Cc: linux-kernel@vger.kernel.org > --- > mm/migrate.c | 9 +++------ > 1 file changed, 3 insertions(+), 6 deletions(-) >=20 > diff --git a/mm/migrate.c b/mm/migrate.c > index 8992741..d483a55 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -2225,17 +2225,15 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, > pte_t pte; > =20 > pte =3D *ptep; > - pfn =3D pte_pfn(pte); > =20 > if (pte_none(pte)) { > mpfn =3D MIGRATE_PFN_MIGRATE; > migrate->cpages++; > - pfn =3D 0; > goto next; > } > =20 > if (!pte_present(pte)) { > - mpfn =3D pfn =3D 0; > + mpfn =3D 0; > =20 > /* > * Only care about unaddressable device page special > @@ -2252,10 +2250,10 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, > if (is_write_device_private_entry(entry)) > mpfn |=3D MIGRATE_PFN_WRITE; > } else { > + pfn =3D pte_pfn(pte); > if (is_zero_pfn(pfn)) { > mpfn =3D MIGRATE_PFN_MIGRATE; > migrate->cpages++; > - pfn =3D 0; > goto next; > } > page =3D vm_normal_page(migrate->vma, addr, pte); > @@ -2265,10 +2263,9 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, > =20 > /* FIXME support THP */ > if (!page || !page->mapping || PageTransCompound(page)) { > - mpfn =3D pfn =3D 0; > + mpfn =3D 0; > goto next; > } > - pfn =3D page_to_pfn(page); > =20 > /* > * By getting a reference on the page we pin it and that blocks >=20 Thanks, I was planning to do this too. Reviewed-by: Ralph Campbell