Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1047013pxb; Fri, 22 Jan 2021 06:04:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJx3sXiXzue9+YwWMOIIxT2Ccd8UIAsHJH8JYeBXqIPKV42O8mmU0S9l1SUKyGC+rT3M7N7s X-Received: by 2002:a17:906:2681:: with SMTP id t1mr3057741ejc.29.1611324291192; Fri, 22 Jan 2021 06:04:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611324291; cv=none; d=google.com; s=arc-20160816; b=F7prrSVmJcFxlVkgcPPKlbJ5rsZwxFPMtXelyEit7Ysvox0+qtqnevHRO0FJDjBrOt CeS4pryCQyHNS6rGKjWkjKKywJpcioL6HF7vMHI/cO9warTyXwz0pHkb/RyKs92YrBCE LcnPe2/DDVdrp0xbJP75z3M+atZMnthVFew/d7u7fnAx3E6xtcq5Z800XI/1XYyOVWNS 7AkiZaHbwgfUfg+8jBheDyCR6UpZSr38VXyxsKNzN1YlAjgSLlB8a+duW9yzyddqjOPc GEywt78sgdaY4TVLSmleuyRUQXOu8Rs+TKRGXKAP1rZ4D26azCvV6aDigIdEuQox6c4N IL/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=65zblkXRNcqXjUu30/0eBPVZ8NrtZSSKQfb2vGn4/YE=; b=jcy8sYrA1K3yl6EpMEdWsylMcag1Bj2azqIuVH/bk8Htc7W/giImYuMU0EQ4Y0DD8w AtOm3uSHE20QcFDnBI/+ltfDlOxC+8buwS25Az5OX+MEv5uwrcbeb8hJE7+DzEkxWmHR pyKrtd2MND7ELYVpFGdXB6mVhLOW/gTWBCssy7nl5j1P4JRp1If/vdbu1vowRm1ugyYz mz6+6dfdPe5o3+DI5uvPLeXmlCr2h+mPBUIPAeV5F/GEsCI+PLb8e3Es1QUvGDysIQuf rX/yNMTacMwWoOwNEEOVvOmU4rLA73L6mXWSnkluauXlBk9Jeyig+ITdZUCq3omD1/PQ uPLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z+CQvFQ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a8si3050373edv.386.2021.01.22.06.04.16; Fri, 22 Jan 2021 06:04:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Z+CQvFQ1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728091AbhAVOCK (ORCPT + 99 others); Fri, 22 Jan 2021 09:02:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:55490 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728116AbhAVOBy (ORCPT ); Fri, 22 Jan 2021 09:01:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611324028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:in-reply-to:in-reply-to:references:references; bh=65zblkXRNcqXjUu30/0eBPVZ8NrtZSSKQfb2vGn4/YE=; b=Z+CQvFQ1dwDHvXW1dwvHWqEsaWnXOu5kCdY0cykHCGqTm42eYVbvjMXHVm01sTPTAU7Yiv Qkyq7Nn4Kje4PjvI3kNUFYzf2Y01r12g6XnLVBGDXELpgdn9NvZeIP0uD0LloeVcrLCHBQ KvxKzOKZQXrn69zM4Y5T78OINzb1qD4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-379-tJEo--m7Nhua4HahaGa8CQ-1; Fri, 22 Jan 2021 09:00:24 -0500 X-MC-Unique: tJEo--m7Nhua4HahaGa8CQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2297110054FF; Fri, 22 Jan 2021 14:00:23 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-114.pek2.redhat.com [10.72.12.114]) by smtp.corp.redhat.com (Postfix) with ESMTP id ADE3519C59; Fri, 22 Jan 2021 14:00:17 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, rppt@kernel.org, david@redhat.com, bhe@redhat.com, lkp@intel.com Subject: [PATCH v5 4/5] mm: simplify parameter of setup_usemap() Date: Fri, 22 Jan 2021 21:59:55 +0800 Message-Id: <20210122135956.5946-5-bhe@redhat.com> In-Reply-To: <20210122135956.5946-1-bhe@redhat.com> References: <20210122135956.5946-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Parameter 'zone' has got needed information, let's remove other unnecessary parameters. Signed-off-by: Baoquan He Reviewed-by: Mike Rapoport Reviewed-by: David Hildenbrand --- mm/page_alloc.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index cbb67d9c1b2a..69cf19baac12 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6761,25 +6761,22 @@ static unsigned long __init usemap_size(unsigned long zone_start_pfn, unsigned l return usemapsize / 8; } -static void __ref setup_usemap(struct pglist_data *pgdat, - struct zone *zone, - unsigned long zone_start_pfn, - unsigned long zonesize) +static void __ref setup_usemap(struct zone *zone) { - unsigned long usemapsize = usemap_size(zone_start_pfn, zonesize); + unsigned long usemapsize = usemap_size(zone->zone_start_pfn, + zone->spanned_pages); zone->pageblock_flags = NULL; if (usemapsize) { zone->pageblock_flags = memblock_alloc_node(usemapsize, SMP_CACHE_BYTES, - pgdat->node_id); + zone_to_nid(zone)); if (!zone->pageblock_flags) panic("Failed to allocate %ld bytes for zone %s pageblock flags on node %d\n", - usemapsize, zone->name, pgdat->node_id); + usemapsize, zone->name, zone_to_nid(zone)); } } #else -static inline void setup_usemap(struct pglist_data *pgdat, struct zone *zone, - unsigned long zone_start_pfn, unsigned long zonesize) {} +static inline void setup_usemap(struct zone *zone) {} #endif /* CONFIG_SPARSEMEM */ #ifdef CONFIG_HUGETLB_PAGE_SIZE_VARIABLE @@ -6974,7 +6971,7 @@ static void __init free_area_init_core(struct pglist_data *pgdat) continue; set_pageblock_order(); - setup_usemap(pgdat, zone, zone_start_pfn, size); + setup_usemap(zone); init_currently_empty_zone(zone, zone_start_pfn, size); memmap_init_zone(zone); } -- 2.17.2