Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp108744ybv; Wed, 5 Feb 2020 02:09:58 -0800 (PST) X-Google-Smtp-Source: APXvYqx63FSpZepXHgztsv76CexrTdNVZIi7VRzRP5nN46KBS359/bi04mO9i1MMQE5V/DmrHd40 X-Received: by 2002:aca:3114:: with SMTP id x20mr2326343oix.121.1580897398338; Wed, 05 Feb 2020 02:09:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580897398; cv=none; d=google.com; s=arc-20160816; b=SzBJ97Tvq4ljQHe3D6CNw5M9Y/rF2DPMnG7WDAWKDsyCymuluIAzwFGkxaS7RIVc/Z brxtwWhi+FAJgMLZAA/jibSDKPLoJxLkFa9CsUJOt06Nk8NMo+NQzWQaNe8vuBUmDf+g jltcGIRDiNUVJcF3mhqQHpMsn+GumOjva3iQrxFrMyoW4kmMiVhHxh5AMp9xcpBQP4z4 291avWG8wDbYM729qkt5GlLhXc9MQGNxoh2URPbHk/NyppWaB1SQ1VCINQMlmnDcvcj5 x568M04t3g+jw4gR4H7zqPpzvZ3dJ5Pio5narR0+Cw5fmgpqTsmsad3fjV491Web1l26 MdnA== 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-disposition:mime-version:references:reply-to:message-id :subject:cc:to:from:date; bh=z0Num00d8CkSRWrx8OohQTNfsK+5j3h2ld1hwXsGRHY=; b=eIVuwXryEWbk2JGU4GweilkLAtZDc+hdNxNG+6aU90Rd488dKB4xulHRqFM4Cy8K01 /AcYYUqF/mOL+mHGKiDhVnok09irqaNyQaJziLhPxCOpE/nHzflUiHiQe4mfvxljtoDz n53QXxoSSySeDOgBmCz7MYhS6tZxObQ6EuBQAOjxLMXNcOrtIzPoK2Ne+2UUH/7KIyWu wJ18M1n8RLrRiJdKrsUl5JhEMrpbC+240fpnMPEghkF6mPtNMyuBiF6Hu2RJnkyWLiZa C5NfPfyAcgiS0gwxiJ3BAfu1phoN5/L8EWj4Gf3o8h1B78lXUD/ORZkogSZ9NimBY6Q3 PDzw== 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si6101228otc.104.2020.02.05.02.09.46; Wed, 05 Feb 2020 02:09:58 -0800 (PST) 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727790AbgBEKHK (ORCPT + 99 others); Wed, 5 Feb 2020 05:07:10 -0500 Received: from mga06.intel.com ([134.134.136.31]:30679 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727068AbgBEKHK (ORCPT ); Wed, 5 Feb 2020 05:07:10 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Feb 2020 02:07:09 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,405,1574150400"; d="scan'208";a="279328278" Received: from richard.sh.intel.com (HELO localhost) ([10.239.159.54]) by FMSMGA003.fm.intel.com with ESMTP; 05 Feb 2020 02:07:06 -0800 Date: Wed, 5 Feb 2020 18:07:23 +0800 From: Wei Yang To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-ia64@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, x86@kernel.org, Andrew Morton , Oscar Salvador , Michal Hocko , Pavel Tatashin , Dan Williams , Wei Yang Subject: Re: [PATCH v6 09/10] mm/memory_hotplug: Drop local variables in shrink_zone_span() Message-ID: <20200205100723.GD24162@richard> Reply-To: Wei Yang References: <20191006085646.5768-1-david@redhat.com> <20191006085646.5768-10-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191006085646.5768-10-david@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 06, 2019 at 10:56:45AM +0200, David Hildenbrand wrote: >Get rid of the unnecessary local variables. > >Cc: Andrew Morton >Cc: Oscar Salvador >Cc: David Hildenbrand >Cc: Michal Hocko >Cc: Pavel Tatashin >Cc: Dan Williams >Cc: Wei Yang >Signed-off-by: David Hildenbrand Looks reasonable. Reviewed-by: Wei Yang >--- > mm/memory_hotplug.c | 15 ++++++--------- > 1 file changed, 6 insertions(+), 9 deletions(-) > >diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >index 8dafa1ba8d9f..843481bd507d 100644 >--- a/mm/memory_hotplug.c >+++ b/mm/memory_hotplug.c >@@ -374,14 +374,11 @@ static unsigned long find_biggest_section_pfn(int nid, struct zone *zone, > static void shrink_zone_span(struct zone *zone, unsigned long start_pfn, > unsigned long end_pfn) > { >- unsigned long zone_start_pfn = zone->zone_start_pfn; >- unsigned long z = zone_end_pfn(zone); /* zone_end_pfn namespace clash */ >- unsigned long zone_end_pfn = z; > unsigned long pfn; > int nid = zone_to_nid(zone); > > zone_span_writelock(zone); >- if (zone_start_pfn == start_pfn) { >+ if (zone->zone_start_pfn == start_pfn) { > /* > * If the section is smallest section in the zone, it need > * shrink zone->zone_start_pfn and zone->zone_spanned_pages. >@@ -389,25 +386,25 @@ static void shrink_zone_span(struct zone *zone, unsigned long start_pfn, > * for shrinking zone. > */ > pfn = find_smallest_section_pfn(nid, zone, end_pfn, >- zone_end_pfn); >+ zone_end_pfn(zone)); > if (pfn) { >+ zone->spanned_pages = zone_end_pfn(zone) - pfn; > zone->zone_start_pfn = pfn; >- zone->spanned_pages = zone_end_pfn - pfn; > } else { > zone->zone_start_pfn = 0; > zone->spanned_pages = 0; > } >- } else if (zone_end_pfn == end_pfn) { >+ } else if (zone_end_pfn(zone) == end_pfn) { > /* > * If the section is biggest section in the zone, it need > * shrink zone->spanned_pages. > * In this case, we find second biggest valid mem_section for > * shrinking zone. > */ >- pfn = find_biggest_section_pfn(nid, zone, zone_start_pfn, >+ pfn = find_biggest_section_pfn(nid, zone, zone->zone_start_pfn, > start_pfn); > if (pfn) >- zone->spanned_pages = pfn - zone_start_pfn + 1; >+ zone->spanned_pages = pfn - zone->zone_start_pfn + 1; > else { > zone->zone_start_pfn = 0; > zone->spanned_pages = 0; >-- >2.21.0 -- Wei Yang Help you, Help me