Re: [RFC PATCH v4 1/1] mm/damon: add node_eligible_mem_bp and node_ineligible_mem_bp goal metrics

From: SeongJae Park

Date: Sat Mar 21 2026 - 12:54:45 EST


On Fri, 20 Mar 2026 12:04:53 -0700 Ravi Jonnalagadda <ravis.opensrc@xxxxxxxxx> wrote:

> Add new quota goal metrics for memory tiering that track scheme-eligible
> memory distribution across NUMA nodes:
>
> - DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP: ratio of eligible memory on a node
> - DAMOS_QUOTA_NODE_INELIGIBLE_MEM_BP: ratio of eligible memory NOT on
> a node

The description for the second metric should be "ratio of ineligible memory on
a node".

>
> These complementary metrics enable push-pull migration schemes that
> maintain a target memory distribution across different NUMA nodes
> representing different memory tiers, based on access patterns defined
> by each scheme.
>
> The metrics iterate scheme-eligible regions and use damon_get_folio()
> to determine NUMA node placement of each folio, calculating the ratio
> of eligible memory on the specified node versus total eligible memory.
>
> Suggested-by: SeongJae Park <sj@xxxxxxxxxx>
> Signed-off-by: Ravi Jonnalagadda <ravis.opensrc@xxxxxxxxx>
> ---
> include/linux/damon.h | 6 ++
> mm/damon/core.c | 158 ++++++++++++++++++++++++++++++++++++---
> mm/damon/sysfs-schemes.c | 12 +++
> 3 files changed, 164 insertions(+), 12 deletions(-)
>
> diff --git a/include/linux/damon.h b/include/linux/damon.h
> index b1d8fd88a0fc..490918804f85 100644
> --- a/include/linux/damon.h
> +++ b/include/linux/damon.h
> @@ -193,6 +193,10 @@ enum damos_action {
> * @DAMOS_QUOTA_NODE_MEMCG_FREE_BP: MemFree ratio of a node for a cgroup.
> * @DAMOS_QUOTA_ACTIVE_MEM_BP: Active to total LRU memory ratio.
> * @DAMOS_QUOTA_INACTIVE_MEM_BP: Inactive to total LRU memory ratio.
> + * @DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP: Scheme-eligible memory ratio of a
> + * node.
> + * @DAMOS_QUOTA_NODE_INELIGIBLE_MEM_BP: Scheme-ineligible memory ratio of a
> + * node.
> * @NR_DAMOS_QUOTA_GOAL_METRICS: Number of DAMOS quota goal metrics.
> *
> * Metrics equal to larger than @NR_DAMOS_QUOTA_GOAL_METRICS are unsupported.
> @@ -206,6 +210,8 @@ enum damos_quota_goal_metric {
> DAMOS_QUOTA_NODE_MEMCG_FREE_BP,
> DAMOS_QUOTA_ACTIVE_MEM_BP,
> DAMOS_QUOTA_INACTIVE_MEM_BP,
> + DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP,
> + DAMOS_QUOTA_NODE_INELIGIBLE_MEM_BP,
> NR_DAMOS_QUOTA_GOAL_METRICS,
> };
>
> diff --git a/mm/damon/core.c b/mm/damon/core.c
> index b9e12865622c..3e0ac65e34a0 100644
> --- a/mm/damon/core.c
> +++ b/mm/damon/core.c
> @@ -17,6 +17,8 @@
> #include <linux/string.h>
> #include <linux/string_choices.h>
>
> +#include "ops-common.h"
> +

I don't find a reason to include this, and I'd like to avoid including that in
core.c unless it is really necessary. Could you please remove this?

Below looks all good for RFC level code to move on to the next stage (dropping
RFC tag). :)


Thanks,
SJ

[...]