[PATCH 0/3] mm/damon: use alloc_migrate_target() for DAMOS_MIGRATE_{HOT,COLD}

SeongJae Park posted 3 patches 3 months, 3 weeks ago
mm/damon/paddr.c | 4 +---
mm/internal.h    | 1 -
mm/vmscan.c      | 5 +++--
3 files changed, 4 insertions(+), 6 deletions(-)
[PATCH 0/3] mm/damon: use alloc_migrate_target() for DAMOS_MIGRATE_{HOT,COLD}
Posted by SeongJae Park 3 months, 3 weeks ago
DAMOS_MIGRATE_{HOT,COLD} implementation resembles that for demotion, and
hence the behavior is also similar to that.  But, since those are not
only for demotion but general migrations, it would be better to match
with that for move_pages() system call.  Make the implementation and the
behavior more similar to move_pages() by not setting migration fallback
nodes, and using alloc_migration_target() instead of
alloc_migrate_folio().

alloc_migrate_folio() was renamed from alloc_demote_folio() and been
non-static function, to let DAMOS_MIGRATE_{HOT,COLD} call it.  As
alloc_migration_target() is called instead, the renaming and de-static
changes are no more required but could only make future code readers be
confused.  Revert the changes, too.

Changes from RFC
(https://lore.kernel.org/20250609200048.50914-1-sj@kernel.org)
- Rebase to latest mm-new
- Slightly wordsmith cv and commit messages

SeongJae Park (3):
  mm/damon/paddr: use alloc_migartion_target() with no migration
    fallback nodemask
  Revert "mm: rename alloc_demote_folio to alloc_migrate_folio"
  Revert "mm: make alloc_demote_folio externally invokable for
    migration"

 mm/damon/paddr.c | 4 +---
 mm/internal.h    | 1 -
 mm/vmscan.c      | 5 +++--
 3 files changed, 4 insertions(+), 6 deletions(-)


base-commit: b29ac9653c1fae75d3444b6a03521c74adb6d4cc
-- 
2.39.5
Re: [PATCH 0/3] mm/damon: use alloc_migrate_target() for DAMOS_MIGRATE_{HOT,COLD}
Posted by Joshua Hahn 3 months, 3 weeks ago
On Mon, 16 Jun 2025 10:23:43 -0700 SeongJae Park <sj@kernel.org> wrote:

> DAMOS_MIGRATE_{HOT,COLD} implementation resembles that for demotion, and
> hence the behavior is also similar to that.  But, since those are not
> only for demotion but general migrations, it would be better to match
> with that for move_pages() system call.  Make the implementation and the
> behavior more similar to move_pages() by not setting migration fallback
> nodes, and using alloc_migration_target() instead of
> alloc_migrate_folio().
> 
> alloc_migrate_folio() was renamed from alloc_demote_folio() and been
> non-static function, to let DAMOS_MIGRATE_{HOT,COLD} call it.  As
> alloc_migration_target() is called instead, the renaming and de-static
> changes are no more required but could only make future code readers be
> confused.  Revert the changes, too.

Hi SJ,
I hope you are doing well!

These changes all look good to me. And I agree that changing the behavior
to mimic migration as opposed to demotion might be helpful in making
opportunities for others to use DAMOS as a means to perform other related
works (like [1]), without having to use a "demotion" mechanism for simply
moving pages around.

I do have one question: I'm curious what kinds of changes callers can expect.
Would I be correct in understanding that this is mostly a semantic change
(aside from no longer having a fallback nodemask)? Just want to make sure I
have a correct understanding of your intent was.

In the meantime, feel free to add the following to the series:
Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>

Have a great day!
Joshua

[1] https://lore.kernel.org/all/20250612181330.31236-1-bijan311@gmail.com/

Sent using hkml (https://github.com/sjp38/hackermail)
Re: [PATCH 0/3] mm/damon: use alloc_migrate_target() for DAMOS_MIGRATE_{HOT,COLD}
Posted by SeongJae Park 3 months, 3 weeks ago
Hi Joshua,

On Mon, 16 Jun 2025 14:31:58 -0700 Joshua Hahn <joshua.hahnjy@gmail.com> wrote:

> On Mon, 16 Jun 2025 10:23:43 -0700 SeongJae Park <sj@kernel.org> wrote:
> 
> > DAMOS_MIGRATE_{HOT,COLD} implementation resembles that for demotion, and
> > hence the behavior is also similar to that.  But, since those are not
> > only for demotion but general migrations, it would be better to match
> > with that for move_pages() system call.  Make the implementation and the
> > behavior more similar to move_pages() by not setting migration fallback
> > nodes, and using alloc_migration_target() instead of
> > alloc_migrate_folio().
> > 
> > alloc_migrate_folio() was renamed from alloc_demote_folio() and been
> > non-static function, to let DAMOS_MIGRATE_{HOT,COLD} call it.  As
> > alloc_migration_target() is called instead, the renaming and de-static
> > changes are no more required but could only make future code readers be
> > confused.  Revert the changes, too.
> 
> Hi SJ,
> I hope you are doing well!

Thank you, you too! :)

> 
> These changes all look good to me. And I agree that changing the behavior
> to mimic migration as opposed to demotion might be helpful in making
> opportunities for others to use DAMOS as a means to perform other related
> works (like [1]), without having to use a "demotion" mechanism for simply
> moving pages around.
> 
> I do have one question: I'm curious what kinds of changes callers can expect.
> Would I be correct in understanding that this is mostly a semantic change
> (aside from no longer having a fallback nodemask)? Just want to make sure I
> have a correct understanding of your intent was.

You're correct.  This is not changing any DAMON interface, so DAMON API callers
and DAMON ABI users would not need to make any change from their side.

> 
> In the meantime, feel free to add the following to the series:
> Reviewed-by: Joshua Hahn <joshua.hahnjy@gmail.com>

Thank you! :)

> 
> Have a great day!


You too!


Thanks,
SJ

[...]