From patchwork Tue Aug 6 08:00:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Pingfan Liu X-Patchwork-Id: 11078377 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDF861395 for ; Tue, 6 Aug 2019 08:00:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDB051FF66 for ; Tue, 6 Aug 2019 08:00:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1C1E2844B; Tue, 6 Aug 2019 08:00:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9BD4A27968 for ; Tue, 6 Aug 2019 08:00:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9E7706B0003; Tue, 6 Aug 2019 04:00:36 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 999586B0005; Tue, 6 Aug 2019 04:00:36 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8869A6B0006; Tue, 6 Aug 2019 04:00:36 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by kanga.kvack.org (Postfix) with ESMTP id 4F2F26B0003 for ; Tue, 6 Aug 2019 04:00:36 -0400 (EDT) Received: by mail-pg1-f197.google.com with SMTP id h5so54451521pgq.23 for ; Tue, 06 Aug 2019 01:00:36 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:mime-version:content-transfer-encoding; bh=aV69onuQcwDqEYz62/w3oHFd2R0PARV3h+ba+PwsLJU=; b=TimuRRJUKA2h99Qd6s73LRsUSkrbs9oka9Pw0YQWStVRQM9xDzfYsOKgfV3dPNbezu 3ITUaw6m1gUldo7LnNL+W4pRFmSLQzM2w0fCjo0bN7m32Zi7ELIFBxC4hfU0pDHPdk+u XdQr/VodK94sYcVRQ0gKK6DxWL3hw3cYTbuenZ2WnTG+lPoZwf4SY78OxsaVmuhLXMao +Ee7kEedQRUmij6F68mgor10RI7cgz94/ESyClWL+NMdLYzxbv6tHA0yoDYnigqVrrxD AfgnWXThCpDQr1dFLx+KLWJbItstP3+1tpgNpfznCHbsahzRZrb3d8qxQy1W+FyT5XhQ C7lQ== X-Gm-Message-State: APjAAAVY+JrJKzcwqaMP6NI7OdqLNUe/GSbW32xImgndkx61AkM6cKq8 nWt4Czf9m2ajdRujeAQN0lCM17RJTmN6Zx6KRPPImqf1rc8NmY8/rmr4getYSl2cmMbJDa+a4wo TTpXsJ7fRiF9LD6nAerB7DHpGon9D+iu1Z4LANN4dJaIj6aWUfuPjNe7D0sZmqjgbww== X-Received: by 2002:a62:1c93:: with SMTP id c141mr2402487pfc.9.1565078435946; Tue, 06 Aug 2019 01:00:35 -0700 (PDT) X-Received: by 2002:a62:1c93:: with SMTP id c141mr2402324pfc.9.1565078434272; Tue, 06 Aug 2019 01:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565078434; cv=none; d=google.com; s=arc-20160816; b=hWTwiGZO5f0s3rK8dy2YYFoXbXOOfpT55naYhmgz//Xfhsnl5nmF/lar4+mSpN9/3W /FFLHDsubvYd0GE33A04/tnUsTH23uyCUB1PVEvXvClqV0OqlQbOCS0AuvR7XuCFc1l0 0iEj+fTEuTQJNRJ/YtJpJ4To+BacNiohsMfmw6lohLgrXalA6TlaTFTFutEoWFrlDxI4 br9kaqEaS9brb6h9n/a8SGfJUIb8wQQSOCphwsgJJumiMrDeB/yOUy8AdGs3Z8UV0Qx+ ttr00gwIK0yuODrQeyhV3kKoDrA3aQ8AWMtHpEvFRF2rETFgPsBbKfcOweWb9soaCdSg Ru7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:dkim-signature; bh=aV69onuQcwDqEYz62/w3oHFd2R0PARV3h+ba+PwsLJU=; b=VR9VaUDBsk4m4T0bhS2U0e3p/SQjFTXqPG8XBG1OXl+hbaRww+LR3VABkT8jaeXFfb i1aEprzahtDDsqZFxOWLrySGK10VXCxMxv4ad4OneU49ZNIKoKLFCK8+sBfz/h2gUOkj 7a1+WKObxjS3oulKgPs9z09zn49QP8DxIYUTrolkQdltWdBYpCFdZ/Bej3VRL4y/4JYn U/jJBs+xSX1yuhR5B/MCB46vdI+WiJgnDkajTprpWlpanSQrxq6AF+29SWeg4Cri7nKA zE6lOVsIR9JU6dbvF3ZplUiTFvu/ueRrUHqeLb4yd0xUlRt622a0G53xgwadfDanXZxh cUbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TLB7WEzM; spf=pass (google.com: domain of kernelfans@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kernelfans@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id a1sor41470990pfc.63.2019.08.06.01.00.34 for (Google Transport Security); Tue, 06 Aug 2019 01:00:34 -0700 (PDT) Received-SPF: pass (google.com: domain of kernelfans@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TLB7WEzM; spf=pass (google.com: domain of kernelfans@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=kernelfans@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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-Smtp-Source: APXvYqzcRDSMRahvNSlA2NE7YehHcCK+DdqZfd9iDDVrttQjMFGM+2BAVpZ47/jY+R7q00gXTs3ESQ== 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?b?SsOpcsO0bWUgR2xpc3Nl?= , 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Matthew Wilcox (Oracle) --- 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