* [PATCH] mm/damon: Simply damon_ctx check in damon_sysfs_before_terminate
@ 2022-09-07 8:41 Xin Hao
2022-09-07 16:57 ` SeongJae Park
0 siblings, 1 reply; 2+ messages in thread
From: Xin Hao @ 2022-09-07 8:41 UTC (permalink / raw)
To: sj; +Cc: akpm, damon, linux-mm, linux-kernel, xhao
In damon_sysfs_before_terminate() func, it need to check whether
ctx->ops.id supports 'DAMON_OPS_VADDR' or 'DAMON_OPS_FVADDR', there we
can use damon_target_has_pid() instead.
Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
---
mm/damon/sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index 7488e27c87c3..88f208ff235d 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);
--
2.31.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mm/damon: Simply damon_ctx check in damon_sysfs_before_terminate
2022-09-07 8:41 [PATCH] mm/damon: Simply damon_ctx check in damon_sysfs_before_terminate Xin Hao
@ 2022-09-07 16:57 ` SeongJae Park
0 siblings, 0 replies; 2+ messages in thread
From: SeongJae Park @ 2022-09-07 16:57 UTC (permalink / raw)
To: Xin Hao; +Cc: sj, akpm, damon, linux-mm, linux-kernel
Hi Xin,
Nit: I'd suggest to 's/Simply/simplify/' in the subject.
On Wed, 7 Sep 2022 16:41:16 +0800 Xin Hao <xhao@linux.alibaba.com> wrote:
> In damon_sysfs_before_terminate() func, it need to check whether
> ctx->ops.id supports 'DAMON_OPS_VADDR' or 'DAMON_OPS_FVADDR', there we
> can use damon_target_has_pid() instead.
>
> Signed-off-by: Xin Hao <xhao@linux.alibaba.com>
Other than the above trivial nit,
Reviewed-by: SeongJae Park <sj@kernel.org>
Thanks,
SJ
> ---
> mm/damon/sysfs.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
> index 7488e27c87c3..88f208ff235d 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);
> --
> 2.31.0
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-09-07 16:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-07 8:41 [PATCH] mm/damon: Simply damon_ctx check in damon_sysfs_before_terminate Xin Hao
2022-09-07 16:57 ` SeongJae Park
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).