From patchwork Tue Mar 26 06:11:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 13603607 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 C180CC54E67 for ; Tue, 26 Mar 2024 06:12:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 48E2B6B008A; Tue, 26 Mar 2024 02:12:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 416656B0092; Tue, 26 Mar 2024 02:12:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 291606B0093; Tue, 26 Mar 2024 02:12:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 0FC636B008A for ; Tue, 26 Mar 2024 02:12:01 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id D624912097A for ; Tue, 26 Mar 2024 06:12:00 +0000 (UTC) X-FDA: 81938169600.21.21762FB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf11.hostedemail.com (Postfix) with ESMTP id E67A940008 for ; Tue, 26 Mar 2024 06:11:58 +0000 (UTC) Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="YzZ/AXsP"; spf=pass (imf11.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.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=1711433518; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=NfvcuScu/5j6XehhHJA8UTonv32Il9vPsP21GJ1TIg4=; b=qS0XgIfndMUwbKPh1vD+9Es47au7OmM0eWrfHkbSHpZ0AadNm3U2bJG4A27HFpP2rn1c8E OuAWk6X64s1aF8PL/4Ew5YCLrwTa7MMkK/1ka5feN6AQeHI7CPlXUMftOeBcpcPKbBqf1Q o+ilbWs47F2eNg7Rji5rYSGbfBU84L0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1711433519; a=rsa-sha256; cv=none; b=oBuuF5Ptyl9qk1/AiwCrfZ2YFPNzmsiPFy6uLIaVDU8M4QOz1W23U9EsGZt07JrzMVUpfX A7ygfWov5QA5lToJ8z3QGxdc4d62mY5DecvARKEYwqzKGL48hAvoeNGjvxbJyVbULSMKzC XcY4gM0t0j3DXWoUDKCIld2jyian3ys= ARC-Authentication-Results: i=1; imf11.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="YzZ/AXsP"; spf=pass (imf11.hostedemail.com: domain of bhe@redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=bhe@redhat.com; dmarc=pass (policy=none) header.from=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1711433518; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NfvcuScu/5j6XehhHJA8UTonv32Il9vPsP21GJ1TIg4=; b=YzZ/AXsP1h0vsU0SBnqV5o41JBo4b6KC/PNzn/XS3rmehsOLdVf6vyuKPnLeC5UTVf5U9a uU4ZJaC420VpplWvEG5uU69Mk2NhzWPqw91swCwrz4ZGFvo7jbUiVZnynSvFLJuF0Q7Tnt YXF1i+CklMdhD6gQbB9J241cNgQKMKY= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-643-BHZKVQPNNqCcwRYVUXtxlw-1; Tue, 26 Mar 2024 02:11:54 -0400 X-MC-Unique: BHZKVQPNNqCcwRYVUXtxlw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 1E6971C00B8B; Tue, 26 Mar 2024 06:11:54 +0000 (UTC) Received: from MiWiFi-R3L-srv.redhat.com (unknown [10.72.116.12]) by smtp.corp.redhat.com (Postfix) with ESMTP id E206A107A8; Tue, 26 Mar 2024 06:11:51 +0000 (UTC) From: Baoquan He To: linux-mm@kvack.org Cc: akpm@linux-foundation.org, rppt@kernel.org, mgorman@suse.de, Baoquan He Subject: [PATCH 4/7] mm/page_alloc.c: remove unneeded codes in !NUMA version of build_zonelists() Date: Tue, 26 Mar 2024 14:11:30 +0800 Message-ID: <20240326061134.1055295-5-bhe@redhat.com> In-Reply-To: <20240326061134.1055295-1-bhe@redhat.com> References: <20240326061134.1055295-1-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain X-Rspamd-Queue-Id: E67A940008 X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: swi6hdk77ojwnmtpaf77b35d31zrbxm8 X-HE-Tag: 1711433518-836632 X-HE-Meta: U2FsdGVkX1+GuqCNcx/6lEgQjIRopG6dFCCq/RxWlxS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UwyPRLVrdXs1s32+CZOy5EPGTUL185lXuoRazOqgRdOoCu8/Kb1wVrmnHISNJ+Ck1w7+lCr4Qcm4vkuvYI4DGldpXARWgaOZ887MLhnn3gSm/uGG/4PuI8vXl5u/fWhE 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 --- mm/page_alloc.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 14d39f34d336..fd2b49aed59e 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5190,27 +5190,6 @@ static void build_zonelists(pg_data_t *pgdat) 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; }