diff options
author | SeongJae Park <[email protected]> | 2023-10-22 21:07:33 +0000 |
---|---|---|
committer | Andrew Morton <[email protected]> | 2023-11-01 12:38:35 -0700 |
commit | 19467a950b49432a84bf6dbadbbb17bdf89418b7 (patch) | |
tree | 655f2f496eeab04ea2cd9ffef9ffd0dfc861bc0c /tools/perf/util/trace-event-scripting.c | |
parent | 6479b29203dedb724f4f4e08e1cc0dcf432c333b (diff) |
mm/damon/sysfs: remove requested targets when online-commit inputs
damon_sysfs_set_targets(), which updates the targets of the context for
online commitment, do not remove targets that removed from the
corresponding sysfs files. As a result, more than intended targets of the
context can exist and hence consume memory and monitoring CPU resource
more than expected.
Fix it by removing all targets of the context and fill up again using the
user input. This could cause unnecessary memory dealloc and realloc
operations, but this is not a hot code path. Also, note that damon_target
is stateless, and hence no data is lost.
[[email protected]: fix unnecessary monitoring results removal]
Link: https://lkml.kernel.org/r/[email protected]
Link: https://lkml.kernel.org/r/[email protected]
Fixes: da87878010e5 ("mm/damon/sysfs: support online inputs update")
Signed-off-by: SeongJae Park <[email protected]>
Cc: Brendan Higgins <[email protected]>
Cc: <[email protected]> [5.19.x]
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/perf/util/trace-event-scripting.c')
0 files changed, 0 insertions, 0 deletions