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 8BCE6C5AD49 for ; Thu, 29 May 2025 16:46:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2A4296B0083; Thu, 29 May 2025 12:46:15 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 27C076B0085; Thu, 29 May 2025 12:46:15 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 191A56B0088; Thu, 29 May 2025 12:46:15 -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 EDB956B0083 for ; Thu, 29 May 2025 12:46:14 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id A7E7A80530 for ; Thu, 29 May 2025 16:46:14 +0000 (UTC) X-FDA: 83496523068.06.8FB57ED Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by imf19.hostedemail.com (Postfix) with ESMTP id D46811A0008 for ; Thu, 29 May 2025 16:46:12 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MNoXC0Of; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1748537172; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=pJwdQdpyc8vAT6FLE2naHj7cCnS1TSfEWliAnG6w05U=; b=hw2Y+aNefaanKMFfgFsACY6NU/Erjs1wuUpJYpJofN6KYfIz8vW0RgZOEWppH+pVc/9XET CCz7gJOLZpNoP4BjW46Uj9CanDUIXhJo03uisS+iPyEQ69pgY6ytlqGPUikp4/hDEE0LSc K6OXIYxQQcyjnAuwEfBm6jnSTksNRLY= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MNoXC0Of; spf=pass (imf19.hostedemail.com: domain of sj@kernel.org designates 172.105.4.254 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=quarantine) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1748537172; a=rsa-sha256; cv=none; b=mFMW1tvc7vz1W52l3uwRqOa+8f2KBnbtPnVzbYK3EKwxy4+/QlNwxlhNzFToKlHCt0IYnR kMtm3JyipL68QmZ7yBMYXZBD9nrE5/5BX1oaF0wpKAIT3edQL2J/h+9dDVvJUc+hqxHE98 yBk4jksFBDrgxXpXIj1cl8D+4BiArPE= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by tor.source.kernel.org (Postfix) with ESMTP id 1626460010; Thu, 29 May 2025 16:46:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 885A7C4CEE7; Thu, 29 May 2025 16:46:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748537171; bh=D7pFpHFbd8b9b6GPBLqRyR4yWUChqilaV2dAhA1yxo0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MNoXC0Of+W7Rlb+xYYkg3fguM3Ih+wwonXIIsuIBtTQeRJo1TEv/jHK6sZnKfNYdf LOMl8AT6R32sh6g52AooPSC/bIiTLuFNcNfRS/s0blF85OCFqZfUpmehCWTQvcNBqb Hnz7JTFEVWlmLzgMEof8ArMJWttIO6/nxclfsqGWzq3P0KJA+GKs5c/wPClYpwTlsq v1RGqE/vlAhJwrN7UTsBBazzogD5awz+FGTOK926cOZpWVOOuhK7EBzrJuLZNSROzB h5E6p0BBlUedujtByc8GPSauywi2KcuFq+Zu5zg8vAZPEUz5ku9m29iqS7nZLcaZIN iDTwrDY8wBkQQ== From: SeongJae Park To: Simon Wang Cc: SeongJae Park , "akpm@linux-foundation.org" , "hannes@cmpxchg.org" , "david@redhat.com" , "mhocko@kernel.org" , "zhengqi.arch@bytedance.com" , "shakeel.butt@linux.dev" , "lorenzo.stoakes@oracle.com" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , "damon@lists.linux.dev" Subject: Re: [PATCH 2/2] mm/damon/sysfs-schemes: add use_nodes_of_tier on sysfs-schemes Date: Thu, 29 May 2025 09:46:08 -0700 Message-Id: <20250529164608.37594-1-sj@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: D46811A0008 X-Stat-Signature: j5k9hxd7kuqmbd3cj1899up75y8cimgd X-Rspam-User: X-HE-Tag: 1748537172-493052 X-HE-Meta: U2FsdGVkX1+fhf7b1h0kY59Eg38U+jgYh10tE0+ykk/YYX3Lhe2DIIyBW/QG4AI2+ppFCskOjtPWIF8YJ2Y2dTuou8HWJ8fCvyyZjfUjqD5CLLaKQJyg6PBxF5iNELXiNOSRxpz3P/QCYtMX1DtyjD9Bzhr9kh7zLhrOBzUsCX7NZyRb9Ol0t/DAaTICMMmI7bdFN4T39MNOuN0ejf1NK3zlxaquNth4KTNDdeFrimvpvG9afkNhcna1iD5vWWPuZs3/YwYKmi+QgnzUfp0P32QfxQiu98gLcmUHDRoVwgHUJVXfphfh14INUnAvHn7JfO2bjS0TnFcYnTmTWLmh29t69K0vzxjA3w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-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 29 May 2025 03:12:13 +0000 Simon Wang (王传国) wrote: > > > This patch adds use_nodes_of_tier under > > > > > /sys/kernel/mm/damon/admin/kdamonds//contexts//schemes// > > > > > > The 'use_nodes_of_tier' can be used to select nodes within the same > > > memory tier of target_nid for DAMOS actions such as > > DAMOS_MIGRATE_{HOT,COLD}. > > > > Could you please elaborate in what setup you think this option is useful, and > > measurement of the usefulness if you have? > > > > I'm asking the above question because of below reasons. My anticiapted > > usage of DAMOS_MIGRATE_{HOT,COLD} is for not only memory tiering but > > generic NUMA node management. And my proposed usage of these for > > memory tiering is making per-node promotion/demotion for gradually > > promoting and demoting pages step by step between node. It could be slow > > but I anticipate such slow but continued promotion/demotion is more > > important for reliable performance on production systems of large time scale. > > And I believe the approach can be applied to general NUMA nodes > > management, once DAMON is extended for per-CPU access monitoring. > > > > I'm not saying this change is not useful, but asking you to give me a chance to > > learn your changes, better. > > I believe some users may want to ​​use only the target node's > memory​​ and reserve other nodes in the same tier for specific > applications. Therefore, I added a switch file use_nodes_of_tier. Thank you for clarifying, Simon. Because this is an ABI change that difficult to revert and therefore we may need to support for long term, I'd like to have more clear theory and/or data if possible. In my humble opinion, above clarification doesn't sound like a strong enough justification for ABI change. More specifically, it would be better if you could answer below questions. Who would be such users, how common the use case would be, and what are the benefit of doing so? Is that only theory? Or, a real existing use case? Can you share measurement of the benefit from this change that measured from real workloads or benchmarks? Is there an alternative way to do this without ABI change? > I think it might be better to set the default value of use_nodes_of_tier to > true (i.e., allow using fallback nodes). What do you think In my humble opinion, we can consider setting it true by default, if we agree the benefit of the change is significant. With only currently given information, I cannot easily say if I think this can really be useful. As asked abovely, more clear thoery and/or real data would be helpful. > > > > > > > Signed-off-by: wangchuanguo > > > --- > > > include/linux/damon.h | 9 ++++++++- > > > include/linux/memory-tiers.h | 5 +++++ > > > mm/damon/core.c | 6 ++++-- > > > mm/damon/lru_sort.c | 3 ++- > > > mm/damon/paddr.c | 19 ++++++++++++------- > > > mm/damon/reclaim.c | 3 ++- > > > mm/damon/sysfs-schemes.c | 31 > > ++++++++++++++++++++++++++++++- > > > mm/memory-tiers.c | 13 +++++++++++++ > > > samples/damon/mtier.c | 3 ++- > > > samples/damon/prcl.c | 3 ++- > > > 10 files changed, 80 insertions(+), 15 deletions(-) > > > > Can we please make this change more separated? Maybe we can split the > > change for memory-tiers.c, DAMON core layer, and DAMON sysfs interface. > > That will make review much easier. > > Yes,I'll split this patch to be 2 patches. Thank you for accepting my suggestion. But I think it deserves 3 patches, each for - memory-tiers.c, - DAMON core layer, and - and DAMON sysfs interface. But, let's further discuss on the high level topic (if this change is really beneficial enough to make ABI change). Thanks, SJ [...]