diff options
author | Changbin Du <[email protected]> | 2021-11-05 13:46:12 -0700 |
---|---|---|
committer | Linus Torvalds <[email protected]> | 2021-11-06 13:30:44 -0700 |
commit | 42e4cef5fe48333e0db6e98b019edf5f2c2f11fd (patch) | |
tree | 2a3b6429dbec12f07c412409cb4fbe1e68618bcf | |
parent | 5f7fe2b9b827662cf349ab45406d6cbf0cc6251f (diff) |
mm/damon: needn't hold kdamond_lock to print pid of kdamond
Just get the pid by 'current->pid'. Meanwhile, to be symmetrical make
the 'starts' and 'finishes' logs both use debug level.
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Changbin Du <[email protected]>
Reviewed-by: SeongJae Park <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r-- | mm/damon/core.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/mm/damon/core.c b/mm/damon/core.c index 61a9e3b37bc9..8171e7dddc30 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -652,9 +652,7 @@ static int kdamond_fn(void *data) unsigned int max_nr_accesses = 0; unsigned long sz_limit = 0; - mutex_lock(&ctx->kdamond_lock); - pr_debug("kdamond (%d) starts\n", ctx->kdamond->pid); - mutex_unlock(&ctx->kdamond_lock); + pr_debug("kdamond (%d) starts\n", current->pid); if (ctx->primitive.init) ctx->primitive.init(ctx); @@ -705,7 +703,7 @@ static int kdamond_fn(void *data) if (ctx->primitive.cleanup) ctx->primitive.cleanup(ctx); - pr_debug("kdamond (%d) finishes\n", ctx->kdamond->pid); + pr_debug("kdamond (%d) finishes\n", current->pid); mutex_lock(&ctx->kdamond_lock); ctx->kdamond = NULL; mutex_unlock(&ctx->kdamond_lock); |