public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Tejun Heo <tj@kernel.org>
Cc: Christoph Lameter <cl@linux-foundation.org>,
	linux-kernel@vger.kernel.org, Kay Sievers <kay.sievers@vrfy.org>
Subject: Re: [PATCH] percpu: use KERN_CONT in pcpu_dump_alloc_info()
Date: Thu, 29 Mar 2012 11:10:12 -0700	[thread overview]
Message-ID: <1333044612.15602.4.camel@joe2Laptop> (raw)
In-Reply-To: <20120329164842.GE28941@google.com>

On Thu, 2012-03-29 at 09:48 -0700, Tejun Heo wrote:
> >From cb129820f1e6ccf309510f4eb28df45cb0742005 Mon Sep 17 00:00:00 2001
> From: Tejun Heo <tj@kernel.org>
> Date: Thu, 29 Mar 2012 09:45:58 -0700
> 
> pcpu_dump_alloc_info() was printing continued lines without KERN_CONT.
> Use it.
> 
> Signed-off-by: Tejun Heo <tj@kernel.org>
> Reported-by: Kay Sievers <kay.sievers@vrfy.org>
> ---
> Committed to percpu/for-3.4-fixes.
> 
> Thanks.
> 
>  mm/percpu.c |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/mm/percpu.c b/mm/percpu.c
> index f47af91..f921fdf 100644
> --- a/mm/percpu.c
> +++ b/mm/percpu.c
> @@ -1132,20 +1132,20 @@ static void pcpu_dump_alloc_info(const char *lvl,
>  		for (alloc_end += gi->nr_units / upa;
>  		     alloc < alloc_end; alloc++) {
>  			if (!(alloc % apl)) {
> -				printk("\n");
> +				printk(KERN_CONT "\n");
>  				printk("%spcpu-alloc: ", lvl);
>  			}
> -			printk("[%0*d] ", group_width, group);
> +			printk(KERN_CONT "[%0*d] ", group_width, group);
>  
>  			for (unit_end += upa; unit < unit_end; unit++)
>  				if (gi->cpu_map[unit] != NR_CPUS)
> -					printk("%0*d ", cpu_width,
> +					printk(KERN_CONT "%0*d ", cpu_width,
>  					       gi->cpu_map[unit]);
>  				else
> -					printk("%s ", empty_str);
> +					printk(KERN_CONT "%s ", empty_str);
>  		}
>  	}
> -	printk("\n");
> +	printk(KERN_CONT "\n");
>  }

Perhaps it's better to try to print lines
in fewer printks?  Maybe use a line buffer?

The first line could be newline terminated.
"if (alloc)" tests for the individual newlines could be added.
Why aren't the group widths on separate lines?
All of the cpu_widths are on the same line as the parent group
even if that exceeds apl.  Is that what's desired?



  reply	other threads:[~2012-03-29 18:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29 16:48 [PATCH] percpu: use KERN_CONT in pcpu_dump_alloc_info() Tejun Heo
2012-03-29 18:10 ` Joe Perches [this message]
2012-03-29 19:51   ` Tejun Heo
2012-03-29 20:06     ` Joe Perches
2012-03-29 20:11       ` Tejun Heo
2012-04-01 13:29         ` Kay Sievers
2012-04-01 14:55           ` Joe Perches

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=1333044612.15602.4.camel@joe2Laptop \
    --to=joe@perches.com \
    --cc=cl@linux-foundation.org \
    --cc=kay.sievers@vrfy.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@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