Received: by 2002:a05:7208:70d5:b0:7f:5597:fa5c with SMTP id q21csp1293816rba; Fri, 22 Mar 2024 09:33:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWmzqdS+VpSgIpPw9+a4K6hH+7XaNsle/YG1HiiyhYyvNtYffbdXYiedKu1fy3MGcabTReXtwVZfhNAfgMMkolw1CqYUOdbJGR0QDADXg== X-Google-Smtp-Source: AGHT+IGTunv6TrX2vZu5IIpjArF28cQPf+VKXtDkk8HEaaoOK/hD2tMc+MofBmfeM3BXDi853TzB X-Received: by 2002:a17:902:d486:b0:1dd:dcd3:662c with SMTP id c6-20020a170902d48600b001dddcd3662cmr4114386plg.4.1711125186973; Fri, 22 Mar 2024 09:33:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711125186; cv=pass; d=google.com; s=arc-20160816; b=Aq36rJ6nM8U60P2273CNEmXtDL17dVkzqbBI+NkMFqTYYL+cgSgPtyHvgX0C1HdiZP ZkA4LipSrcQ6RbAmxk6nlqa6A8z/xFdA5y0teqVhe+Uej0Md45bu0cYcxSONXMIO/6ve 4PKh01RLP+lgS53KwXqCO7I8pQxjaiNs7IPP+VXZXUQGerkm+oKGOwmcoZcV8Ji1Y14L 2Jit9ZVte1EVzNGDSGFNgcqwLxJSWmgh1RdXw5GWERYRQpzqoUIRvDnzAPodN8TJVJXP X/mSCRBpoofe4HENT3FfP/EK2Pm6qvBO92xMhKNY8xHf2voBLZFufROPMN5JmvKDAXm0 LRJw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=Nj1yyhBZ4KPozaWgeyXjTkOgRFxTkkta/+IvzvQW+Pk=; fh=LxBDNYFQF/TTbOUWRCy31dj92z3a7ygk/PK9Z3aKH7g=; b=N9YVsAlxb4pvugX2TciOIrGmXEH1sEu+aKWDn7lzlgi0MFo4s+9t+dlTevuIVknTzL jc2hXj9xb+ZjXuSei7OO6njhBVHfkkV4lEfPv8xW4T9nNJ4ffxox/WTSOArfbPwfhSzA lmea2e7ayJ//ayXIzymx8aUFm9YQ43U+a7L66nZNZEfkR39/Lhf6P02kiZf5fKm5qTXh W9/jufNw1KUVu7F5As5rpIjxm07Owq2iKtD1xC30b9WOPfo3g5f/0f3Q2dIbms0oRyHJ Px70nncJm46WgopfRE4hcteOprGtgGPqhpzryAsxugAG0yfo0VmFJtKeV9i9bXIUuOLO urPw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pmSZoHQN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id q7-20020a170902f78700b001e01a1a8689si2279435pln.142.2024.03.22.09.33.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Mar 2024 09:33:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-111783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pmSZoHQN; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-111783-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-111783-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 74FA4B22841 for ; Fri, 22 Mar 2024 16:32:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 52FF95B698; Fri, 22 Mar 2024 16:32:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pmSZoHQN" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6B3375CDC0; Fri, 22 Mar 2024 16:32:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711125147; cv=none; b=BhEo4fG2rPkhL5x7fbWD93UwEycb0xyvtNZ+l+Up0ejW+hkdq5Knd9GIRQBNT9hmJamIlQaIlr/SYtMbbzbfX7uytumEiRXcHbk9r9xFHS7YeFbwmGDZ7/EUEPPm75yq+1mxkK32f3fEqJTUjzIiVtYglxMeUQNh7KcqeLSh0HY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711125147; c=relaxed/simple; bh=otOiDrXv7vSEtDQG9vjhed+cuW5roGWlH4xO15itNQ0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=jVNd8U23+uMWS/3AsrAKU7Jv0jMUXfvgbgPKXZSNL/xnPeOFQKZgnnK3oMGBREUPqCyKzKOL5CAlAW6kBGZGSNPK/X2SPJQ0yynmYz9bn05YQ9EAos0vdOV+9DDW4bqPuEne+OV/f9QJXWvHd+oUEUBWm40wya7yrPnoarN7OLk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pmSZoHQN; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5D9E3C433C7; Fri, 22 Mar 2024 16:32:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711125145; bh=otOiDrXv7vSEtDQG9vjhed+cuW5roGWlH4xO15itNQ0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pmSZoHQN6Ch6UZqCQc7YAx+AjlBUk0zUmyDWkFSAOUr+W/ukv/JcU9rjTJiBvBjb7 GXsz3UGT1mXS2A2kC1SCL63D0O7nO0fPEciZIHb5qnrj/l/MV8c8xSV45hVaKRyCHj iXgMDmD2lKxhHoBv3yauwq2+yEpD65CaeqMrAT6L7XmLg58XdtcKR/wru810BF6iN4 5i2JGMs06OEg1a9Jg80csxxv4rEJIg23OPCdKweUEIlDlI0wF15rN83mxbtXgzQ5Ri j+6N14r3eH+37fIr0UrDf3fL8S8WNGVz2uuiO0k7OkQ8Q0tjUSp1N3T9ZVxUrA1/8x iPqVIt4IXrbxQ== From: SeongJae Park To: Honggyu Kim Cc: SeongJae Park , damon@lists.linux.dev, linux-mm@kvack.org, akpm@linux-foundation.org, apopple@nvidia.com, baolin.wang@linux.alibaba.com, dave.jiang@intel.com, hyeongtak.ji@sk.com, kernel_team@skhynix.com, linmiaohe@huawei.com, linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, lizhijian@cn.fujitsu.com, mathieu.desnoyers@efficios.com, mhiramat@kernel.org, rakie.kim@sk.com, rostedt@goodmis.org, surenb@google.com, yangx.jy@fujitsu.com, ying.huang@intel.com, ziy@nvidia.com, 42.hyeyoo@gmail.com Subject: Re: [RFC PATCH v2 0/7] DAMON based 2-tier memory management for CXL memory Date: Fri, 22 Mar 2024 09:32:23 -0700 Message-Id: <20240322163223.68414-1-sj@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20240322090227.2253-1-honggyu.kim@sk.com> References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Fri, 22 Mar 2024 18:02:23 +0900 Honggyu Kim wrote: > Hi SeongJae, > > On Tue, 27 Feb 2024 15:51:20 -0800 SeongJae Park wrote: > > On Mon, 26 Feb 2024 23:05:46 +0900 Honggyu Kim wrote: > > > > > There was an RFC IDEA "DAMOS-based Tiered-Memory Management" previously > > > posted at [1]. > > > > > > It says there is no implementation of the demote/promote DAMOS action > > > are made. This RFC is about its implementation for physical address > > > space. > > > > > > [...] > > Thank you for running the tests again with the new version of the patches and > > sharing the results! > > It's a bit late answer, but the result was from the previous evaluation. > I ran it again with RFC v2, but didn't see much difference so just > pasted the same result here. No problem, thank you for clarifying :) [...] > > > Honggyu Kim (3): > > > mm/damon: refactor DAMOS_PAGEOUT with migration_mode > > > mm: make alloc_demote_folio externally invokable for migration > > > mm/damon: introduce DAMOS_DEMOTE action for demotion > > > > > > Hyeongtak Ji (4): > > > mm/memory-tiers: add next_promotion_node to find promotion target > > > mm/damon: introduce DAMOS_PROMOTE action for promotion > > > mm/damon/sysfs-schemes: add target_nid on sysfs-schemes > > > mm/damon/sysfs-schemes: apply target_nid for promote and demote > > > actions > > > > Honggyu joined DAMON Beer/Coffee/Tea Chat[1] yesterday, and we discussed about > > this patchset in high level. Sharing the summary here for open discussion. As > > also discussed on the first version of this patchset[2], we want to make single > > action for general page migration with minimum changes, but would like to keep > > page level access re-check. We also agreed the previously proposed DAMOS > > filter-based approach could make sense for the purpose. > > Thanks very much for the summary. I have been trying to merge promote > and demote actions into a single migrate action, but I found an issue > regarding damon_pa_scheme_score. It currently calls damon_cold_score() > for demote action and damon_hot_score() for promote action, but what > should we call when we use a single migrate action? Good point! This is what I didn't think about when suggesting that. Thank you for letting me know this gap! I think there could be two approach, off the top of my head. The first one would be extending the interface so that the user can select the score function. This would let flexible usage, but I'm bit concerned if this could make things unnecessarily complex, and would really useful in many general use case. The second approach would be letting DAMON infer the intention. In this case, I think we could know the intention is the demotion if the scheme has a youg pages exclusion filter. Then, we could use the cold_score(). And vice versa. To cover a case that there is no filter at all, I think we could have one assumption. My humble intuition says the new action (migrate) may be used more for promotion use case. So, in damon_pa_scheme_score(), if the action of the given scheme is the new one (say, MIGRATE), the function will further check if the scheme has a filter for excluding young pages. If so, the function will use cold_score(). Otherwise, the function will use hot_score(). So I'd more prefer the second approach. I think it would be not too late to consider the first approach after waiting for it turns out more actions have such ambiguity and need more general interface for explicitly set the score function. Thanks, SJ [...]