From patchwork Thu Mar 26 22:24:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11461357 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 B1C9C159A for ; Thu, 26 Mar 2020 22:24:51 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 74F9C2082E for ; Thu, 26 Mar 2020 22:24:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JTMMyrGu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 74F9C2082E 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 A1E8C6B000A; Thu, 26 Mar 2020 18:24:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9CF876B000C; Thu, 26 Mar 2020 18:24:50 -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 8E5446B000D; Thu, 26 Mar 2020 18:24:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0048.hostedemail.com [216.40.44.48]) by kanga.kvack.org (Postfix) with ESMTP id 77A846B000A for ; Thu, 26 Mar 2020 18:24:50 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 4D04ABEF9 for ; Thu, 26 Mar 2020 22:24:50 +0000 (UTC) X-FDA: 76638944340.18.price63_474fb00c7ad1e X-Spam-Summary: 2,0,0,a4b59e7b5fcf57db,d41d8cd98f00b204,richard.weiyang@gmail.com,,RULES_HIT:41:355:379:541:800:960:973:988:989:1260:1345:1437:1534:1540:1711:1730:1747:1777:1792:2194:2198:2199:2200:2393:2559:2562:2731:3138:3139:3140:3141:3142:3352:3866:3867:4321:5007:6261:6642:6653:7514:9413:10004:11026:11658:11914:12043:12296:12297:12517:12519:12555:12895:12986:13069:13311:13357:14181:14384:14394:14687:14721:21080:21324:21444:21627:21666:30054,0,RBL:209.85.128.66:@gmail.com:.lbl8.mailshell.net-62.18.0.100 66.100.201.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: price63_474fb00c7ad1e X-Filterd-Recvd-Size: 3521 Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Thu, 26 Mar 2020 22:24:49 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id d198so9219212wmd.0 for ; Thu, 26 Mar 2020 15:24:49 -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; bh=FAoCzyrdY1LBflFj0Bs5Q8Nrdecy48mQMVZ+2E8qNH8=; b=JTMMyrGuyHsBCTErKJAGpX8ivePahwROd1sXO3axLXyvZ1H/EicEtW8tGyy6iEccrT xVHFhx2L738y23EtcpvAwXwcxoYCGbsFPGCAwqsqcHaEYyX43djUDNyrOSMf0TXuBqj9 3+TDxxOQjrNCUrH7nRTTq3+SgsvI1pErv2nFd1z4lz69U27kiOKUsTpGq4varX++wjLl mfV+plZAc3strnoQy3zPzdtW7HcqrhX24rUDnvr2UV2r97tB7iWtbPPMfrLLs7o02lq9 BqWuP9cIuCELntO8AV2KfsDsaL07eOudrJP9WEJOmDLRg0j5AFE4QBuUkptVOZgpxrNt 13mw== 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; bh=FAoCzyrdY1LBflFj0Bs5Q8Nrdecy48mQMVZ+2E8qNH8=; b=DGjW9oiDlb/jnjutZZAHwMpYgWSE+DzzdAHMeuHoCmkA49NlOFtjI+Oct5+7k5c+1w qJO8YE4M7vxZUQkGX1NCrhRmtrP09slLV0explChxKf2GZ77G2UekddWNXQfgKwyYCs4 Y3eVEa2/Y+GZJdSca+tdxJLOaojyWq6WIn23nP51RcEDR1bVHV/hLffsk4AMTjtvF6H2 FlxLkmthVyKlVmFbhSbPB75fwrKnzvIpiRCZkUi2EpKtvqVOGe75ymgkHRvcT8BLJa4+ 1Oroej/LMrXioH8xJ7dIPhOED3LHeCORKCajEGCS7CEsd/SFQc7yd+EBDcOnLb0Er3fE N6kA== X-Gm-Message-State: ANhLgQ3TsRSX98/pfq1kDSvm37xDaSaqIllRejtDEQ1mfQH46zMWdQVp MVEqDSK110GUNH2Dh3gEwM8Epxa6 X-Google-Smtp-Source: ADFU+vvMyEi9mdN1lTnZ9Kt/xM9PP20O2+s0UWDof1+uc8SqBbmOdoNH86tbnHs9mktJhDxjnt+Qrg== X-Received: by 2002:a1c:cc0a:: with SMTP id h10mr2063353wmb.127.1585261488638; Thu, 26 Mar 2020 15:24:48 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id s15sm5506680wrt.16.2020.03.26.15.24.47 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 26 Mar 2020 15:24:48 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Wei Yang Subject: [PATCH 1/2] mm/page_alloc.c: leverage compiler to zero out used_mask Date: Thu, 26 Mar 2020 22:24:44 +0000 Message-Id: <20200326222445.18781-1-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 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 used_mask before getting node order, 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 0e823bca3f2f..2144b6ceb119 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -5587,14 +5587,13 @@ static void build_zonelists(pg_data_t *pgdat) { static int node_order[MAX_NUMNODES]; int node, load, nr_nodes = 0; - nodemask_t used_mask; + nodemask_t used_mask = {.bits = {0}}; int local_node, prev_node; /* NUMA-aware ordering of nodes */ local_node = pgdat->node_id; load = nr_online_nodes; prev_node = local_node; - nodes_clear(used_mask); memset(node_order, 0, sizeof(node_order)); while ((node = find_next_best_node(local_node, &used_mask)) >= 0) { 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.