From patchwork Fri Mar 27 22:01:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11463159 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 5D940913 for ; Fri, 27 Mar 2020 22:01:45 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2057C2072F for ; Fri, 27 Mar 2020 22:01:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O/TUZja2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2057C2072F 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 496D06B0010; Fri, 27 Mar 2020 18:01:44 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 446CF6B0036; Fri, 27 Mar 2020 18:01:44 -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 35E646B0037; Fri, 27 Mar 2020 18:01:44 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0170.hostedemail.com [216.40.44.170]) by kanga.kvack.org (Postfix) with ESMTP id 21EE46B0010 for ; Fri, 27 Mar 2020 18:01:44 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id DFD1C181AD0A3 for ; Fri, 27 Mar 2020 22:01:43 +0000 (UTC) X-FDA: 76642514886.21.fly07_494b1b3c92f4a X-Spam-Summary: 2,0,0,5a05e9670818fc5c,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:3138:3139:3140:3141:3142:3352:3866:3872:4321:5007:6261:6653:7514:7903:9413:10004:11026:11473:11658:11914:12043:12296:12297:12517:12519:12555:12895:13069:13311:13357:14181:14384:14687:14721:21080:21324:21444:21627:21666:30054,0,RBL:209.85.221.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: fly07_494b1b3c92f4a X-Filterd-Recvd-Size: 3610 Received: from mail-wr1-f66.google.com (mail-wr1-f66.google.com [209.85.221.66]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 22:01:43 +0000 (UTC) Received: by mail-wr1-f66.google.com with SMTP id s1so13387554wrv.5 for ; Fri, 27 Mar 2020 15:01:43 -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=eTSWsRe+abYo5Q3Wjbmc6XN3lWlOvN/WxCYogj6bEeQ=; b=O/TUZja2YQbTR2MQe2O/+i3o5XBdDGDXbI04IBdld8DfWXT1YHRrtg9UYtv2RMMS+b LkUKoIZKnFAki+Tc7YHvgzbUTsQtS+nOs28cuEQce6lbkM8ZUxvluTbI/aAPT8+cniu1 z3MkANBXfoTmrvW4aExbl9KJsWhbM/Z1xS7QlnpciMxcwQZuJzEeCe5gyq2JjNcQmBMu lxNW7JIry0nzsweknTVGNENhJNpoehU3pz0MYt1oA98+BxoYAQ0Akwgvg36g231GiveM i9zchGjEkFunSx7vO5s8DqEaFVyotANoAXVHB3TP08nhtlBgj/7ZF7m7wWEwse1hq4EG ruRg== 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=eTSWsRe+abYo5Q3Wjbmc6XN3lWlOvN/WxCYogj6bEeQ=; b=UkCl9t/xyTr8RYxT9PGj7vwoUTeI3EvjP25TLgj8U3JRCS4vy4KRQeNZVo5T+plV1H /4j41Q8CtyjtDCjy+EiSa0Kia3gvpFvZySgHNXibEyPOWUN5DAd6JNPmRTuLqfSfuaTR DwUD1qI3cNM46B4whovVLlv041foMefVeybI0wJYIjl6GP4EV103NBYUK0UxnRtEXZeN h88i5YuhXPIEywbuYhO1GALhZTSNmsEp3t9r2tEJeKkuRqS9EHmB80WUM8qAqDUopMZA 2RgLpBvG2T32hfx+G4gC1Gaz6BqBAzrcsUCzG47AY3lTb6XjXIYMocZKQZHpRzLszqAJ mC3g== X-Gm-Message-State: ANhLgQ3y3PEDNyjEKKvsU/2NyqLUMaQIDJ9MciC2QawK9TuUKZpIF4Uf sV/LOBuXeQ8xVLzlYFaTOVA= X-Google-Smtp-Source: ADFU+vuKMRzAFYnr9n+j4lDMfaJF3f9pk6VBECs97XO6gsauwAapLshjF4PrYgtS+w6KzVFWDCZAqQ== X-Received: by 2002:adf:d0cb:: with SMTP id z11mr1667954wrh.1.1585346502328; Fri, 27 Mar 2020 15:01:42 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id l83sm9670639wmf.43.2020.03.27.15.01.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 15:01:41 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jgg@ziepe.ca, david@redhat.com, Wei Yang Subject: [Patch v2 1/2] mm/page_alloc.c: use NODE_MASK_NONE define used_mask Date: Fri, 27 Mar 2020 22:01:20 +0000 Message-Id: <20200327220121.27823-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: For all 0 nodemask_t, we have already define macro NODE_MASK_NONE. Leverage this instead of clear it at run time. Signed-off-by: Wei Yang --- v2: use NODE_MASK_NONE as suggested by David Hildenbrand --- 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 ef790dfad6aa..dfcf2682ed40 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 = NODE_MASK_NONE; 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 Fri Mar 27 22:01:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yang X-Patchwork-Id: 11463161 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 1DBBA913 for ; Fri, 27 Mar 2020 22:01:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DECEF2073B for ; Fri, 27 Mar 2020 22:01:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BpllLOss" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DECEF2073B 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 02A6E6B0032; Fri, 27 Mar 2020 18:01:47 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id F1BA56B0036; Fri, 27 Mar 2020 18:01:46 -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 DBD176B006C; Fri, 27 Mar 2020 18:01:46 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0176.hostedemail.com [216.40.44.176]) by kanga.kvack.org (Postfix) with ESMTP id C3F4C6B0036 for ; Fri, 27 Mar 2020 18:01:46 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 8948E181AD0A3 for ; Fri, 27 Mar 2020 22:01:46 +0000 (UTC) X-FDA: 76642515012.23.mine97_49acf7ed74b22 X-Spam-Summary: 2,0,0,865574248a58de70,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:11473:11658:11914:12043:12296:12297:12438:12517:12519:12555:12895:12986:13069:13311:13357:14181:14384:14687:14721:21080:21324:21444:21627:21666:30054,0,RBL:209.85.128.67:@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: mine97_49acf7ed74b22 X-Filterd-Recvd-Size: 3833 Received: from mail-wm1-f67.google.com (mail-wm1-f67.google.com [209.85.128.67]) by imf37.hostedemail.com (Postfix) with ESMTP for ; Fri, 27 Mar 2020 22:01:46 +0000 (UTC) Received: by mail-wm1-f67.google.com with SMTP id f74so3216114wmf.0 for ; Fri, 27 Mar 2020 15:01:46 -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=XnLQep2lydjftwMmt6HoIl5lVjdDRVIm/B2qHNSgXII=; b=BpllLOssvHng2UrUTpZ8HD5uh0iHoPm0xW5pzyg910YurEuPaXzvxN9kcEyxiUYHHb pm+4GooXP881cTpknMX0aMtiqQ353cNcMFGZc69n4qIgwedXPcd0tVm17NgSxvVwUAwJ tq6sQtDrQpVNXUr7jHrkU0AqedXQLXfENEHXdbq6WKvPom1dWFK7Ie+mPXu+GT1y2jeP NwbEjCzfKhsFppSYBqt9apVdVWA2Wk0St1VsfjCIjtrg8u1mxn0hbpa28w1hZebMDCdq JU8ZehegVn88bcluyOprHYxGWh+IgRmaSlgsPSSXUHqJtAsg/XlPW2RLdT5sj2KVnlFR 4G1w== 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=XnLQep2lydjftwMmt6HoIl5lVjdDRVIm/B2qHNSgXII=; b=V1fIP2JmUeKP4uNvCeOoUKONO4Z1+cnvhKupN9R5yNeE/yNKGbFICl9ahBbQHyw++R q9qdi5ihV3QQOOZwbmitNeJ5WKJiSeX6vOTACmGW8pptFebwlDq+mDrH3e0WQXfYK0nC zzcd/w52uQsVA7HgivcJrXUZPLFXBBa/7P17RnrAKlJ2RKmjNSlI4FU02PSQeM9JRZ3P a/7b6GoMEyJa9WpWe1vekfEy/A1E97WzP9AtE9gaBJeI6TPwfDxw3NPAbX3fHGeOecBB x3Kt1YrP7QlUEO2QfDzsMxu/GNuD0jkUBPC1qiXuHCkfMf2hHGj2bLuRXLWZ0U2doOOE /NsA== X-Gm-Message-State: ANhLgQ3s5hDd5qWvX7PLIuX8w5/szDmbkDsZdc1pIJJrPb0cONJnhAsS Seh/uon/xDGNYISeYh9N1jY= X-Google-Smtp-Source: ADFU+vt/HkTH78PKwAOIbtRVmwgtK8/TzNy0i9xLfALHCE1xvdi6K+3teolQyt9PMe5QoSP2uFv7EQ== X-Received: by 2002:a1c:2605:: with SMTP id m5mr833534wmm.184.1585346503517; Fri, 27 Mar 2020 15:01:43 -0700 (PDT) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id a186sm9522774wmh.33.2020.03.27.15.01.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Mar 2020 15:01:42 -0700 (PDT) From: Wei Yang To: akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, jgg@ziepe.ca, david@redhat.com, Wei Yang Subject: [Patch v2 2/2] mm/page_alloc.c: define node_order with all zero Date: Fri, 27 Mar 2020 22:01:21 +0000 Message-Id: <20200327220121.27823-2-richard.weiyang@gmail.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20200327220121.27823-1-richard.weiyang@gmail.com> References: <20200327220121.27823-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 dfcf2682ed40..49dd1f25c000 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 = NODE_MASK_NONE; 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.