mm/damon/vaddr: use damos->migrate_dests in migrate_{hot,cold}
authorBijan Tabatabai <bijantabatab@micron.com>
Wed, 9 Jul 2025 00:59:41 +0000 (19:59 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 20 Jul 2025 01:59:50 +0000 (18:59 -0700)
commit19c1dc15c859929f8f084d0bfa2fafd1ee876cdd
tree219c84fafc4b68eed555d8ea9fb091d9b8c19682
parent0af934b1312cc03bb977e8f345c694f3bef9529e
mm/damon/vaddr: use damos->migrate_dests in migrate_{hot,cold}

damos->migrate_dests provides a list of nodes the migrate_{hot,cold}
actions should migrate to, as well as the weights which specify the ratio
pages should be migrated to each destination node.

This patch interleaves pages in the migrate_{hot,cold} actions according
to the information provided in damos->migrate_dests if it is used.  The
interleaving algorithm used is similar to the one used in
weighted_interleave_nid().  If damos->migration_dests is not provided, the
actions migrate pages to the node specified in damos->target_nid as
before.

Link: https://lkml.kernel.org/r/20250709005952.17776-12-bijan311@gmail.com
Co-developed-by: Ravi Shankar Jonnalagadda <ravis.opensrc@micron.com>
Signed-off-by: Ravi Shankar Jonnalagadda <ravis.opensrc@micron.com>
Signed-off-by: Bijan Tabatabai <bijantabatab@micron.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/vaddr.c