Re: + mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 27 Sep 2021 17:09:11 -0700 akpm@xxxxxxxxxxxxxxxxxxxx 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@xxxxxxxxx>
> 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@xxxxxxxxxxxxxxxxxxxx/

> 
> Link: https://lkml.kernel.org/r/20210927232432.17750-1-changbin.du@xxxxxxxxx
> Signed-off-by: Changbin Du <changbin.du@xxxxxxxxx>
> Cc: SeongJae Park <sjpark@xxxxxxxxx>
> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>

Reviewed-by: SeongJae Park <sj@xxxxxxxxxx>


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@xxxxxxxxx are
> 
> mm-damon-remove-unnecessary-do_exit-from-kdamond.patch
> mm-damon-neednt-hold-kdamond_lock-to-print-pid-of-kdamond.patch



[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux