UPSTREAM: 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.com Signed-off-by: Changbin Du <changbin.du@gmail.com> Reviewed-by: SeongJae Park <sj@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry picked from commit 42e4cef5fe48333e0db6e98b019edf5f2c2f11fd) Bug: 228223814 Signed-off-by: zhijun wan <wanzhijun@oppo.com> Change-Id: I6ea6f697795a43663f7c20e87c07cddae891a231
This commit is contained in:
committed by
Suren Baghdasaryan
parent
2df0d2dbd1
commit
340c92bec2
@@ -660,9 +660,7 @@ static int kdamond_fn(void *data)
|
|||||||
unsigned int max_nr_accesses = 0;
|
unsigned int max_nr_accesses = 0;
|
||||||
unsigned long sz_limit = 0;
|
unsigned long sz_limit = 0;
|
||||||
|
|
||||||
mutex_lock(&ctx->kdamond_lock);
|
pr_debug("kdamond (%d) starts\n", current->pid);
|
||||||
pr_debug("kdamond (%d) starts\n", ctx->kdamond->pid);
|
|
||||||
mutex_unlock(&ctx->kdamond_lock);
|
|
||||||
|
|
||||||
if (ctx->primitive.init)
|
if (ctx->primitive.init)
|
||||||
ctx->primitive.init(ctx);
|
ctx->primitive.init(ctx);
|
||||||
@@ -713,7 +711,7 @@ static int kdamond_fn(void *data)
|
|||||||
if (ctx->primitive.cleanup)
|
if (ctx->primitive.cleanup)
|
||||||
ctx->primitive.cleanup(ctx);
|
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);
|
mutex_lock(&ctx->kdamond_lock);
|
||||||
ctx->kdamond = NULL;
|
ctx->kdamond = NULL;
|
||||||
mutex_unlock(&ctx->kdamond_lock);
|
mutex_unlock(&ctx->kdamond_lock);
|
||||||
|
|||||||
Reference in New Issue
Block a user