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 6E4A3C2D0CD for ; Wed, 21 May 2025 13:38:29 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E67F66B009F; Wed, 21 May 2025 09:38:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E19B76B00A0; Wed, 21 May 2025 09:38:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D07FB6B00A1; Wed, 21 May 2025 09:38:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B23436B009F for ; Wed, 21 May 2025 09:38:28 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5F818140577 for ; Wed, 21 May 2025 13:38:28 +0000 (UTC) X-FDA: 83467019496.04.F4D5160 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by imf07.hostedemail.com (Postfix) with ESMTP id F3D464000F for ; Wed, 21 May 2025 13:38:25 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="feXNF1/T"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=M084V+jA; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="feXNF1/T"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=M084V+jA; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf07.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1747834706; a=rsa-sha256; cv=none; b=40s4CN2UjLFPXvShwzmxzbHu3oya5QaAUsA1CJc9CKctShj9iibbpr+ghqhqHLc+AJWioD UBos+TEvmJy/FzA8OQDWpNjT0vUFQjxyE3QN4vIotlbSORk2KD2En5h9GDdzbfCh9deK9D gobUYFAD1ERGsYDreIn+ieQT4Ht2M1M= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="feXNF1/T"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=M084V+jA; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="feXNF1/T"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=M084V+jA; dmarc=pass (policy=none) header.from=suse.de; spf=pass (imf07.hostedemail.com: domain of osalvador@suse.de designates 195.135.223.131 as permitted sender) smtp.mailfrom=osalvador@suse.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1747834706; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6Dhfg3H/kMqcAQUy5NiNon0brigmHV98r+/CIaPhl+U=; b=UxwO+wHWP1+a6ybYPSF2V4jlFmBg02u4mZLnXmRyhFYh0vn6As8pxOukeLmK66941SZuxf 4VfUoQKCaD2pVgjs8HpsenQV/M9TR2BQwpGBHid+ZXz8AuolePKqVKA87iQTtnkqXYgD1K VZaMK27zvJfwuIG+x3eOjiWPFP1dmog= Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 27AE41F8AE; Wed, 21 May 2025 13:38:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1747834704; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6Dhfg3H/kMqcAQUy5NiNon0brigmHV98r+/CIaPhl+U=; b=feXNF1/TetZfXPNofNc8bq4KpoSdU0iW6BUKlAMUvZ4kcg5RAJkxVYBEtNIQx061FHlDBP lVxNH+kgk9B10cWODA18n8D0ZHZCrl5tXy30YRzJKyg8HLN6X3FJI7ja9EC7NRkeNsosLe dJIpa8guhtSPTgLrogKS9qHYN5rvIaE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1747834704; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6Dhfg3H/kMqcAQUy5NiNon0brigmHV98r+/CIaPhl+U=; b=M084V+jAm0VBZfhv64XyxAANc4FtfGQxsMZUpKI10JOKzUxLryKEEZKuXrqVfQyH4ya8sd 2XrgJsMeD+CzZFAQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1747834704; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6Dhfg3H/kMqcAQUy5NiNon0brigmHV98r+/CIaPhl+U=; b=feXNF1/TetZfXPNofNc8bq4KpoSdU0iW6BUKlAMUvZ4kcg5RAJkxVYBEtNIQx061FHlDBP lVxNH+kgk9B10cWODA18n8D0ZHZCrl5tXy30YRzJKyg8HLN6X3FJI7ja9EC7NRkeNsosLe dJIpa8guhtSPTgLrogKS9qHYN5rvIaE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1747834704; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=6Dhfg3H/kMqcAQUy5NiNon0brigmHV98r+/CIaPhl+U=; b=M084V+jAm0VBZfhv64XyxAANc4FtfGQxsMZUpKI10JOKzUxLryKEEZKuXrqVfQyH4ya8sd 2XrgJsMeD+CzZFAQ== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id D260713888; Wed, 21 May 2025 13:38:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id vZxXMk/XLWiGBwAAD6G6ig (envelope-from ); Wed, 21 May 2025 13:38:23 +0000 Date: Wed, 21 May 2025 15:38:22 +0200 From: Oscar Salvador To: Joshua Hahn Cc: gourry@gourry.net, akpm@linux-foundation.org, harry.yoo@oracle.com, ying.huang@linux.alibaba.com, honggyu.kim@sk.com, yunjeong.mun@sk.com, gregkh@linuxfoundation.org, rakie.kim@sk.com, rafael@kernel.org, lenb@kernel.org, dan.j.williams@intel.com, Jonathan.Cameron@huawei.com, dave.jiang@intel.com, horen.chuang@linux.dev, hannes@cmpxchg.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-mm@kvack.org, kernel-team@meta.com Subject: Re: [PATCH v9] mm/mempolicy: Weighted Interleave Auto-tuning Message-ID: References: <20250520141236.2987309-1-joshua.hahnjy@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250520141236.2987309-1-joshua.hahnjy@gmail.com> X-Spamd-Bar: / X-Rspamd-Action: no action X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: F3D464000F X-Rspam-User: X-Stat-Signature: 6mrmg4usstz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JrDA3Rf5ZOaOvPsg36XhtU0yDUbig7CJN7fyIBqlGgqEHIf9BpzHUiFCBDaH0DgiES+MUi3jxb5agrEexkHEsdli7nSUPenXl/9CWkJsgR5LR2ibEWb6Sux2vEHmVXYwTtzYhgJxBChYdsdpuY1RiXe29dihARCx/0Q4qsN4baLef3lRvNBfT6zgRg25shdC1btZqMvWGma5cYmcrJPwYWXXsxuREKRx3gI6kNrJjl9uWViwZUbkRWDQSNh6EByvCNVCEjumw2n99oFB+iwTkiLM+6DmgLomCMwu3glvAvZNw1RE4kJ76E8vf2eogk9LAnQXdXADtJoYhTZR1BrPgMWitQHmJvOZGV7JIexd3iQZINsSs4RnoDuGfbN0Q/BsLIh0O4NTHzULDt+W+Deyi3Wy2PUYImmYUAZN2gzfkMmtWWqYHBZwP8K9crn6glkocTpDaCfw9G3HIxP7I+rWH2dwXdOHtwodFyI5nI/MLUrNulNPPaEMN/jJCn5TgzGxMRdb82HocB0boSIuzk7jrQOTWOgflM0XnMs4GoQJN+FMd5QbEQyAT14dW2 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: List-Subscribe: List-Unsubscribe: On Tue, May 20, 2025 at 07:12:35AM -0700, Joshua Hahn wrote: > On machines with multiple memory nodes, interleaving page allocations > across nodes allows for better utilization of each node's bandwidth. > Previous work by Gregory Price [1] introduced weighted interleave, which > allowed for pages to be allocated across nodes according to user-set ratios. > > Ideally, these weights should be proportional to their bandwidth, so > that under bandwidth pressure, each node uses its maximal efficient > bandwidth and prevents latency from increasing exponentially. > > Previously, weighted interleave's default weights were just 1s -- which > would be equivalent to the (unweighted) interleave mempolicy, which goes > through the nodes in a round-robin fashion, ignoring bandwidth information. > > This patch has two main goals: > First, it makes weighted interleave easier to use for users who wish to > relieve bandwidth pressure when using nodes with varying bandwidth (CXL). > By providing a set of "real" default weights that just work out of the > box, users who might not have the capability (or wish to) perform > experimentation to find the most optimal weights for their system can > still take advantage of bandwidth-informed weighted interleave. > > Second, it allows for weighted interleave to dynamically adjust to > hotplugged memory with new bandwidth information. Instead of manually > updating node weights every time new bandwidth information is reported > or taken off, weighted interleave adjusts and provides a new set of > default weights for weighted interleave to use when there is a change > in bandwidth information. > > To meet these goals, this patch introduces an auto-configuration mode > for the interleave weights that provides a reasonable set of default > weights, calculated using bandwidth data reported by the system. In auto > mode, weights are dynamically adjusted based on whatever the current > bandwidth information reports (and responds to hotplug events). > > This patch still supports users manually writing weights into the nodeN > sysfs interface by entering into manual mode. When a user enters manual > mode, the system stops dynamically updating any of the node weights, > even during hotplug events that shift the optimal weight distribution. > > A new sysfs interface "auto" is introduced, which allows users to switch > between the auto (writing 1 or Y) and manual (writing 0 or N) modes. The > system also automatically enters manual mode when a nodeN interface is > manually written to. > > There is one functional change that this patch makes to the existing > weighted_interleave ABI: previously, writing 0 directly to a nodeN > interface was said to reset the weight to the system default. Before > this patch, the default for all weights were 1, which meant that writing > 0 and 1 were functionally equivalent. With this patch, writing 0 is invalid. > > [1] https://lore.kernel.org/linux-mm/20240202170238.90004-1-gregory.price@memverge.com/ > > Suggested-by: Yunjeong Mun > Suggested-by: Oscar Salvador > Suggested-by: Ying Huang > Suggested-by: Harry Yoo > Tested-by: Honggyu Kim > Reviewed-by: Honggyu Kim > Reviewed-by: Harry Yoo > Reviewed-by: Huang Ying > Co-developed-by: Gregory Price > Signed-off-by: Gregory Price > Signed-off-by: Joshua Hahn Acked-by: Oscar Salvador -- Oscar Salvador SUSE Labs