linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Mitchel Humpherys <mitchelh@codeaurora.org>
Cc: Christoph Lameter <cl@linux-foundation.org>,
	Pekka Enberg <penberg@kernel.org>, Matt Mackall <mpm@selenic.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: convert some level-less printks to pr_*
Date: Wed, 26 Mar 2014 17:07:10 -0700	[thread overview]
Message-ID: <1395878830.3726.55.camel@joe-AO722> (raw)
In-Reply-To: <1395877783-18910-2-git-send-email-mitchelh@codeaurora.org>

On Wed, 2014-03-26 at 16:49 -0700, Mitchel Humpherys wrote:
> printk is meant to be used with an associated log level. There are some
> instances of printk scattered around the mm code where the log level is
> missing. Add a log level and adhere to suggestions by
> scripts/checkpatch.pl by moving to the pr_* macros.

There are some defects in this patch:
Conversions of printk to pr_info that should be pr_cont.

I've also got some other trivial comments about it.

For each file modified, if it's not already there,
please add before any #include

#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

[]

> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
[]
> @@ -2751,7 +2752,7 @@ void __init numa_policy_init(void)
>  		node_set(prefer, interleave_nodes);
>  
>  	if (do_set_mempolicy(MPOL_INTERLEAVE, 0, &interleave_nodes))
> -		printk("numa_policy_init: interleaving failed\n");
> +		pr_warn("numa_policy_init: interleaving failed\n");

That seems more like pr_err to me.

Also please remove embedded function names and use
"%s: ", __func__

> @@ -3237,7 +3238,7 @@ static struct notifier_block reserve_mem_nb = {
>  static int __meminit init_reserve_notifier(void)
>  {
>  	if (register_hotmemory_notifier(&reserve_mem_nb))
> -		printk("Failed registering memory add/remove notifier for admin reserve");
> +		pr_info("Failed registering memory add/remove notifier for admin reserve");

Another more likely pr_err
Also missing a "\n" terminating newline

> diff --git a/mm/nommu.c b/mm/nommu.c
[]
> @@ -1241,7 +1242,7 @@ error_free:
>  	return ret;
>  
>  enomem:
> -	printk("Allocation of length %lu from process %d (%s) failed\n",
> +	pr_warn("Allocation of length %lu from process %d (%s) failed\n",
>  	       len, current->pid, current->comm);

pr_err

> diff --git a/mm/slub.c b/mm/slub.c
[]
> @@ -1774,15 +1775,15 @@ static inline void note_cmpxchg_failure(const char *n,
>  
>  #ifdef CONFIG_PREEMPT
>  	if (tid_to_cpu(tid) != tid_to_cpu(actual_tid))
> -		printk("due to cpu change %d -> %d\n",
> +		pr_info("due to cpu change %d -> %d\n",
>  			tid_to_cpu(tid), tid_to_cpu(actual_tid));

This should be pr_cont

>  	else
>  #endif
>  	if (tid_to_event(tid) != tid_to_event(actual_tid))
> -		printk("due to cpu running other code. Event %ld->%ld\n",
> +		pr_info("due to cpu running other code. Event %ld->%ld\n",

pr_cont

>  			tid_to_event(tid), tid_to_event(actual_tid));
>  	else
> -		printk("for unknown reason: actual=%lx was=%lx target=%lx\n",
> +		pr_info("for unknown reason: actual=%lx was=%lx target=%lx\n",

pr_cont

>  			actual_tid, tid, next_tid(tid));
>  #endif
>  	stat(s, CMPXCHG_DOUBLE_CPU_FAIL);


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-03-27  0:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-26 23:49 [PATCH] Some printk cleanup in mm Mitchel Humpherys
2014-03-26 23:49 ` [PATCH] mm: convert some level-less printks to pr_* Mitchel Humpherys
2014-03-27  0:07   ` Joe Perches [this message]
2014-03-27  0:38   ` Christoph Lameter
2014-03-27 16:10     ` Christoph Lameter

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=1395878830.3726.55.camel@joe-AO722 \
    --to=joe@perches.com \
    --cc=cl@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mitchelh@codeaurora.org \
    --cc=mpm@selenic.com \
    --cc=penberg@kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).