Message ID | 20211221220539.x5Uvm%akpm@linux-foundation.org |
---|---|
State | Superseded |
Headers | show |
Series | + mm-damon-dbgfs-protect-targets-destructions-with-kdamond_lock.patch added to -mm tree | expand |
--- a/mm/damon/dbgfs.c~mm-damon-dbgfs-protect-targets-destructions-with-kdamond_lock +++ a/mm/damon/dbgfs.c @@ -650,10 +650,12 @@ static void dbgfs_before_terminate(struc if (!targetid_is_pid(ctx)) return; + mutex_lock(&ctx->kdamond_lock); damon_for_each_target_safe(t, next, ctx) { put_pid((struct pid *)t->id); damon_destroy_target(t); } + mutex_unlock(&ctx->kdamond_lock); } static struct damon_ctx *dbgfs_new_ctx(void)