Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp47464ybl; Thu, 15 Aug 2019 12:22:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqwHPmjjIv8gpmocUxKREH8cKa9SE5xbAIU3hXjpBr3t4zdbE8BaBzwHcBTib6iGQeQaDIPc X-Received: by 2002:a63:ab08:: with SMTP id p8mr4889631pgf.340.1565896967507; Thu, 15 Aug 2019 12:22:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565896967; cv=none; d=google.com; s=arc-20160816; b=bpG7s54hfEcQTXdGD1XOTV1+ujxXZ6CbisvW10dC/O1/GaB/oeDT1d5rzficSWdkL5 ykQbHiXqSLe7YMGKnIM58v8J0rSrwHPltbs9t5qsfTL4yqyfqGvQPlYzlm3+eHLPBtZY ZEpkC+OEZduLmwm3Ex90L7JGlVPqlO/xd2wHUV2k10dOdssG4LJdefvp6G2fOdmOlqRg togtdLkRrQwz4bdBxV6H1fvoGwulMAvf/uCIwWvUO8BYR92khtzswbZCy2C3iKu6YblT 9NIHqboP4wZfFRkooXzJIiFb/gXBO/4/7PLay1qegzzOeGdPAmHbmLFmWfEo2S7W7KS5 rAew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=HoTTQ0NEkX+mnvbK1M5fOR9JdSVJQcccc0ilWJ7OyD0=; b=iEV0bGAeDwmxab3aEdsrF7FNH7UCMyLziAEEIC4DWm/2gP32FOCuUFgpa4eSRR2k5r 4I6ROWZp4VQlnCKu7O51oAxLZNc2cqmGFfaT2brZgfz7GcjvVOXI+KwyOsheKQTPud39 HIK3/VaNNFtyZWrEiGQst09W/1NFy0ySeFldz1pGthhgsC0O8fmqgusLKp4IYpZNowLV 5OmHuTpV8dTpT9fRyfFvEKuR5hekHkkYSjk9xApchdawOB2sORIjGbeq6jRsYJzZmRD0 9DgXK9fj0EhFYJxz77GtSfamlJYMxOC+HSI+n6rBlS/40m+avCnVe9GTz7amMKfBFxEi ibXA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j1si2633234pfa.91.2019.08.15.12.22.10; Thu, 15 Aug 2019 12:22:47 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732293AbfHORW5 (ORCPT + 99 others); Thu, 15 Aug 2019 13:22:57 -0400 Received: from mx1.redhat.com ([209.132.183.28]:48356 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729931AbfHORW4 (ORCPT ); Thu, 15 Aug 2019 13:22:56 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 43F523082E51; Thu, 15 Aug 2019 17:22:56 +0000 (UTC) Received: from redhat.com (unknown [10.20.6.178]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3D85710018F9; Thu, 15 Aug 2019 17:22:55 +0000 (UTC) Date: Thu, 15 Aug 2019 13:22:53 -0400 From: Jerome Glisse To: Pingfan Liu Cc: linux-mm@kvack.org, Andrew Morton , Mel Gorman , Jan Kara , "Kirill A. Shutemov" , Michal Hocko , Mike Kravetz , Andrea Arcangeli , Matthew Wilcox , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] mm/migrate: remove the duplicated code migrate_vma_collect_hole() Message-ID: <20190815172253.GE30916@redhat.com> References: <1565078411-27082-1-git-send-email-kernelfans@gmail.com> <1565078411-27082-3-git-send-email-kernelfans@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1565078411-27082-3-git-send-email-kernelfans@gmail.com> User-Agent: Mutt/1.11.3 (2019-02-01) X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Thu, 15 Aug 2019 17:22:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 06, 2019 at 04:00:11PM +0800, Pingfan Liu wrote: > After the previous patch which sees hole as invalid source, > migrate_vma_collect_hole() has the same code as migrate_vma_collect_skip(). > Removing the duplicated code. NAK this one too given previous NAK. > > 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 | 22 +++------------------- > 1 file changed, 3 insertions(+), 19 deletions(-) > > diff --git a/mm/migrate.c b/mm/migrate.c > index 832483f..95e038d 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -2128,22 +2128,6 @@ struct migrate_vma { > unsigned long end; > }; > > -static int migrate_vma_collect_hole(unsigned long start, > - unsigned long end, > - struct mm_walk *walk) > -{ > - struct migrate_vma *migrate = walk->private; > - unsigned long addr; > - > - for (addr = start & PAGE_MASK; addr < end; addr += PAGE_SIZE) { > - migrate->src[migrate->npages] = 0; > - migrate->dst[migrate->npages] = 0; > - migrate->npages++; > - } > - > - return 0; > -} > - > static int migrate_vma_collect_skip(unsigned long start, > unsigned long end, > struct mm_walk *walk) > @@ -2173,7 +2157,7 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, > > again: > if (pmd_none(*pmdp)) > - return migrate_vma_collect_hole(start, end, walk); > + return migrate_vma_collect_skip(start, end, walk); > > if (pmd_trans_huge(*pmdp)) { > struct page *page; > @@ -2206,7 +2190,7 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, > return migrate_vma_collect_skip(start, end, > walk); > if (pmd_none(*pmdp)) > - return migrate_vma_collect_hole(start, end, > + return migrate_vma_collect_skip(start, end, > walk); > } > } > @@ -2337,7 +2321,7 @@ static void migrate_vma_collect(struct migrate_vma *migrate) > > mm_walk.pmd_entry = migrate_vma_collect_pmd; > mm_walk.pte_entry = NULL; > - mm_walk.pte_hole = migrate_vma_collect_hole; > + mm_walk.pte_hole = migrate_vma_collect_skip; > mm_walk.hugetlb_entry = NULL; > mm_walk.test_walk = NULL; > mm_walk.vma = migrate->vma; > -- > 2.7.5 >