All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch added to -mm tree
@ 2021-09-28  0:09 akpm
  2021-09-28  7:31 ` SeongJae Park
  0 siblings, 1 reply; 3+ messages in thread
From: akpm @ 2021-09-28  0:09 UTC (permalink / raw)
  To: changbin.du, mm-commits, sjpark


The patch titled
     Subject: mm/damon: needn't hold kdamond_lock to print pid of kdamond
has been added to the -mm tree.  Its filename is
     mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
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 info level.

Link: https://lkml.kernel.org/r/20210927232432.17750-1-changbin.du@gmail.com
Signed-off-by: Changbin Du <changbin.du@gmail.com>
Cc: SeongJae Park <sjpark@amazon.de>
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);
_

Patches currently in -mm which might be from changbin.du@gmail.com are

mm-damon-remove-unnecessary-do_exit-from-kdamond.patch
mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: + mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch added to -mm tree
  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
  0 siblings, 1 reply; 3+ messages in thread
From: SeongJae Park @ 2021-09-28  7:31 UTC (permalink / raw)
  To: akpm; +Cc: changbin.du, mm-commits, sjpark

On Mon, 27 Sep 2021 17:09:11 -0700 akpm@linux-foundation.org wrote:

> 
> The patch titled
>      Subject: mm/damon: needn't hold kdamond_lock to print pid of kdamond
> has been added to the -mm tree.  Its filename is
>      mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch
> 
> This patch should soon appear at
>     https://ozlabs.org/~akpm/mmots/broken-out/mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch
> and later at
>     https://ozlabs.org/~akpm/mmotm/broken-out/mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch
> 
> Before you just go and hit "reply", please:
>    a) Consider who else should be cc'ed
>    b) Prefer to cc a suitable mailing list as well
>    c) Ideally: find the original patch on the mailing list and do a
>       reply-to-all to that, adding suitable additional cc's
> 
> *** Remember to use Documentation/process/submit-checklist.rst when testing your code ***
> 
> The -mm tree is included into linux-next and is updated
> there every 3-4 working days
> 
> ------------------------------------------------------
> 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'.

Looks good to me :)

> 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?

[1] https://lore.kernel.org/mm-commits/20210919232257.ZFV1L%25akpm@linux-foundation.org/

> 
> Link: https://lkml.kernel.org/r/20210927232432.17750-1-changbin.du@gmail.com
> Signed-off-by: Changbin Du <changbin.du@gmail.com>
> Cc: SeongJae Park <sjpark@amazon.de>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

Reviewed-by: SeongJae Park <sj@kernel.org>


Thanks,
SJ

> ---
> 
>  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);
> _
> 
> Patches currently in -mm which might be from changbin.du@gmail.com are
> 
> mm-damon-remove-unnecessary-do_exit-from-kdamond.patch
> mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: + mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch added to -mm tree
  2021-09-28  7:31 ` SeongJae Park
@ 2021-09-28 22:49   ` Andrew Morton
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Morton @ 2021-09-28 22:49 UTC (permalink / raw)
  To: SeongJae Park; +Cc: changbin.du, mm-commits, sjpark

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);
_


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-09-28 22:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 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.