From patchwork Wed Mar 27 12:06:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13606303 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E521EC47DD9 for ; Wed, 27 Mar 2024 12:07:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 5121A6B0092; Wed, 27 Mar 2024 08:07:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4C1336B0093; Wed, 27 Mar 2024 08:07:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3AF166B0095; Wed, 27 Mar 2024 08:07:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1D2146B0092 for ; Wed, 27 Mar 2024 08:07:02 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CE01C140503 for ; Wed, 27 Mar 2024 12:07:01 +0000 (UTC) X-FDA: 81942693042.26.5D37037 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf22.hostedemail.com (Postfix) with ESMTP id DB24DC001F for ; Wed, 27 Mar 2024 12:06:58 +0000 (UTC) Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ZWVSM/CI"; spf=pass (imf22.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711541219; a=rsa-sha256; cv=none; b=jL4KkBjvxRvQ557hGQbBF2U4npD8DwymwXzBKwNha0Cj2jqJ9ZrLI0e7C7M0gmakza1kfO Kt5Diu1WvjRzhQe44wfVniIUcsS+Af8rtovl6UhNrEjbCGitbDQfgmW6fKyGAj3Ih/pBwx d0sKIqrWGCM5IVtqNDDbRhY2AR0Uw5Q= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="ZWVSM/CI"; spf=pass (imf22.hostedemail.com: domain of bhe@redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1711541219; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LtExpE4ZPQ05ileak/7P6orubEATXgL6CzchG6F/cEo=; b=c+MtrTuhDBpb4UAlfSO5+AzVI3oaZW7lSVQFzfAhm7fMfR9cmJ+vznGxjHsjB6MlOaWvar aCeW6yGfJy0I1nh1wpIGfAu5xsO1/I4DzXEWkHL3YJFx/nJDr8UXhAjxx84SWZVBs4ASDI oa1CZ/dbsHXuSf4m22Vaunr4Xsvzelo= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711541218; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=LtExpE4ZPQ05ileak/7P6orubEATXgL6CzchG6F/cEo=; b=ZWVSM/CIZeG/90K2zw+BVTokUFHM9yKW5COVEbOTIaOB26b2p0xBwLSOsebIa9WvPs6YBq 54Iio3ZD/eTjtUxaG7Lgyn5/N8KIiwOipr8C6/dmDf5x307EEkHLdhwedA7b5r+WVDYeO6 KwYaqRh1IoLlq7MGrlRuDAWxOo/GgBU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-668-HbQGq8bONBmfKF-keBY4jQ-1; Wed, 27 Mar 2024 08:06:53 -0400 X-MC-Unique: HbQGq8bONBmfKF-keBY4jQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6F3C1868A2E; Wed, 27 Mar 2024 12:06:53 +0000 (UTC) Received: from localhost (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B5EB8C3BAF0; Wed, 27 Mar 2024 12:06:52 +0000 (UTC) Date: Wed, 27 Mar 2024 20:06:45 +0800 From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de Subject: [PATCH v2 4/7] mm/page_alloc.c: remove unneeded codes in !NUMA version of build_zonelists() Message-ID: References: <20240326061134.1055295-1-bhe@redhat.com> <20240326061134.1055295-5-bhe@redhat.com> MIME-Version: 1.0 In-Reply-To: <20240326061134.1055295-5-bhe@redhat.com> X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DB24DC001F X-Stat-Signature: aaxkxzouneobz8r99i7jjtz8jaistmdu X-Rspam-User: X-HE-Tag: 1711541218-565817 X-HE-Meta: U2FsdGVkX192A9o/ALlUHjSg/NbHUrcf3Y1tpVLfT4HF3KJglFLQSth7qZzLhrI2Fhi2o+5gCfb28v0pQK0WD0MqFEJFPqqFl/ICvNZH85J0gmL8nLmhRoYM6QBqThaIBIPDR+E+v7zKeu5awORNnsN5lVAUDnIm0MAgjYFfFZm/O0+6MV1VCgAs2fPNXN2vfJYIgykGs/0Aa5a/qyU0i+dK2j30H1vX9aLpBCjpS1obbYabZ1KWB16tQGvUPFA4Ij6S0l4hLaimQr4DawwyFBcBT6vFhChQBBVJ3EJ3pX4mNppNcIj/qNyTYlN7cd1pIU6UNMFWp0MJhBOGNunOKD94DElth7M9wcaLlFlDXk3c8NoSa3LMbtIJRZcf0E7gSF1/WxgjFV21x/Th3KYSSOMNq1y0hU/YmcCHIwenEjPVXSelwQ+iNBwKNkAoGksdsdglGF0ySdZhHpSrX29o7BErGcqE1jgNqwmi1FAd85yF8qOPJPkL1ihFDX/ppCmHZwZjE+Skc2d6tz1JBDT3oDB0FvOlKS/tHn9A12Iv7ZMR3WfO9wVFOMKqXYygrixUT87//NabvzJtoZklUHLs7DyB+zaBlZCqBHtRd2BZSZwzD/upxqjCbh7XFucGilGePIVEau16m0aVWn0avVyOQbfRCMFqoYQ/0lpGU/m6oY15APC17EeNBvjBd97y9XLoOo8WuqGQByxLmBM1Wd0r95B8Xydnf3Obmx9QZzLTIv+SxdtyErnqb42VPxEUzncjHrO/0id2kKG5zKpnc/SpKwfAQofOjbBWPplrgYQqcIXXmDXLRmcyOslyVIiFjPbW8Qff/WWQvD5TkjYaacm6/rIqBW53J8GSOjXLmKiIptH2OOi1CnjZax8nVLJR0fzyYqygFL5eEwVYd9ovUgQqYuBN49tZuKsHleOEwSnVGLCsff3nTDkz1TQbC5leSn6jZgFjDCcgNYd6asTYGgs mZcmPpM8 M73axX4uYahhI1HU= 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: List-Subscribe: List-Unsubscribe: When CONFIG_NUMA=n, MAX_NUMNODES is always 1 because Kconfig item NODES_SHIFT depends on NUMA. So in !NUMA version of build_zonelists(), no need to bother with the two for loop because code execution won't enter them ever. Here, remove those unneeded codes in !NUMA version of build_zonelists(). Signed-off-by: Baoquan He --- v1->v2: Remove the unused local variables to fix lkp reported warning. mm/page_alloc.c | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 14d39f34d336..d35b4cbeffbd 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5180,37 +5180,13 @@ static void setup_min_slab_ratio(void); static void build_zonelists(pg_data_t *pgdat) { - int node, local_node; struct zoneref *zonerefs; int nr_zones; - local_node = pgdat->node_id; - zonerefs = pgdat->node_zonelists[ZONELIST_FALLBACK]._zonerefs; nr_zones = build_zonerefs_node(pgdat, zonerefs); zonerefs += nr_zones; - /* - * Now we build the zonelist so that it contains the zones - * of all the other nodes. - * We don't want to pressure a particular node, so when - * building the zones for node N, we make sure that the - * zones coming right after the local ones are those from - * node N+1 (modulo N) - */ - for (node = local_node + 1; node < MAX_NUMNODES; node++) { - if (!node_online(node)) - continue; - nr_zones = build_zonerefs_node(NODE_DATA(node), zonerefs); - zonerefs += nr_zones; - } - for (node = 0; node < local_node; node++) { - if (!node_online(node)) - continue; - nr_zones = build_zonerefs_node(NODE_DATA(node), zonerefs); - zonerefs += nr_zones; - } - zonerefs->zone = NULL; zonerefs->zone_idx = 0; }