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) {