]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/damon/core: use damos_commit_quota_goal() for new goal commit
authorSeongJae Park <sj@kernel.org>
Tue, 14 Oct 2025 00:18:44 +0000 (17:18 -0700)
committerAndrew Morton <akpm@linux-foundation.org>
Tue, 21 Oct 2025 22:46:18 +0000 (15:46 -0700)
commit7eca961dd7188f20fdf8ce9ed5018280f79b2438
tree57849995bb44332e55277f6d30bf58945fc8d922
parent7071537159be845a5c4ed5fb7d3db25aa4bd04a3
mm/damon/core: use damos_commit_quota_goal() for new goal commit

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>
mm/damon/core.c