Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3377641pxu; Sun, 20 Dec 2020 00:33:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJzg9GMBnmkunkTjnYt5BeTOs49Cw7i2+jyyQ7L37PV++7FZ4B2zPHTdSG4gkbFt4u14bE// X-Received: by 2002:aa7:cb12:: with SMTP id s18mr4444532edt.125.1608453189086; Sun, 20 Dec 2020 00:33:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608453189; cv=none; d=google.com; s=arc-20160816; b=PJK5YnumRtvMsGsNoh85B5k2HGuhVTS1jsVxrY9kj8bT6kZIelOyo2NdzeroSvD+TS ZyJtQLI12wSftgVmyS4YzL88KEm8UxlDclvlFxudDtRbr87m6tQoXvOyNUUsociSWdgT SSlQ7d18GMfJ1+Sl35kXLFfJtqArFo6TsZBilex8bUQZFhR+4sqt1Lx2lFHQroNZK8VT 73KZeAQvCJjoP430izFgPQF1VHj/RkwLNw7EagjxXAbQrRueRDgsW32GlW3z5lcj3fxl fWHBqAtvC3Ey02ge0w1g/LNwf1Ozs3JBrLFALBMXMEarx2V53R9Hk5w1ICuhb41EBVpf C1cA== 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=dqF3OKhxr17IUwJ34K5airZU1BciWL9ISo9Hcrx3KMk=; b=KAJ9Bx6bDJFKdcXC6Bg551fVKKkfKx9ZCWBpDX1EIUuZHhlO/lzRLZOPr19tjw8EVD TPEj1DoqNcSZN2dXGxM1EBllUcw04q61kX/K9aPE+/V2sMcEP7jgwgSnsQ/m6ypHB+b3 2ICYyC6cWUFZJe+DfxJFStJ3Q18RDSAqYb5kiF75r9iXK7YUetGVT7SARe4pbSqlBilf XxXNeSe1t9EfwrJbkCW11/w+7Um/s/MzXVZh8tkjgW2Nnw/Mz3/YlLEw03vqM1PxIjyX eFxrGA4vO0YHn6Bm5V2elPBisEuKHZlATy+nhghUpXncn7dhCfCxbZIhN9Rrq3dviNtk DJBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=HncEORnO; 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 g2si6150608edr.482.2020.12.20.00.32.46; Sun, 20 Dec 2020 00:33:09 -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=HncEORnO; 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 S1727457AbgLTI3y (ORCPT + 99 others); Sun, 20 Dec 2020 03:29:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:35990 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727043AbgLTI3x (ORCPT ); Sun, 20 Dec 2020 03:29:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1608452907; 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=dqF3OKhxr17IUwJ34K5airZU1BciWL9ISo9Hcrx3KMk=; b=HncEORnOxJir6/9C+VngWXyhoHo6Gp9VhSo6y4GcnhWowRmwElhqlYs7n0RE7VR1JrBshL bTFXeDlKQdYUr51BigcSy34XBUX1gss0IeZf9/SyDorQNV/1bHACRw1ENkPJfup7aa+9YR kpN6T9F60qUDNGGlKdhGM+BLCj4f1L4= 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-378-tN_ja1CHN8uybVLa_kf2Lg-1; Sun, 20 Dec 2020 03:28:23 -0500 X-MC-Unique: tN_ja1CHN8uybVLa_kf2Lg-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 00912801817; Sun, 20 Dec 2020 08:28:22 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (ovpn-12-22.pek2.redhat.com [10.72.12.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3934D60C13; Sun, 20 Dec 2020 08:28:15 +0000 (UTC) From: Baoquan He To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, akpm@linux-foundation.org, gopakumarr@vmware.com, rppt@kernel.org, david@redhat.com, bhe@redhat.com Subject: [PATCH v2 4/5] mm: simplify parameter of setup_usemap() Date: Sun, 20 Dec 2020 16:27:53 +0800 Message-Id: <20201220082754.6900-5-bhe@redhat.com> In-Reply-To: <20201220082754.6900-1-bhe@redhat.com> References: <20201220082754.6900-1-bhe@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 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 --- 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 7a6626351ed7..7f0a917ab858 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6824,25 +6824,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 @@ -7037,7 +7034,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