mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-10 20:02:10 -04:00
mm/damon/sysfs: don't hold kdamond_lock in before_terminate()
damon_sysfs_before_terminate() is a DAMON callback that is executed from the kdamond's context. Hence it is safe to access DAMON context internal data. But the function is unnecessarily holding kdamond_lock of the context. It is just unnecessary. Remove the locking code. Link: https://lkml.kernel.org/r/20250705175000.56259-6-sj@kernel.org Signed-off-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
This commit is contained in:
committed by
Andrew Morton
parent
d2b5be741a
commit
e000df9ff1
@@ -1387,12 +1387,10 @@ static void damon_sysfs_before_terminate(struct damon_ctx *ctx)
|
||||
if (!damon_target_has_pid(ctx))
|
||||
return;
|
||||
|
||||
mutex_lock(&ctx->kdamond_lock);
|
||||
damon_for_each_target_safe(t, next, ctx) {
|
||||
put_pid(t->pid);
|
||||
damon_destroy_target(t);
|
||||
}
|
||||
mutex_unlock(&ctx->kdamond_lock);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user