Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm/damon/core: commit damos_quota_goal->nid

DAMOS quota goal uses 'nid' field when the metric is
DAMOS_QUOTA_NODE_MEM_{USED,FREE}_BP. But the goal commit function is not
updating the goal's nid field. Fix it.

Link: https://lkml.kernel.org/r/20250719181932.72944-1-sj@kernel.org
Fixes: 0e1c773b501f ("mm/damon/core: introduce damos quota goal metrics for memory node utilization") [6.16.x]
Signed-off-by: SeongJae Park <sj@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

SeongJae Park and committed by
Andrew Morton
1aef9df0 6ade1533

+15
+15
mm/damon/core.c
··· 754 754 return NULL; 755 755 } 756 756 757 + static void damos_commit_quota_goal_union( 758 + struct damos_quota_goal *dst, struct damos_quota_goal *src) 759 + { 760 + switch (dst->metric) { 761 + case DAMOS_QUOTA_NODE_MEM_USED_BP: 762 + case DAMOS_QUOTA_NODE_MEM_FREE_BP: 763 + dst->nid = src->nid; 764 + break; 765 + default: 766 + break; 767 + } 768 + } 769 + 757 770 static void damos_commit_quota_goal( 758 771 struct damos_quota_goal *dst, struct damos_quota_goal *src) 759 772 { ··· 775 762 if (dst->metric == DAMOS_QUOTA_USER_INPUT) 776 763 dst->current_value = src->current_value; 777 764 /* keep last_psi_total as is, since it will be updated in next cycle */ 765 + damos_commit_quota_goal_union(dst, src); 778 766 } 779 767 780 768 /** ··· 809 795 src_goal->metric, src_goal->target_value); 810 796 if (!new_goal) 811 797 return -ENOMEM; 798 + damos_commit_quota_goal_union(new_goal, src_goal); 812 799 damos_add_quota_goal(dst, new_goal); 813 800 } 814 801 return 0;