Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp3769849ybh; Tue, 6 Aug 2019 01:01:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqygDkQLK9zKN5i2hBowEkDNvZwMBjRhFRvMTve+zmWTTEXBM9Gy7leOT701mYe0zLuubaxS X-Received: by 2002:a17:90a:214e:: with SMTP id a72mr1953269pje.0.1565078490864; Tue, 06 Aug 2019 01:01:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565078490; cv=none; d=google.com; s=arc-20160816; b=xmP2kHrTdv52kcvNIUhRhdnfQjkf9ga/OSyg2ZYkCkpDABgK/Ya+pbdeU/cNjz7ufa YP6XbEnFw+2Mh7/xhMLL+krzkjW7oSVaCJlEHPGIteNp7TPXF5i4NVBEY2+WApQPl3Wc ExA3ODfLmG4bWcYLETv1dS9qChUGG1VPuv7ZjCaYtpUHqLRVc612fQtyzn+ASLNnlL7g 5tp4zTkHUpARVZKNsnwp4gvTop1wD4ICc8DkXqmFLSQYEVu5k6UwWguCJAMlYzW8HVEq TzClK9BLFeOb2m4ccyifhP48ME4PF5JenwefR0uWPbK+RphMCrSF4IqMwWeAFWSd6Aju 66bg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aV69onuQcwDqEYz62/w3oHFd2R0PARV3h+ba+PwsLJU=; b=JSpWq5IDo3S4BUIctDCULJlVieZNWdXPld/Cd9elOrwBHfrD6MkcPBFnoFzbm38TPW 2GkmT6Mxil0i0JNc/iV5Us95C+ozWy2bBBiQF8CUbEU8It3zHciY69EHsyVOlc+ZkbkR cr2ViGuaY5St77yM27nZofa7VgVZ5IHDkbtrWx1GvvIu8r39xwsHAR3Mf9qerPZQ6pv+ 3NaCWji7smaiHxUqe5Do3iGgUkIp9aeM15IIAKsafb4kZAGgzeYTWPT8dTku20Zm80ZC FJ66mNK++5f+9X+0E4xtqx5jqN95ASOGUQTwOakmlVZgJIu8KxYFZOUR74m7iVqO9Wut ZneQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TLB7WEzM; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6si47526221pfa.76.2019.08.06.01.01.14; Tue, 06 Aug 2019 01:01:30 -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=@gmail.com header.s=20161025 header.b=TLB7WEzM; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732068AbfHFIAe (ORCPT + 99 others); Tue, 6 Aug 2019 04:00:34 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:46488 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728975AbfHFIAe (ORCPT ); Tue, 6 Aug 2019 04:00:34 -0400 Received: by mail-pg1-f194.google.com with SMTP id w3so3944103pgt.13 for ; Tue, 06 Aug 2019 01:00:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=aV69onuQcwDqEYz62/w3oHFd2R0PARV3h+ba+PwsLJU=; b=TLB7WEzMV1FG9qsC+tFG0uVO2zJplwy4NMtcXZmIe83n8bPedvYIg0kRV+0BKaC2/W qA1bhXaKHBsjod4hTqmfQwF/lUsR277uCh8BUc5BQAE/w4nKQrmd9u5fBIRR3tWkijJN P5PrCFxtrlEUtjIManUEPXxHYB6fAs1VwWq1OkSVqmhXQKqSYhkRRd1j5LGp6QOrTvkB sGzDPsINgXkaDyPTnVx/qVsPefVhLgtJSuNlRD6IbkGv6hdmE3xmprXG4kWR5dvjsvc6 Zcxp+1RmUOKxSrb97ji+pRTFedoopdRumI6BPcbOWQ/ZBZwy1O8iwqkQ+sCrr5SwppNd dRDA== 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:mime-version :content-transfer-encoding; bh=aV69onuQcwDqEYz62/w3oHFd2R0PARV3h+ba+PwsLJU=; b=RQXcyye7nR43N3syo1+9nuejIy/q/DLv5bs1HiXpiclmB8mHeLGiMPuBn8NdeCFj7j ng1zFx5aFRaRKiUq5HAo6vztF3eC0ygZ0H2KBTnRx0QsztM9UMGK/EA0ZrcdUjzR2CdX BPzimLJvdTCY2t/3jbgWRfT7Qp07GXeHnDd4yxV4fnx9kYRibyeaMD5yGbM9m5YWjnhw YuQjDEo81xNU2hm8XtBnIFAAMeFj5IdC1AGIS2p7FKE/OZD95SRtn0XU0KjEJA2R2itp fe0C6NTvfLrmq4q8I4LhWwLtvplPVrs0vu+xfJWUpIpnO7bqpETbroRUiag5QiigO0km TBhw== X-Gm-Message-State: APjAAAUqh5Phv3Ro/0ctkADeu5e9HAkAaqtzpD4alUa0qs54Er8/4sJN kMUiIyOc//6mpa9xwJ1Tig== X-Received: by 2002:a62:be04:: with SMTP id l4mr2260030pff.77.1565078433810; Tue, 06 Aug 2019 01:00:33 -0700 (PDT) Received: from mylaptop.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id p7sm96840679pfp.131.2019.08.06.01.00.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Aug 2019 01:00:33 -0700 (PDT) From: Pingfan Liu To: linux-mm@kvack.org Cc: Pingfan Liu , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Andrew Morton , Mel Gorman , Jan Kara , "Kirill A. Shutemov" , Michal Hocko , Mike Kravetz , Andrea Arcangeli , Matthew Wilcox , linux-kernel@vger.kernel.org Subject: [PATCH 1/3] mm/migrate: clean up useless code in migrate_vma_collect_pmd() Date: Tue, 6 Aug 2019 16:00:09 +0800 Message-Id: <1565078411-27082-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Pingfan Liu Cc: "Jérôme 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 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 8992741..c2ec614 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2230,7 +2230,6 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, if (pte_none(pte)) { mpfn = MIGRATE_PFN_MIGRATE; migrate->cpages++; - pfn = 0; goto next; } @@ -2255,7 +2254,6 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, 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 -- 2.7.5