]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mm/damon/core: skip needless update of damon_attrs in damon_commit_ctx()
authorBijan Tabatabai <bijantabatab@micron.com>
Wed, 6 Aug 2025 23:42:54 +0000 (18:42 -0500)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 13 Sep 2025 23:54:47 +0000 (16:54 -0700)
commitdc32c8d4875fdd27b43d5c295853860f4d647055
tree81751d9c7825a43d1817f046934bae34e9149af6
parent878d9e8cebbb111a678e1f83d7daee917922f700
mm/damon/core: skip needless update of damon_attrs in damon_commit_ctx()

Currently, damon_commit_ctx() always calls damon_set_attrs() even if the
attributes have not been changed.  This can be problematic when the DAMON
state is committed relatively frequently because damon_set_attrs() resets
ctx->next_{aggregation,ops_update}_sis, causing aggregation and ops update
operations to be needlessly delayed.

This patch avoids this by only calling damon_set_attrs() in
damon_commit_ctx when the attributes have been changed.

[akpm@linux-foundation.org:
Link: https://lkml.kernel.org/r/20250807001924.76275-1-sj@kernel.org
Link: https://lkml.kernel.org/r/20250806234254.10572-1-bijan311@gmail.com
Signed-off-by: Bijan Tabatabai <bijantabatab@micron.com>
Reviewed-by: SeongJae Park <sj@kernel.org>
Cc: Bijan Tabatabai <bijan311@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/damon/core.c