lkml.org 
[lkml]   [2022]   [May]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] mm/damon/sysfs: fix pid leak under fvaddr ops use case
Date
Commit c83136469313 ("mm/damon/sysfs: support fixed virtual address
ranges monitoring") in 'mm-unstable' does not put the monitoring target
pid when fvaddr ops is used. This commit fixes it to put pid properly.

Andrew, please merge this into the 'mm-unstable' commit
("mm/damon/sysfs: support fixed virtual address ranges monitoring").

Fixes: c83136469313 ("mm/damon/sysfs: support fixed virtual address ranges monitoring")
Signed-off-by: SeongJae Park <sj@kernel.org>
---
mm/damon/sysfs.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/damon/sysfs.c b/mm/damon/sysfs.c
index 767ab8c33e4d..f753bb405101 100644
--- a/mm/damon/sysfs.c
+++ b/mm/damon/sysfs.c
@@ -2086,7 +2086,8 @@ static void damon_sysfs_destroy_targets(struct damon_ctx *ctx)
struct damon_target *t, *next;

damon_for_each_target_safe(t, next, ctx) {
- if (ctx->ops.id == DAMON_OPS_VADDR)
+ if (ctx->ops.id == DAMON_OPS_VADDR ||
+ ctx->ops.id == DAMON_OPS_FVADDR)
put_pid(t->pid);
damon_destroy_target(t);
}
@@ -2204,7 +2205,7 @@ static void damon_sysfs_before_terminate(struct damon_ctx *ctx)
{
struct damon_target *t, *next;

- if (ctx->ops.id != DAMON_OPS_VADDR)
+ if (ctx->ops.id != DAMON_OPS_VADDR && ctx->ops.id != DAMON_OPS_FVADDR)
return;

mutex_lock(&ctx->kdamond_lock);
--
2.25.1
\
 
 \ /
  Last update: 2022-05-04 00:05    [W:0.192 / U:0.708 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site