summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSeongJae Park <sj@kernel.org>2025-10-13 17:18:44 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-29 14:10:25 +0100
commita5b2e433786a6ea49a8884ebaedd256eab2b2c6f (patch)
tree3f570b8149f9606bc06f7c999c15d0199c629541
parenta3fc0d36cfb927f8986b83bf5fba47dbedad3c63 (diff)
downloadlinux-a5b2e433786a6ea49a8884ebaedd256eab2b2c6f.tar.gz
linux-a5b2e433786a6ea49a8884ebaedd256eab2b2c6f.tar.bz2
linux-a5b2e433786a6ea49a8884ebaedd256eab2b2c6f.zip
mm/damon/core: use damos_commit_quota_goal() for new goal commit
commit 7eca961dd7188f20fdf8ce9ed5018280f79b2438 upstream. When damos_commit_quota_goals() is called for adding new DAMOS quota goals of DAMOS_QUOTA_USER_INPUT metric, current_value fields of the new goals should be also set as requested. However, damos_commit_quota_goals() is not updating the field for the case, since it is setting only metrics and target values using damos_new_quota_goal(), and metric-optional union fields using damos_commit_quota_goal_union(). As a result, users could see the first current_value parameter that committed online with a new quota goal is ignored. Users are assumed to commit the current_value for DAMOS_QUOTA_USER_INPUT quota goals, since it is being used as a feedback. Hence the real impact would be subtle. That said, this is obviously not intended behavior. Fix the issue by using damos_commit_quota_goal() which sets all quota goal parameters, instead of damos_commit_quota_goal_union(), which sets only the union fields. Link: https://lkml.kernel.org/r/20251014001846.279282-1-sj@kernel.org Fixes: 1aef9df0ee90 ("mm/damon/core: commit damos_quota_goal->nid") Signed-off-by: SeongJae Park <sj@kernel.org> Cc: <stable@vger.kernel.org> [6.16+] Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--mm/damon/core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/damon/core.c b/mm/damon/core.c
index 08065b363972..63abf5310734 100644
--- a/mm/damon/core.c
+++ b/mm/damon/core.c
@@ -811,7 +811,7 @@ int damos_commit_quota_goals(struct damos_quota *dst, struct damos_quota *src)
src_goal->metric, src_goal->target_value);
if (!new_goal)
return -ENOMEM;
- damos_commit_quota_goal_union(new_goal, src_goal);
+ damos_commit_quota_goal(new_goal, src_goal);
damos_add_quota_goal(dst, new_goal);
}
return 0;