Re: [RFC PATCH v4 3/4] mm/damon/sysfs: support hugepage_mem_bp quota goal metric

From: SeongJae Park

Date: Thu Jun 11 2026 - 20:32:13 EST


On Thu, 11 Jun 2026 15:02:43 +0000 <gutierrez.asier@xxxxxxxxxxxxxxxxxxx> wrote:

> From: Asier Gutierrez <gutierrez.asier@xxxxxxxxxxxxxxxxxxx>
>
> Add the "hugepage_mem_bp" to the sysfs-schemes interface. Also handle
> DAMOS_QUOTA_HUGEPAGE_MEM_BP when constructing quota goals.
>
> Signed-off-by: Asier Gutierrez <gutierrez.asier@xxxxxxxxxxxxxxxxxxx>
> ---
> mm/damon/sysfs-schemes.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/mm/damon/sysfs-schemes.c b/mm/damon/sysfs-schemes.c
> index 329cfd0bbe9f..dc46ec128083 100644
> --- a/mm/damon/sysfs-schemes.c
> +++ b/mm/damon/sysfs-schemes.c
> @@ -1267,6 +1267,10 @@ struct damos_sysfs_qgoal_metric_name damos_sysfs_qgoal_metric_names[] = {
> .metric = DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP,
> .name = "node_eligible_mem_bp",
> },
> + {
> + .metric = DAMOS_QUOTA_HUGEPAGE_MEM_BP,
> + .name = "hugepage_mem_bp",
> + },
> };
>
> static ssize_t target_metric_show(struct kobject *kobj,
> @@ -2877,6 +2881,9 @@ static int damos_sysfs_add_quota_score(
> case DAMOS_QUOTA_NODE_ELIGIBLE_MEM_BP:
> goal->nid = sysfs_goal->nid;
> break;
> + case DAMOS_QUOTA_HUGEPAGE_MEM_BP:
> + goal->current_value = sysfs_goal->current_value;
> + break;

We do this for only DAMOS_QUOTA_USER_INPUT, because that needs to receive the
user input. For other metrics that DAMOS self-find the values, this is not
needed. Same for HUGEPAGE_MEM_BP. So I don't think this change is needed.

Please let me know if I'm missing something.


Thanks,
SJ

[...]