Skip to content

Commit 42e4cef

Browse files
changbindutorvalds
authored andcommitted
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]>
1 parent 5f7fe2b commit 42e4cef

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

mm/damon/core.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -652,9 +652,7 @@ static int kdamond_fn(void *data)
652652
unsigned int max_nr_accesses = 0;
653653
unsigned long sz_limit = 0;
654654

655-
mutex_lock(&ctx->kdamond_lock);
656-
pr_debug("kdamond (%d) starts\n", ctx->kdamond->pid);
657-
mutex_unlock(&ctx->kdamond_lock);
655+
pr_debug("kdamond (%d) starts\n", current->pid);
658656

659657
if (ctx->primitive.init)
660658
ctx->primitive.init(ctx);
@@ -705,7 +703,7 @@ static int kdamond_fn(void *data)
705703
if (ctx->primitive.cleanup)
706704
ctx->primitive.cleanup(ctx);
707705

708-
pr_debug("kdamond (%d) finishes\n", ctx->kdamond->pid);
706+
pr_debug("kdamond (%d) finishes\n", current->pid);
709707
mutex_lock(&ctx->kdamond_lock);
710708
ctx->kdamond = NULL;
711709
mutex_unlock(&ctx->kdamond_lock);

0 commit comments

Comments
 (0)