From patchwork Thu Mar 26 22:24:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11461359 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1F2F17EA for ; Thu, 26 Mar 2020 22:24:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 661532077D for ; Thu, 26 Mar 2020 22:24:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PNtVMhtU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 661532077D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8E6596B000C; Thu, 26 Mar 2020 18:24:51 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 898446B000D; Thu, 26 Mar 2020 18:24:51 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 787386B000E; Thu, 26 Mar 2020 18:24:51 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0002.hostedemail.com [216.40.44.2]) by kanga.kvack.org (Postfix) with ESMTP id 622586B000C for ; Thu, 26 Mar 2020 18:24:51 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 33F08181AD0A7 for ; Thu, 26 Mar 2020 22:24:51 +0000 (UTC) X-FDA: 76638944382.04.knife84_4771883a2ca3f X-Spam-Summary: 2,0,0,fc0e1f18d3aeb34e,d41d8cd98f00b204,richard.weiyang@gmail.com,,RULES_HIT:41:355:379:541:560:800:960:973:988:989:1260:1345:1359:1437:1534:1541:1711:1730:1747:1777:1792:2194:2198:2199:2200:2393:2559:2562:3138:3139:3140:3141:3142:3352:3866:3867:3872:4321:5007:6261:6653:7514:9413:10004:11026:11658:11914:12043:12296:12297:12438:12517:12519:12555:12895:13069:13311:13357:14181:14384:14394:14687:14721:21080:21324:21444:21627:21666:30054,0,RBL:209.85.128.68:@gmail.com:.lbl8.mailshell.net-66.100.201.100 62.18.0.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: knife84_4771883a2ca3f X-Filterd-Recvd-Size: 3793 Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Mar 2020 22:24:50 +0000 (UTC) Received: by mail-wm1-f68.google.com with SMTP id a9so9903663wmj.4 for ; Thu, 26 Mar 2020 15:24:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ypZyzlrBAG+cLsLy+PU3T0dnOH3TPzYnikBxeCUs2mM=; b=PNtVMhtUOqP8DzyueMCTTgYYrWGu+yFrrmFpnA19hy4ZMZ/s62bZxKhvArlVVOSFQS hrCxqLZJs8FIZZHi6/FbeFe+4566AOXU+65eUYtYGJGRrSP1fRzcxHoR2PuIW8ZWk15+ 3nELe9YQ8rGDue7kr13V4iMg+Ui/yGYCbsCA1yyNj+Fgg0CcobDMvk8HBSA1ojYn1qk9 nXU7EpZVZ/Dtuj9KfD719HX6/KCYayR1l7W5TND7xGjPrECXkIWQ22orEKqqaoU9EkM+ j4dKvLVmaJMqt+dlcdlKdoyBRbRRBzlXVcHIfVX8sK8EkZ/hkwE0zCM+AZkwO+XQo4P9 zD8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=ypZyzlrBAG+cLsLy+PU3T0dnOH3TPzYnikBxeCUs2mM=; b=WFIxVEirtactHSjmv8u2hPN+5ki0MG9NxalIHCz6GGM0W+twAd/26ZMpweq/mGwwPZ PvX3wY4LUe1G106e17aVm3ivsxb0lEe50Sao7qAMbWVhrvrMfYDEg+sG2tWmCZJC7vun wR5ExLcGMpgusslAD6Nh9viquyRjEajMMy4gqazAmT1RZbBYIrp1mo2tClMVEbVVRmhg TvdahPgaOTKFDYnj/Zjo7Mu+EyZQ1XUzRp4SV4AeW8etHrOP0uWjHeTQMmawuK2LFWgw ziYMi9Zq+TwL4I6WONeAQq982FEEWp7ZvFTvP1/4maHvNDlDfptkL0XGx/TqBZaIA/BR ttnw== X-Gm-Message-State: ANhLgQ2mzW0L8LPfXs+l7NTlbjFWl0Ej3Rl+rttr2+ByMxBS/aOL9SFW ORVbnzYRQniQyFnWHOfK3DY= X-Google-Smtp-Source: ADFU+vsHPQH1+HrBFDUdDLpJjUvvAhy2zrl3d4FreyJZGAjpLSFjTA1BKwyta+vrf+MCVIx4unC3qg== X-Received: by 2002:adf:ef51:: with SMTP id c17mr9582651wrp.130.1585261489629; Thu, 26 Mar 2020 15:24:49 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a64sm5312899wmh.39.2020.03.26.15.24.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 15:24:49 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 2/2] mm/page_alloc.c: define node_order with all zero Date: Thu, 26 Mar 2020 22:24:45 +0000 Message-Id: <20200326222445.18781-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200326222445.18781-1-richard.weiyang@gmail.com> References: <20200326222445.18781-1-richard.weiyang@gmail.com> 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: Since we always clear node_order before getting it, we can leverage compiler to do this instead of at run time. Signed-off-by: Wei Yang --- mm/page_alloc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 2144b6ceb119..7a6435cffdb7 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5585,7 +5585,7 @@ static void build_thisnode_zonelists(pg_data_t *pgdat) static void build_zonelists(pg_data_t *pgdat) { - static int node_order[MAX_NUMNODES]; + static int node_order[MAX_NUMNODES] = {0}; int node, load, nr_nodes = 0; nodemask_t used_mask = {.bits = {0}}; int local_node, prev_node; @@ -5595,7 +5595,6 @@ static void build_zonelists(pg_data_t *pgdat) load = nr_online_nodes; prev_node = local_node; - memset(node_order, 0, sizeof(node_order)); while ((node = find_next_best_node(local_node, &used_mask)) >= 0) { /* * We don't want to pressure a particular node.