From: Andrew Morton <akpm@linux-foundation.org>
To: SeongJae Park <sj@kernel.org>
Cc: changbin.du@gmail.com, mm-commits@vger.kernel.org, sjpark@amazon.de
Subject: Re: + mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch added to -mm tree
Date: Tue, 28 Sep 2021 15:49:06 -0700 [thread overview]
Message-ID: <20210928154906.24a727916edc995b5d7bd25f@linux-foundation.org> (raw)
In-Reply-To: <20210928073124.14874-1-sj@kernel.org>
On Tue, 28 Sep 2021 07:31:24 +0000 SeongJae Park <sj@kernel.org> wrote:
> > Meanwhile, to be symmetrical make the 'starts' and 'finishes' logs both info
> > level.
>
> We want to log those consistently using 'pr_debug()'[1]. I guess Andrew has
> already updated the patch to use 'pr_debug()', but didn't update this commit
> message.
>
> Andrew, could you please update above commit message?
Done, thanks.
From: Changbin Du <changbin.du@gmail.com>
Subject: 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>
---
mm/damon/core.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
--- a/mm/damon/core.c~mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond
+++ a/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);
_
prev parent reply other threads:[~2021-09-28 22:49 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-28 0:09 + mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch added to -mm tree akpm
2021-09-28 7:31 ` SeongJae Park
2021-09-28 22:49 ` Andrew Morton [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210928154906.24a727916edc995b5d7bd25f@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=changbin.du@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mm-commits@vger.kernel.org \
--cc=sj@kernel.org \
--cc=sjpark@amazon.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.