summaryrefslogtreecommitdiffstats
path: root/mm/damon
diff options
context:
space:
mode:
authorXin Hao <xhao@linux.alibaba.com>2022-09-07 16:41:16 +0800
committerAndrew Morton <akpm@linux-foundation.org>2022-10-03 14:03:03 -0700
commit61768a1b37c664faf028d925e6b7825768afcc00 (patch)
tree5c01a6aea9dacdd6d4a3b63b9a7793e79245320c /mm/damon
parent36001cba4f728e7fa2a58bc69fece22eaeef5cca (diff)
downloadlinux-61768a1b37c664faf028d925e6b7825768afcc00.tar.bz2
mm/damon: simplify damon_ctx check in damon_sysfs_before_terminate
In damon_sysfs_before_terminate(), it needs to check whether ctx->ops.id supports 'DAMON_OPS_VADDR' or 'DAMON_OPS_FVADDR', there we can use damon_target_has_pid() instead. Link: https://lkml.kernel.org/r/20220907084116.62053-1-xhao@linux.alibaba.com Signed-off-by: Xin Hao <xhao@linux.alibaba.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm/damon')
-rw-r--r--mm/damon/sysfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index fe6c6870cf86..1719bb3531e3 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -2309,7 +2309,7 @@ static void damon_sysfs_before_terminate(struct damon_ctx *ctx)
{
struct damon_target *t, *next;
- if (ctx->ops.id != DAMON_OPS_VADDR && ctx->ops.id != DAMON_OPS_FVADDR)
+ if (!damon_target_has_pid(ctx))
return;
mutex_lock(&ctx->kdamond_lock);