mm/damon: add DAMOS_MIGRATE_{HOT,COLD} destination nodes and weights
Subsystems (2)
SeongJae Park
maintainercover mm/damon: add DAMOS_MIGRATE_{HOT,COLD} destination nodes and weights
DAMOS_MIGRATE_{HOT,COLD} action can migrate pages to only single node. It could be useful to allow it migrates pages to multiple nodes with different weights. A work for dynamic interleaving[1] is in progress. We also discussed this could be useful for memory tiering, e.g., when we want to move pages to multiple noes of same tier.
Extend the API and ABI interface for specifying the multiple destination nodes and their weights.
Note that this RFC is a prototype of the interface change for Bijan's interleaving work[1]. Hence this patch series is only implementing the interface part, not the real implementation of the migration behavior.
[1] https://lore.kernel.org/[email protected]
[2] https://lore.kernel.org/[email protected]
SeongJae Park (4):
mm/damon: add struct damos_migrate_dest
mm/damon/core: add damos->migrate_dest field mm/damon/sysfs-schemes: implement DAMOS action destinations directory mm/damon/sysfs-schemes: set damos->migrate_dest
include/linux/damon.h | 29 ++++- mm/damon/core.c | 4 + mm/damon/sysfs-schemes.c | 253 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 282 insertions(+), 4 deletions(-)
base-commit: 78745efafbb93197e476717385616ed57ea2df22
Signature · 1 line
2.39.5
SeongJae Park
maintainerRFC PATCH 1/4 mm/damon: add struct damos_migrate_dest
Introduce a new struct, namely damos_migrate_dest, for specifying multiple DAMOS' migration destination nodes and their weights.
--- include/linux/damon.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
include/linux/damon.h +16 -0
@@ -447,6 +447,22 @@ struct damos_access_pattern {unsigned int max_age_region; }; +/** +* struct damos_migrate_dest - Migration destination nodes and their weights. +* @node_id_arr: Array of migration destination node ids. +* @weight_arr: Array of migration weights for @node_id_arr. +* @nr_dests: Length of the @node_id_arr and @weight_arr arrays. +* +* @node_id_arr is an array of the ids of migration destination nodes. +* @weight_arr is an array of the weights for those. The weights in +* @weight_arr are for nodes in @node_id_arr of same array index. +*/ +struct damos_migrate_dest { +unsigned int *node_id_arr; +unsigned int *weight_arr; +size_t nr_dests; +}; +/** * struct damos - Represents a Data Access Monitoring-based Operation Scheme. * @pattern: Access pattern of target regions.
Signature · 1 line
2.39.5
Re: [RFC PATCH 1/4] mm/damon: add struct damos_migrate_dest
Quoted 13 lines · On Sat, 21 Jun 2025 10:31:28 -0700 SeongJae Park <[email protected]> wrote:
Introduce a new struct, namely
damos_migrate_dest, for specifying multiple DAMOS' migration destination nodes and their weights.Signed-off-by SeongJae Park <[email protected]>--- include/linux/damon.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)include/linux/damon.h +0
-0
include/linux/damon.h struct damos_access_pattern { · line 451
Quoted 5 lines
include/linux/damon.h +2
-0@@ -447,6 +447,22 @@ struct damos_access_pattern {unsigned int max_age_region; }; +/** +* struct damos_migrate_dest - Migration destination nodes and their weights.
Nit: Can this be renamed to damos_migrate_dests?
I think plural fits better because it stores a list of destinations.
Thanks,
Bijan
Quoted 19 lines
include/linux/damon.h +14
-0+* @node_id_arr: Array of migration destination node ids. +* @weight_arr: Array of migration weights for @node_id_arr. +* @nr_dests: Length of the @node_id_arr and @weight_arr arrays. +* +* @node_id_arr is an array of the ids of migration destination nodes. +* @weight_arr is an array of the weights for those. The weights in +* @weight_arr are for nodes in @node_id_arr of same array index. +*/ +struct damos_migrate_dest { +unsigned int *node_id_arr; +unsigned int *weight_arr; +size_t nr_dests; +}; +/** * struct damos - Represents a Data Access Monitoring-based Operation Scheme. * @pattern: Access pattern of target regions. Signature · 1 line
2.39.5
SeongJae Park
maintainerRe: [RFC PATCH 1/4] mm/damon: add struct damos_migrate_dest
Quoted 18 lines · On Tue, 1 Jul 2025 17:43:30 -0500 Bijan Tabatabai <[email protected]> wrote:
Quoted 16 lines · On Sat, 21 Jun 2025 10:31:28 -0700 SeongJae Park <[email protected]> wrote:
Introduce a new struct, namely
damos_migrate_dest, for specifying multiple DAMOS' migration destination nodes and their weights.Signed-off-by SeongJae Park <[email protected]>--- include/linux/damon.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)include/linux/damon.h +0
-0@@ -447,6 +447,22 @@ struct damos_access_pattern {unsigned int max_age_region; };
Quoted 5 lines
include/linux/damon.h struct damos_access_pattern { · line 451
Quoted 2 lines
include/linux/damon.h +2
-0+/** +* struct damos_migrate_dest - Migration destination nodes and their weights. Nit: Can this be renamed to
damos_migrate_dests?
I think plural fits better because it stores a list of destinations.
Makes sense, agreed. I guess you will do that on your own when you add this on your patch series? Please let me know if you prefer different ways. I could also do that and send it again as RFC v2 of this series.
Thanks,
SJ
[...]
Re: [RFC PATCH 1/4] mm/damon: add struct damos_migrate_dest
Quoted 27 lines · SeongJae Park
Quoted 18 lines · On Tue, 1 Jul 2025 17:43:30 -0500 Bijan Tabatabai <[email protected]> wrote:
Quoted 16 lines · On Sat, 21 Jun 2025 10:31:28 -0700 SeongJae Park <[email protected]> wrote:
Introduce a new struct, namely
damos_migrate_dest, for specifying multiple DAMOS' migration destination nodes and their weights.Signed-off-by SeongJae Park <[email protected]>--- include/linux/damon.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)include/linux/damon.h +0
-0@@ -447,6 +447,22 @@ struct damos_access_pattern {unsigned int max_age_region; };Quoted 5 lines
include/linux/damon.h struct damos_access_pattern { · line 451
Quoted 2 lines
include/linux/damon.h +2
-0+/** +* struct damos_migrate_dest - Migration destination nodes and their weights. Nit: Can this be renamed to
damos_migrate_dests?
I think plural fits better because it stores a list of destinations.
Quoted 3 lines
Makes sense, agreed. I guess you will do that on your own when you add this on your patch series? Please let me know if you prefer different ways. I could also do that and send it again as RFC v2 of this series.
I can do this in my patch series.
Would the best way for me to do that be to send modified versions of this patch series with my patches, or should I send one additional patch that just renames the struct with my patches?
Bijan
[...]
SeongJae Park
maintainerRe: [RFC PATCH 1/4] mm/damon: add struct damos_migrate_dest
Quoted 28 lines · On Tue, 1 Jul 2025 20:43:46 -0500 Bijan Tabatabai <[email protected]> wrote:
Quoted 27 lines · SeongJae Park
Quoted 23 lines · On Tue, 1 Jul 2025 17:43:30 -0500 Bijan Tabatabai <[email protected]> wrote:
Quoted 13 lines · On Sat, 21 Jun 2025 10:31:28 -0700 SeongJae Park <[email protected]> wrote:
Introduce a new struct, namely
damos_migrate_dest, for specifying multiple DAMOS' migration destination nodes and their weights.Signed-off-by SeongJae Park <[email protected]>--- include/linux/damon.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)include/linux/damon.h +0
-0include/linux/damon.h struct damos_access_pattern { · line 451
Quoted 5 lines
include/linux/damon.h +2
-0@@ -447,6 +447,22 @@ struct damos_access_pattern {unsigned int max_age_region; }; +/** +* struct damos_migrate_dest - Migration destination nodes and their weights. Nit: Can this be renamed to
damos_migrate_dests?
I think plural fits better because it stores a list of destinations.
Quoted 5 lines
Quoted 3 lines
Makes sense, agreed. I guess you will do that on your own when you add this on your patch series? Please let me know if you prefer different ways. I could also do that and send it again as RFC v2 of this series.
I can do this in my patch series.
Thank you!
Quoted 3 lines
Would the best way for me to do that be to send modified versions of this patch series with my patches, or should I send one additional patch that just renames the struct with my patches?
I think the former (making modification in place of this patch) is better, for people who will read the commit log in future. Please don't forget adding your
Singed-off-by: tag, and let me know if any help is needed!
Thanks,
SJ
[...]
SeongJae Park
maintainerRFC PATCH 2/4 mm/damon/core: add damos->migrate_dest field
In reply to SeongJae ParkAdd a new field to 'struct damos', namely migrate_dest, to allow DAMON API callers specify multiple migration destination nodes and their weights. Also update 'struct damos' creation and destruction functions accordingly to initialize the new field and free up the API caller-allocated buffers on those, respectively.
--- include/linux/damon.h | 13 ++++++++++--- mm/damon/core.c | 4 ++++ 2 files changed, 14 insertions(+), 3 deletions(-)
include/linux/damon.h +10 -3
@@ -470,6 +470,7 @@ struct damos_migrate_dest {* @apply_interval_us: The time between applying the @action. * @quota: Control the aggressiveness of this scheme. * @wmarks: Watermarks for automated (in)activation of this scheme. +* @migrate_dest: Destination nodes if @action is "migrate_{hot,cold}". * @target_nid: Destination node if @action is "migrate_{hot,cold}". * @filters: Additional set of &struct damos_filter for &action. * @ops_filters: ops layer handling &struct damos_filter objects list.
@@ -488,9 +489,12 @@ struct damos_migrate_dest {* monitoring context are inactive, DAMON stops monitoring either, and just * repeatedly checks the watermarks. * +* @migrate_dest specifies multiple migration target nodes with different +* weights for migrate_hot or migrate_cold actions. @target_nid is ignored if +* this is set. +* * @target_nid is used to set the migration target node for migrate_hot or -* migrate_cold actions, which means it's only meaningful when @action is either -* "migrate_hot" or "migrate_cold". +* migrate_cold actions, and @migrate_dest is unset. * * Before applying the &action to a memory region, &struct damon_operations * implementation could check pages of the region and skip &action to respect
@@ -533,7 +537,10 @@ struct damos {struct damos_quota quota;struct damos_watermarks wmarks;union { -int target_nid; +struct { +int target_nid; +struct damos_migrate_dest migrate_dest; + }; };struct list_head filters;struct list_head ops_filters;
mm/damon/core.c +4 -0
@@ -407,6 +407,7 @@ struct damos *damon_new_scheme(struct damos_access_pattern *pattern, scheme->wmarks = *wmarks; scheme->wmarks.activated = true; + scheme->migrate_dest = (struct damos_migrate_dest ){}; scheme->target_nid = target_nid;return scheme;
@@ -449,6 +450,9 @@ void damon_destroy_scheme(struct damos *s)damos_for_each_filter_safe (f, next, s)damos_destroy_filter (f); + +kfree (s->migrate_dest.node_id_arr); +kfree (s->migrate_dest.weight_arr);damon_del_scheme (s);damon_free_scheme (s); }
Signature · 1 line
2.39.5
SeongJae Park
maintainerRFC PATCH 3/4 mm/damon/sysfs-schemes: implement DAMOS action destinations directory
In reply to SeongJae ParkDAMOS_MIGRATE_{HOT,COLD} can have multiple action destinations and their weights. Implement sysfs directory named 'dests' under each scheme directory to let DAMON sysfs ABI users utilize the feature. The interface is similar to other multiple parameters directory like kdamonds or filters. The directory contains only nr_dests file initially. Writing a number of desired destinations to nr_dests creates directories of the number that has files named id and weight. Users can then write the destination id (node id in case of DAMOS_MIGRATE_*) and their weight to the files.
--- mm/damon/sysfs-schemes.c | 225 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 224 insertions(+), 1 deletion(-)
mm/damon/sysfs-schemes.c +224 -1
@@ -1568,6 +1568,204 @@ static const struct kobj_type damon_sysfs_access_pattern_ktype = { .default_groups = damon_sysfs_access_pattern_groups, }; +/* +* dest (action destination) directory +*/ + +struct damos_sysfs_dest { +struct kobject kobj; +unsigned int id; +unsigned int weight; +}; + +static struct damos_sysfs_dest *damos_sysfs_dest_alloc (void ) +{ +return kzalloc (sizeof (struct damos_sysfs_dest ),GFP_KERNEL ); +} + +static ssize_t id_show ( +struct kobject *kobj,struct kobj_attribute *attr,char *buf) +{ +struct damos_sysfs_dest *dest =container_of (kobj, + struct damos_sysfs_dest, kobj); + +return sysfs_emit (buf,"%u\n" , dest->id); +} + +static ssize_t id_store (struct kobject *kobj, +struct kobj_attribute *attr,const char *buf,size_t count) +{ +struct damos_sysfs_dest *dest =container_of (kobj, + struct damos_sysfs_dest, kobj); +int err =kstrtouint (buf,0 , &dest->id); + +return err ? err : count; +} + +static ssize_t weight_show ( +struct kobject *kobj,struct kobj_attribute *attr,char *buf) +{ +struct damos_sysfs_dest *dest =container_of (kobj, + struct damos_sysfs_dest, kobj); + +return sysfs_emit (buf,"%u\n" , dest->weight); +} + +static ssize_t weight_store (struct kobject *kobj, +struct kobj_attribute *attr,const char *buf,size_t count) +{ +struct damos_sysfs_dest *dest =container_of (kobj, + struct damos_sysfs_dest, kobj); +int err =kstrtouint (buf,0 , &dest->weight); + +return err ? err : count; +} + +static void damos_sysfs_dest_release (struct kobject *kobj) +{ +struct damos_sysfs_dest *dest =container_of (kobj, + struct damos_sysfs_dest, kobj); +kfree (dest); +} + +static struct kobj_attribute damos_sysfs_dest_id_attr = +__ATTR_RW_MODE (id,0600 ); + +static struct kobj_attribute damos_sysfs_dest_weight_attr = +__ATTR_RW_MODE (weight,0600 ); + +static struct attribute *damos_sysfs_dest_attrs[] = { + &damos_sysfs_dest_id_attr.attr, + &damos_sysfs_dest_weight_attr.attr, +NULL , +}; +ATTRIBUTE_GROUPS (damos_sysfs_dest); + +static const struct kobj_type damos_sysfs_dest_ktype = { + .release = damos_sysfs_dest_release, + .sysfs_ops = &kobj_sysfs_ops, + .default_groups = damos_sysfs_dest_groups, +}; + +/* +* dests (action destinations) directory +*/ + +struct damos_sysfs_dests { +struct kobject kobj; +struct damos_sysfs_dest **dests_arr; +int nr; +}; + +static struct damos_sysfs_dests * +damos_sysfs_dests_alloc (void ) +{ +return kzalloc (sizeof (struct damos_sysfs_dests ),GFP_KERNEL ); +} + +static void damos_sysfs_dests_rm_dirs ( +struct damos_sysfs_dests *dests) +{ +struct damos_sysfs_dest **dests_arr = dests->dests_arr; +int i; + +for (i =0 ; i < dests->nr; i++) +kobject_put (&dests_arr[i]->kobj); + dests->nr =0 ; +kfree (dests_arr); + dests->dests_arr =NULL ; +} + +static int damos_sysfs_dests_add_dirs ( +struct damos_sysfs_dests *dests,int nr_dests) +{ +struct damos_sysfs_dest **dests_arr, *dest; +int err, i; + +damos_sysfs_dests_rm_dirs (dests); +if (!nr_dests) +return 0 ; + + dests_arr =kmalloc_array (nr_dests,sizeof (*dests_arr), +GFP_KERNEL | __GFP_NOWARN); +if (!dests_arr) +return -ENOMEM ; + dests->dests_arr = dests_arr; + +for (i =0 ; i < nr_dests; i++) { + dest =damos_sysfs_dest_alloc (); +if (!dest) { +damos_sysfs_dests_rm_dirs (dests); +return -ENOMEM ; + } + + err =kobject_init_and_add (&dest->kobj, + &damos_sysfs_dest_ktype, + &dests->kobj,"%d" , i); +if (err) { +kobject_put (&dest->kobj); +damos_sysfs_dests_rm_dirs (dests); +return err; + } + + dests_arr[i] = dest; + dests->nr++; + } +return 0 ; +} + +static ssize_t nr_dests_show (struct kobject *kobj, +struct kobj_attribute *attr,char *buf) +{ +struct damos_sysfs_dests *dests =container_of (kobj, + struct damos_sysfs_dests, kobj); + +return sysfs_emit (buf,"%d\n" , dests->nr); +} + +static ssize_t nr_dests_store (struct kobject *kobj, +struct kobj_attribute *attr,const char *buf,size_t count) +{ +struct damos_sysfs_dests *dests; +int nr, err =kstrtoint (buf,0 , &nr); + +if (err) +return err; +if (nr <0 ) +return -EINVAL ; + + dests = container_of(kobj, struct damos_sysfs_dests, kobj); + +if (!mutex_trylock (&damon_sysfs_lock)) +return -EBUSY ; + err =damos_sysfs_dests_add_dirs (dests, nr); +mutex_unlock (&damon_sysfs_lock); +if (err) +return err; + +return count; +} + +static void damos_sysfs_dests_release (struct kobject *kobj) +{ +kfree (container_of(kobj ,struct damos_sysfs_dests ,kobj )); +} + +static struct kobj_attribute damos_sysfs_dests_nr_attr = +__ATTR_RW_MODE (nr_dests,0600 ); + +static struct attribute *damos_sysfs_dests_attrs[] = { + &damos_sysfs_dests_nr_attr.attr, +NULL , +}; +ATTRIBUTE_GROUPS (damos_sysfs_dests); + +static const struct kobj_type damos_sysfs_dests_ktype = { + .release = damos_sysfs_dests_release, + .sysfs_ops = &kobj_sysfs_ops, + .default_groups = damos_sysfs_dests_groups, +}; +/* * scheme directory */
@@ -1585,6 +1783,7 @@ struct damon_sysfs_scheme {struct damon_sysfs_stats *stats;struct damon_sysfs_scheme_regions *tried_regions;int target_nid; +struct damos_sysfs_dests *dests; };/* This should match with enum damos_action */
@@ -1641,6 +1840,22 @@ static int damon_sysfs_scheme_set_access_pattern(return err; } +static int damos_sysfs_set_dests (struct damon_sysfs_scheme *scheme) +{ +struct damos_sysfs_dests *dests =damos_sysfs_dests_alloc (); +int err; + +if (!dests) +return -ENOMEM ; + err =kobject_init_and_add (&dests->kobj, &damos_sysfs_dests_ktype, + &scheme->kobj,"dests" ); +if (err) +kobject_put (&dests->kobj); +else + scheme->dests = dests; +return err; +} +static int damon_sysfs_scheme_set_quotas (struct damon_sysfs_scheme *scheme) {struct damon_sysfs_quotas *quotas =damon_sysfs_quotas_alloc ();
@@ -1773,9 +1988,12 @@ static int damon_sysfs_scheme_add_dirs(struct damon_sysfs_scheme *scheme) err =damon_sysfs_scheme_set_access_pattern (scheme);if (err)return err; - err =damon_sysfs_scheme_set_quotas (scheme); + err =damos_sysfs_set_dests (scheme);if (err) goto put_access_pattern_out; + err =damon_sysfs_scheme_set_quotas (scheme); +if (err) + goto put_dests_out; err =damon_sysfs_scheme_set_watermarks (scheme);if (err) goto put_quotas_access_pattern_out;
@@ -1806,6 +2024,9 @@ static int damon_sysfs_scheme_add_dirs(struct damon_sysfs_scheme *scheme) put_quotas_access_pattern_out:kobject_put (&scheme->quotas->kobj); scheme->quotas =NULL ; +put_dests_out: +kobject_put (&scheme->dests->kobj); + scheme->dests =NULL ; put_access_pattern_out:kobject_put (&scheme->access_pattern->kobj); scheme->access_pattern =NULL ;
@@ -1816,6 +2037,8 @@ static void damon_sysfs_scheme_rm_dirs(struct damon_sysfs_scheme *scheme) {damon_sysfs_access_pattern_rm_dirs (scheme->access_pattern);kobject_put (&scheme->access_pattern->kobj); +kobject_put (&scheme->dests->kobj); +damos_sysfs_dests_rm_dirs (scheme->dests);damon_sysfs_quotas_rm_dirs (scheme->quotas);kobject_put (&scheme->quotas->kobj);kobject_put (&scheme->watermarks->kobj);
Signature · 1 line
2.39.5
SeongJae Park
maintainerRFC PATCH 4/4 mm/damon/sysfs-schemes: set damos->migrate_dest
In reply to SeongJae ParkPass user-specified multiple DAMOS action destinations and their weights to DAMON core API, so that user requests can really work.
--- mm/damon/sysfs-schemes.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
mm/damon/sysfs-schemes.c +28 -0
@@ -2445,6 +2445,29 @@ void damos_sysfs_update_effective_quotas( } } +static int damos_sysfs_add_migrate_dest (struct damos *scheme, +struct damos_sysfs_dests *sysfs_dests) +{ +struct damos_migrate_dest *dest = &scheme->migrate_dest; +int i; + + dest->node_id_arr =kmalloc_array (sysfs_dests->nr, +sizeof (*dest->node_id_arr),GFP_KERNEL ); +if (!dest->node_id_arr) +return -ENOMEM ; + dest->weight_arr =kmalloc_array (sysfs_dests->nr, +sizeof (*dest->weight_arr),GFP_KERNEL ); +if (!dest->weight_arr) +/* ->node_id_arr will be freed by scheme destruction */ +return -ENOMEM ; +for (i =0 ; i < sysfs_dests->nr; i++) { + dest->node_id_arr[i] = sysfs_dests->dests_arr[i]->id; + dest->weight_arr[i] = sysfs_dests->dests_arr[i]->weight; + } + dest->nr_dests = sysfs_dests->nr; +return 0 ; +} +static struct damos *damon_sysfs_mk_scheme (struct damon_sysfs_scheme *sysfs_scheme) {
@@ -2507,6 +2530,11 @@ static struct damos *damon_sysfs_mk_scheme(damon_destroy_scheme (scheme);return NULL ; } + err =damos_sysfs_add_migrate_dest (scheme, sysfs_scheme->dests); +if (err) { +damon_destroy_scheme (scheme); +return NULL ; + }return scheme; }
Signature · 1 line
2.39.5
Quoted 22 lines · On Sat, 21 Jun 2025 10:31:27 -0700 SeongJae Park <[email protected]> wrote:
DAMOS_MIGRATE_{HOT,COLD} action can migrate pages to only single node. It could be useful to allow it migrates pages to multiple nodes with different weights. A work for dynamic interleaving[1] is in progress. We also discussed this could be useful for memory tiering, e.g., when we want to move pages to multiple noes of same tier.
Extend the API and ABI interface for specifying the multiple destination nodes and their weights.
Note that this RFC is a prototype of the interface change for Bijan's interleaving work[1]. Hence this patch series is only implementing the interface part, not the real implementation of the migration behavior.
[1] https://lore.kernel.org/[email protected]
[2] https://lore.kernel.org/[email protected]SeongJae Park (4):
mm/damon: add structdamos_migrate_dest
mm/damon/core: adddamos->migrate_destfieldmm/damon/sysfs-schemes: implement DAMOS action destinations directorymm/damon/sysfs-schemes: setdamos->migrate_dest
Quoted 9 lines
include/linux/damon.h | 29 ++++- mm/damon/core.c | 4 + mm/damon/sysfs-schemes.c | 253 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 282 insertions(+), 4 deletions(-)base-commit:
78745efafbb93197e476717385616ed57ea2df22Signature · 1 line
2.39.5
Hi SeongJae,
Thanks for putting this patch together. Sorry for taking a while to respond to it.
I am finishing up V3 of the interleave patchset using these patches. It has mostly worked great, but I noticed that damos->migrate_dest was not being updated in damos_commit(), so new weights would not be applied. This meant that you could not update the interleave weights by committing the damon state. I also saw that damos->target_nid was also not being updated here. I will will have a patch fixing this with the V3 of the interleave patchset that I will hopefully send out tomorrow.
Thanks,
Bijan
SeongJae Park
maintainerQuoted 30 lines · On Tue, 1 Jul 2025 17:39:37 -0500 Bijan Tabatabai <[email protected]> wrote:
Quoted 28 lines · On Sat, 21 Jun 2025 10:31:27 -0700 SeongJae Park <[email protected]> wrote:
DAMOS_MIGRATE_{HOT,COLD} action can migrate pages to only single node. It could be useful to allow it migrates pages to multiple nodes with different weights. A work for dynamic interleaving[1] is in progress. We also discussed this could be useful for memory tiering, e.g., when we want to move pages to multiple noes of same tier.
Extend the API and ABI interface for specifying the multiple destination nodes and their weights.
Note that this RFC is a prototype of the interface change for Bijan's interleaving work[1]. Hence this patch series is only implementing the interface part, not the real implementation of the migration behavior.
[1] https://lore.kernel.org/[email protected]
[2] https://lore.kernel.org/[email protected]SeongJae Park (4):
mm/damon: add structdamos_migrate_dest
mm/damon/core: adddamos->migrate_destfieldmm/damon/sysfs-schemes: implement DAMOS action destinations directorymm/damon/sysfs-schemes: setdamos->migrate_destinclude/linux/damon.h | 29 ++++- mm/damon/core.c | 4 + mm/damon/sysfs-schemes.c | 253 ++++++++++++++++++++++++++++++++++++++- 3 files changed, 282 insertions(+), 4 deletions(-)
Quoted 8 lines
Quoted 3 lines
base-commit:
78745efafbb93197e476717385616ed57ea2df22Signature · 1 line
2.39.5Hi SeongJae,
Thanks for putting this patch together. Sorry for taking a while to respond to it.
No worry!
Quoted 7 lines
I am finishing up V3 of the interleave patchset using these patches. It has mostly worked great, but I noticed that
damos->migrate_destwas not being updated indamos_commit(), so new weights would not be applied. This meant that you could not update the interleave weights by committing the damon state. I also saw thatdamos->target_nidwas also not being updated here. I will will have a patch fixing
Nice catch, thank you for finding the bug and making the fix!
Quoted 2 lines
this with the V3 of the interleave
patchset that I will hopefully send out tomorrow.
I cannot wait, but please take your time! :)
Thanks,
SJ
[...]
SeongJae Park
maintainerQuoted 3 lines · On Tue, 1 Jul 2025 17:23:16 -0700 SeongJae Park <[email protected]> wrote:
Quoted 1 line · On Tue, 1 Jul 2025 17:39:37 -0500 Bijan Tabatabai <[email protected]> wrote:
On Sat, 21 Jun 2025 10:31:27 -0700 SeongJae Park <[email protected]> wrote:
[...]
Quoted 7 lines
Quoted 6 lines
I am finishing up V3 of the interleave patchset using these patches. It has mostly worked great, but I noticed that
damos->migrate_destwas not being updated indamos_commit(), so new weights would not be applied. This meant that you could not update the interleave weights by committing the damon state. I also saw thatdamos->target_nidwas also not being updated here. I will will have a patch fixing
Quoted 6 lines
Nice catch, thank you for finding the bug and making the fix!
Quoted 2 lines
this with the V3 of the interleave
patchset that I will hopefully send out tomorrow.I cannot wait, but please take your time! :)
I just realized this series is missing documentation updates. So I just posted[1] RFC v2 of this series with two documentation update patches and trivial commit messages wordsmithing. Note that other parts are same to RFC v1, including the damos_commit() bug and damos_migrate_dest name.
Please pick the version to your v3 of interleave patch series if possible.
[1] https://lore.kernel.org/[email protected]
Thanks,
SJ
[...]