All of lore.kernel.org
 help / color / mirror / Atom feed
From: Honggyu Kim <honggyu.kim@sk.com>
To: SeongJae Park <sj@kernel.org>
Cc: 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,
	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: Mon, 25 Mar 2024 21:01:04 +0900	[thread overview]
Message-ID: <20240325120108.2328-1-honggyu.kim@sk.com> (raw)
In-Reply-To: <20240322163223.68414-1-sj@kernel.org>

Hi SeongJae,

On Fri, 22 Mar 2024 09:32:23 -0700 SeongJae Park <sj@kernel.org> wrote:
> On Fri, 22 Mar 2024 18:02:23 +0900 Honggyu Kim <honggyu.kim@sk.com> wrote:
> 
> > Hi SeongJae,
> > 
> > On Tue, 27 Feb 2024 15:51:20 -0800 SeongJae Park <sj@kernel.org> wrote:
> > > On Mon, 26 Feb 2024 23:05:46 +0900 Honggyu Kim <honggyu.kim@sk.com> 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.

I also think this looks complicated and may not be useful for general
users.

> 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().

Thanks for suggesting many ideas but I'm afraid that I feel this doesn't
look good.  Thinking it again, I think we can think about keep using
DAMOS_PROMOTE and DAMOS_DEMOTE, but I can make them directly call
damon_folio_young() for access check instead of using young filter.

And we can internally handle the complicated combination such as demote
action sets "young" filter with "matching" true and promote action sets
"young" filter with "matching" false.  IMHO, this will make the usage
simpler.

I would like to hear how you think about this.

> 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.

I will join the DAMON Beer/Coffee/Tea Chat tomorrow as scheduled so I
can talk more about this issue.

Thanks,
Honggyu

> 
> Thanks,
> SJ
> 
> [...]

  reply	other threads:[~2024-03-25 12:01 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26 14:05 [RFC PATCH v2 0/7] DAMON based 2-tier memory management for CXL memory Honggyu Kim
2024-02-26 14:05 ` [PATCH v2 1/7] mm/damon: refactor DAMOS_PAGEOUT with migration_mode Honggyu Kim
2024-02-26 14:05 ` [PATCH v2 2/7] mm: make alloc_demote_folio externally invokable for migration Honggyu Kim
2024-02-26 14:05 ` [PATCH v2 3/7] mm/damon: introduce DAMOS_DEMOTE action for demotion Honggyu Kim
2024-02-26 14:05 ` [PATCH v2 4/7] mm/memory-tiers: add next_promotion_node to find promotion target Honggyu Kim
2024-02-26 14:05 ` [PATCH v2 5/7] mm/damon: introduce DAMOS_PROMOTE action for promotion Honggyu Kim
2024-02-26 14:05 ` [PATCH v2 6/7] mm/damon/sysfs-schemes: add target_nid on sysfs-schemes Honggyu Kim
2024-02-26 14:05 ` [PATCH v2 7/7] mm/damon/sysfs-schemes: apply target_nid for promote and demote actions Honggyu Kim
2024-02-27 23:51 ` [RFC PATCH v2 0/7] DAMON based 2-tier memory management for CXL memory SeongJae Park
2024-03-07  3:05   ` SeongJae Park
2024-03-08  8:31     ` Honggyu Kim
2024-03-17  8:36     ` Honggyu Kim
2024-03-17 15:31       ` SeongJae Park
2024-03-17 19:13         ` SeongJae Park
2024-03-18 13:33           ` Honggyu Kim
2024-03-18 13:27         ` Honggyu Kim
2024-03-18 19:07           ` SeongJae Park
2024-03-20  7:07             ` Honggyu Kim
2024-03-20 16:56               ` SeongJae Park
2024-03-22  8:27                 ` Honggyu Kim
2024-03-22 16:39                   ` SeongJae Park
2024-03-22  9:02   ` Honggyu Kim
2024-03-22 16:32     ` SeongJae Park
2024-03-25 12:01       ` Honggyu Kim [this message]
2024-03-25 22:53         ` SeongJae Park
2024-03-26 23:03           ` SeongJae Park
2024-04-05 10:13             ` Honggyu Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240325120108.2328-1-honggyu.kim@sk.com \
    --to=honggyu.kim@sk.com \
    --cc=42.hyeyoo@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=apopple@nvidia.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=damon@lists.linux.dev \
    --cc=dave.jiang@intel.com \
    --cc=hyeongtak.ji@sk.com \
    --cc=kernel_team@skhynix.com \
    --cc=linmiaohe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux-trace-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=mhiramat@kernel.org \
    --cc=rakie.kim@sk.com \
    --cc=rostedt@goodmis.org \
    --cc=sj@kernel.org \
    --cc=surenb@google.com \
    --cc=yangx.jy@fujitsu.com \
    --cc=ying.huang@intel.com \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.