[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2b208666-17b5-0f67-d425-b622c97d688d@nvidia.com>
Date: Wed, 14 Aug 2019 16:11:37 -0700
From: Ralph Campbell <rcampbell@...dia.com>
To: Pingfan Liu <kernelfans@...il.com>, <linux-mm@...ck.org>
CC: Jérôme Glisse <jglisse@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Mel Gorman <mgorman@...hsingularity.net>,
Jan Kara <jack@...e.cz>,
"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
Michal Hocko <mhocko@...e.com>,
Mike Kravetz <mike.kravetz@...cle.com>,
Andrea Arcangeli <aarcange@...hat.com>,
Matthew Wilcox <willy@...radead.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCHv2] mm/migrate: clean up useless code in
migrate_vma_collect_pmd()
On 8/7/19 1:41 AM, Pingfan Liu wrote:
> Clean up useless 'pfn' variable.
>
> Signed-off-by: Pingfan Liu <kernelfans@...il.com>
> Cc: "Jérôme Glisse" <jglisse@...hat.com>
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: Mel Gorman <mgorman@...hsingularity.net>
> Cc: Jan Kara <jack@...e.cz>
> Cc: "Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>
> Cc: Michal Hocko <mhocko@...e.com>
> Cc: Mike Kravetz <mike.kravetz@...cle.com>
> Cc: Andrea Arcangeli <aarcange@...hat.com>
> Cc: Matthew Wilcox <willy@...radead.org>
> To: linux-mm@...ck.org
> Cc: linux-kernel@...r.kernel.org
> ---
> mm/migrate.c | 9 +++------
> 1 file changed, 3 insertions(+), 6 deletions(-)
>
> 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;
>
> pte = *ptep;
> - pfn = pte_pfn(pte);
>
> if (pte_none(pte)) {
> mpfn = MIGRATE_PFN_MIGRATE;
> migrate->cpages++;
> - pfn = 0;
> goto next;
> }
>
> if (!pte_present(pte)) {
> - mpfn = pfn = 0;
> + mpfn = 0;
>
> /*
> * 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 |= MIGRATE_PFN_WRITE;
> } else {
> + pfn = pte_pfn(pte);
> if (is_zero_pfn(pfn)) {
> mpfn = MIGRATE_PFN_MIGRATE;
> migrate->cpages++;
> - pfn = 0;
> goto next;
> }
> page = vm_normal_page(migrate->vma, addr, pte);
> @@ -2265,10 +2263,9 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp,
>
> /* FIXME support THP */
> if (!page || !page->mapping || PageTransCompound(page)) {
> - mpfn = pfn = 0;
> + mpfn = 0;
> goto next;
> }
> - pfn = page_to_pfn(page);
>
> /*
> * By getting a reference on the page we pin it and that blocks
>
Thanks, I was planning to do this too.
Reviewed-by: Ralph Campbell <rcampbell@...dia.com>
Powered by blists - more mailing lists