From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from invmail4.hynix.com (exvmail4.skhynix.com [166.125.252.92]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0F7C6204C11; Mon, 3 Feb 2025 12:59:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=166.125.252.92 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738587586; cv=none; b=OLCcaAYRBoj1FV1sm0H31huNmawph9ygjZjDZ7kKfQY7prvEOmdPpanQyhCmly+loEQo7o89SnV0nHiYuqY5NVuy/f5Ys/pI447hY2GB6KxZYVXzGH8RHBff5BXUa7A67Dg15Rq3jVw3ACblAUGa96DWcpfcwtayKOPYtcUmp6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738587586; c=relaxed/simple; bh=/y/y+yMPC+kxSkrXxO3Guy9FZRh/OM4w1hP6Ch7QS1Y=; h=Message-ID:Date:MIME-Version:Cc:Subject:To:References:From: In-Reply-To:Content-Type; b=OUyX8aAf/02//BMdJmiiLrlM0xG2dggGhRRBT+Mtd1tNHJpwYvDjUNLF0rYx7dWlfUmsJNy8wk+l/TPXaeDrwYpSDhZKRP+Lxz/T7Uu1/fHSHVBLQBl9Q09q1Ir+p7rEFEu9nQ8dpZ/R8TOhti3Jj3RHLIS3RG5wWqJZ6lu09Fc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com; spf=pass smtp.mailfrom=sk.com; arc=none smtp.client-ip=166.125.252.92 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=sk.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sk.com X-AuditID: a67dfc5b-3c9ff7000001d7ae-5c-67a0ba2e234c Message-ID: Date: Mon, 3 Feb 2025 21:44:29 +0900 Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: kernel_team@skhynix.com, Gregory Price , ying.huang@linux.alibaba.com, rafael@kernel.org, lenb@kernel.org, gregkh@linuxfoundation.org, akpm@linux-foundation.org, rakie.kim@sk.com, 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, 42.hyeyoo@gmail.com, Honggyu Kim Subject: Re: [PATCH v4] Weighted Interleave Auto-tuning To: Joshua Hahn References: <20250202141247.2219681-1-joshua.hahnjy@gmail.com> Content-Language: ko From: Honggyu Kim In-Reply-To: <20250202141247.2219681-1-joshua.hahnjy@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFIsWRmVeSWpSXmKPExsXC9ZZnka7ergXpBmtWKVpM7DGwmLN+DZvF 9KkXGC1O3Gxks/h59zi7RfPi9WwWqzf5WszZeYfZ4nb/OVaLVQuvsVkc3zqP3WLfRaCGnQ/f slks39fPaHF51xw2i3tr/rNazP0yldli9ZoMByGPw2/eM3vsnHWX3aO77TK7R8uRt6wei/e8 ZPLYtKqTzWPTp0nsHidm/Gbx2PnQ0mNhw1Rmj/1z17B7nLtY4fF5k1wAbxSXTUpqTmZZapG+ XQJXxue9uxgL/olUzL01gbGB8bZAFyMnh4SAiUTv4ndMMPabuTvYQGxeAUuJSysfsoPYLAIq Er/ndLFDxAUlTs58wgJiiwrIS9y/NQMozsXBLPCaWeLV1HVADgeHsIC5xNflKiA1IgKaEida JzGD2EICdhKHLjWD2cwCIhKzO9vAbDYBNYkrLyeB3cApYC/R3X+fHaLGTKJraxcjhC0vsf3t HGaQXRIC59gl2tfsZYU4WlLi4IobLBMYBWchuW8Wkh2zkMyahWTWAkaWVYxCmXlluYmZOSZ6 GZV5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0J7H/ r2Rc6/uXkuC4a/nsnpxJRVyH/26SVo4sFeP8qrVotmCH7q8oz+uad+6o3154bKFSdmnNQjcL zbLOgq/Bdz/xmKy3mj2Bj2OZYVznvVkLHkzy3Xz8V+aJ57nqR5bfrrjc5rq9LrdISPC/UZjT b47pjC9PmvsZlh75rb/sxiQlluKMREMt5qLiRACl6TpzzQIAAA== X-CFilter-Loop: Reflected Hi Joshua, On 2/2/2025 11:12 PM, Joshua Hahn wrote: > Hi Honggyu, > > On Sun, 2 Feb 2025 22:51:34 +0900 Honggyu Kim wrote: > >> On 2/2/25 01:53, Gregory Price wrote: >>> On Sat, Feb 01, 2025 at 11:49:31AM -0500, Gregory Price wrote: >>>>> 1. the auto mode set the weights as 10:5:1 for node{0-2}. >>>>> 2. node2 is offlined, then recalculation makes it as 2:1 for node{0,1}. >>> >>> Point of clarification here: a hot-unplug event won't cause >>> recalculation. >>> >>> What actually causes re-weight is hot-plug reporting new capacity. >> >> So do you mean re-weight is done only when a new node is onlined while >> offline doesn't trigger re-weight? >> >> I see node_set_perf_attrs() does recalculation by calling >> mempolicy_set_node_perf(), then reduce_interleave_weights(). >> >> But I'm not sure if the re-weight is done via node_set_perf_attrs() only >> when a new node is onlined. >> >> Could you please explain where I can find it? > > Just chiming in to add some clarification: > Your analysis above is correct; reduce_interleave_weights() is only > called in 2 spots: once when the mode is switched from manual --> auto, > and the other when new bandwidth data is available, which calls > node_set_perf_attrs() and so on. In all other scenarios, iw_table is > preserved, and all values inside remain the same without manual changes. Yeah, this part is clear. > A node offlining (or even onlining with no new bandwidth information) > will just mean that the node inherits whatever value is stored in > iw_table at that moment, whether that contains the default values > created on init or the last values that it had taken. It looks the call sequence is as follows. cxl_region_perf_attrs_callback() -> cxl_region_update_coordinates() -> node_set_perf_attrs() -> mempolicy_set_node_perf() -> reduce_interleave_weights() I haven't searched all the paths of cxl_region_perf_attrs_callback() via cxlr->memory_notifier.notifier_call callback pointer, but maybe this function is not called when a node is offlined, then I get node offlining doesn't trigger re-weight calculation. By the way, do you test it using CXL hardware or using qemu? > >>> So in this scenario, the weight will remain the same for node2. >> >> If it's true, my scenario is wrong. >> >> Thanks, >> Honggyu >> >>> >>>>> 3. the auto sysfs interface is set to 0 to make it manual mode. > > Please let me know if this makes sense. Thank you for your review > as always, and have a great day! > Joshua Thanks for your response. Have a great day you too! Regards, Honggyu