From mboxrd@z Thu Jan 1 00:00:00 1970 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 CE522C433EF for ; Mon, 11 Apr 2022 10:52:36 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 259A76B0072; Mon, 11 Apr 2022 06:52:36 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2094D6B0073; Mon, 11 Apr 2022 06:52:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0AA806B0074; Mon, 11 Apr 2022 06:52:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.26]) by kanga.kvack.org (Postfix) with ESMTP id EC2786B0072 for ; Mon, 11 Apr 2022 06:52:35 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id B8DC021A33 for ; Mon, 11 Apr 2022 10:52:35 +0000 (UTC) X-FDA: 79344284670.01.A1A81B1 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf13.hostedemail.com (Postfix) with ESMTP id 2524A2000A for ; Mon, 11 Apr 2022 10:52:34 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id C93F3210E6; Mon, 11 Apr 2022 10:52:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1649674353; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AWtCIBB4S1i9xOKnlQ7Bx8acwkijM6XuceowTX7B+2o=; b=0uCdYDDm5z0dIqf03aMP0bU5Ktrf/VkWFK6kj2slNsxnSbTphiI4b+ctdXAwOR0gK1Sj3J GenPYw4d4LLTkuejYXUAsnZbt2y9MYoM2VNohDrtX0fN5CYbwfBl8mgL0/zFICvozqfKvA WmjQWkAwd9700yrDNSKC9LsOHCSbIe4= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1649674353; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=AWtCIBB4S1i9xOKnlQ7Bx8acwkijM6XuceowTX7B+2o=; b=Zj2GFWas0zu1/4cWRNsizUsn8+zfTsCH1OPUInGvyG43fk29Mn1Kvc1SNZgdOPlW2jLx3V +SV5f2NkZ9sPWTBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id AE23013AB5; Mon, 11 Apr 2022 10:52:33 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id jB7WKXEIVGImagAAMHmgww (envelope-from ); Mon, 11 Apr 2022 10:52:33 +0000 Message-ID: <39bd76b2-5e84-3b7e-c3d6-e8e834d96035@suse.cz> Date: Mon, 11 Apr 2022 12:52:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [Patch v2 2/2] mm/page_alloc: not necessary to multiply MAX_NODE_LOAD Content-Language: en-US To: Wei Yang , David Hildenbrand Cc: akpm@linux-foundation.org, linux-mm@kvack.org, Oscar Salvador References: <20220408025947.1619-1-richard.weiyang@gmail.com> <20220408025947.1619-2-richard.weiyang@gmail.com> <20220408230726.qjz7x5wvkxsurvgq@master> From: Vlastimil Babka In-Reply-To: <20220408230726.qjz7x5wvkxsurvgq@master> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Stat-Signature: 3bto6qohkwdz83h11eghfgwc3e6qqhoq Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=0uCdYDDm; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=Zj2GFWas; dmarc=none; spf=pass (imf13.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 2524A2000A X-HE-Tag: 1649674354-727985 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: On 4/9/22 01:07, Wei Yang wrote: > On Fri, Apr 08, 2022 at 10:09:48AM +0200, David Hildenbrand wrote: >>On 08.04.22 04:59, Wei Yang wrote: >>> Since we just increase a constance of 1 to node penalty, it is not >>> necessary to multiply MAX_NODE_LOAD for preference. >>> >>> This patch also remove the definition. >>> >>> [vbabka@suse.cz: suggests] >>> >>> Signed-off-by: Wei Yang >>> CC: Vlastimil Babka >>> CC: David Hildenbrand >>> CC: Oscar Salvador >>> --- >>> 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 86b6573fbeb5..ca6a127bbc26 100644 >>> --- a/mm/page_alloc.c >>> +++ b/mm/page_alloc.c >>> @@ -6170,7 +6170,6 @@ int numa_zonelist_order_handler(struct ctl_table *table, int write, >>> } >>> >>> >>> -#define MAX_NODE_LOAD (nr_online_nodes) >>> static int node_load[MAX_NUMNODES]; >>> >>> /** >>> @@ -6217,7 +6216,7 @@ int find_next_best_node(int node, nodemask_t *used_node_mask) >>> val += PENALTY_FOR_NODE_WITH_CPUS; >>> >>> /* Slight preference for less loaded node */ >>> - val *= (MAX_NODE_LOAD*MAX_NUMNODES); >>> + val *= MAX_NUMNODES; >>> val += node_load[n]; >>> >>> if (val < min_val) { >> >>I feel like this should be squashed into the previous patch. It has the >>same effect of making this code independent of nr_online_nodes. And I >>had to scratch my head a couple of times in patch #1 why the change in >>patch #1 is fine with thus remaining in place. >> >> >>Having that said, I consider this code highly unnecessary >>over-complicated at first sight. Removing some of the magic most >>certainly is very welcome. >> >>This semantics of the global variable node_load[] remains mostly >>mysterious for me. Looks like after this patch(es), it would be "how many times was this node picked as the first fallback out of nodes with the same distance"? >> > > So the suggestion is a v3 with #1 and #2 squashed? Yes, and I agree with the suggestion. >>-- >>Thanks, >> >>David / dhildenb >