提交 42e4cef5 编写于 作者: C Changbin Du 提交者: Linus Torvalds

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/20210927232432.17750-1-changbin.du@gmail.comSigned-off-by: NChangbin Du <changbin.du@gmail.com>
Reviewed-by: NSeongJae Park <sj@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 5f7fe2b9
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册