From patchwork Sat Jan 15 23:00:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 12714433 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 D39FAC4332F for ; Sat, 15 Jan 2022 23:00:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 079156B0088; Sat, 15 Jan 2022 18:00:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 029446B0089; Sat, 15 Jan 2022 18:00:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E5A9B6B009E; Sat, 15 Jan 2022 18:00:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0091.hostedemail.com [216.40.44.91]) by kanga.kvack.org (Postfix) with ESMTP id D646A6B0088 for ; Sat, 15 Jan 2022 18:00:16 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 91D9F181CBDC7 for ; Sat, 15 Jan 2022 23:00:16 +0000 (UTC) X-FDA: 79034041632.28.B36426E Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41]) by imf04.hostedemail.com (Postfix) with ESMTP id 474A040007 for ; Sat, 15 Jan 2022 23:00:16 +0000 (UTC) Received: by mail-ed1-f41.google.com with SMTP id a18so48670591edj.7 for ; Sat, 15 Jan 2022 15:00:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id; bh=kjbaItt49HeNYKlAAvgAvUBakX33E0u6vY6bifOEKb4=; b=Uc9cRXojj+6mUIOsHJ+HkmjUfU30TXPHtGXyq8egGJ0VXpmuxOKiCiGo5b3txp8czg ZERq3R659QHGatFaPYjrVp8w3ScLYW3iScEcgRM2tdKk7ySAu34Ph1JSXHeOnypxnkX9 yZFSttjGy5C42DP4SMliiBmABHmtdy776sKDmyoOSh7eO2l/Am814i1QMfZoyqs4aShV JKVN+nkoW8Zp5mgbKXSVy0ZULlwsLv57X4GmVRzvpyB/GTIo285VvIdgYWkXGfHJuvSO tccDpuoVXKpo0mI94FS2RMGA8ueXxt5TRamd8rUB0sINcJpHOd0ENlqLxbcVf+Ncvh+k V8Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=kjbaItt49HeNYKlAAvgAvUBakX33E0u6vY6bifOEKb4=; b=B7GIkYbr6F75Eo39XiCDnNffZiw7elsCmf0+mC65Z8fgNhyFbkAvSiXN4j+VbUKiF2 1wuncpBGh+9LMbM/vuKNYnSc7PmJbwYF9cv/sFiOQ7T/2HQ6K7lEHJMnuqHaXE0dc8e7 7oa2gKGJ0trFgfExdsqkgKjEslEfLZPiRdeRDlAyXidccJsRHw9GukW+aCCojyEMfXIo i2G099OOGzyTlGK2W8j99f+NJs/SC06pYk1Tqh3ebVA94eBgDtS0vyLi6uGFebyz1ISy e/Pwb9cmHokfiM1NZLuQL3zplvd9odgtYTXxRBcSQm65Y/Qt336TmrXUacQqMjdStxz3 ooBw== X-Gm-Message-State: AOAM5309knH9JZ7Lh+ykVF6En6jRPmDPT8RKIfn7cvayaN9cbrLkPe75 Qtv+ZBVtiRzwdnAfMRWvI1o= X-Google-Smtp-Source: ABdhPJxT4Tv6oz52W08eKN9B+ubuMQ67i5hKP5HwoRtTuvxWcuu81WX0lvuLnZ7MtO8vTqH+PJ1J3Q== X-Received: by 2002:a17:907:d11:: with SMTP id gn17mr11593470ejc.252.1642287615069; Sat, 15 Jan 2022 15:00:15 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id 16sm2977557ejx.149.2022.01.15.15.00.14 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 15 Jan 2022 15:00:14 -0800 (PST) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, mhocko@suse.com, Wei Yang Subject: [PATCH] mm/page_alloc: clear node_load[] in function build_zonelists Date: Sat, 15 Jan 2022 23:00:02 +0000 Message-Id: <20220115230002.490-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 474A040007 X-Stat-Signature: wqiz1fpx131bkwb1emcw13kr9gngd5h1 Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Uc9cRXoj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf04.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.208.41 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com X-HE-Tag: 1642287616-485449 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: static variable node_load[] is a helper variable during build zonelist. On each turn for building zonelist, node_load[] is cleared. So this is proper to do this in function build_zonelist. Another side effect is, #ifdef CONFIG_NUMA could be removed since node_load[] is only defined when CONFIG_NUMA is set. Signed-off-by: Wei Yang --- mm/page_alloc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c5952749ad40..8245f5a24aad 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -6255,6 +6255,7 @@ static void build_zonelists(pg_data_t *pgdat) prev_node = local_node; memset(node_order, 0, sizeof(node_order)); + memset(node_load, 0, sizeof(node_load)); while ((node = find_next_best_node(local_node, &used_mask)) >= 0) { /* * We don't want to pressure a particular node. @@ -6371,10 +6372,6 @@ static void __build_all_zonelists(void *data) spin_lock(&lock); -#ifdef CONFIG_NUMA - memset(node_load, 0, sizeof(node_load)); -#endif - /* * This node is hotadded and no memory is yet present. So just * building zonelists is fine - no need to touch other nodes.