All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman.id.au>
To: Christophe Leroy <christophe.leroy@c-s.fr>, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/2] powerpc: Use seq_buf to avoid pr_cont() in __die()
Date: Thu, 10 Jan 2019 21:54:28 +1100	[thread overview]
Message-ID: <87k1jcsryz.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <53b82835-630a-beb9-8a4e-5badc07960c9@c-s.fr>

Christophe Leroy <christophe.leroy@c-s.fr> writes:
> Le 08/01/2019 à 13:04, Michael Ellerman a écrit :
>> Using pr_cont() risks having our output interleaved with other output
>> from other CPUs. Instead use a seq_buf to construct the line and then
>> print it as a whole.
>
> Why not simply doing a single printk() or similar on the same model as 
> X86 for instance ? 
> (https://elixir.bootlin.com/linux/v5.0-rc1/source/arch/x86/kernel/dumpstack.c#L368)

Yeah we could do it that way, though it can become a bit of a mess.

In this case I guess it's not *too* bad:

	printk("%s PAGE_SIZE=%luK%s%s%s%s%s %s\n",
	       IS_ENABLED(CONFIG_CPU_LITTLE_ENDIAN) ? "LE" : "BE",
	       PAGE_SIZE / 1024,
	       IS_ENABLED(CONFIG_PREEMPT) ? " PREEMPT" : "",
	       IS_ENABLED(CONFIG_SMP) ? " SMP" : "",
	       IS_ENABLED(CONFIG_SMP) ? (" NR_CPUS=" __stringify(NR_CPUS)) : "",
	       debug_pagealloc_enabled() ? " DEBUG_PAGEALLOC" : "",
	       IS_ENABLED(CONFIG_NUMA) ? " NUMA" : "",
	       ppc_md.name ? ppc_md.name : "");

And the generated code is obviously a lot smaller.

So yeah I'll go with that. Thanks for the review.

cheers

      reply	other threads:[~2019-01-10 10:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-08 12:04 [PATCH 1/2] powerpc: Use seq_buf to avoid pr_cont() in __die() Michael Ellerman
2019-01-08 12:05 ` [PATCH 2/2] powerpc: Show PAGE_SIZE in __die() output Michael Ellerman
2019-01-08 12:21   ` Christophe Leroy
2019-01-09  7:47     ` Christophe Leroy
2019-01-10  1:02       ` Michael Ellerman
2019-01-08 12:18 ` [PATCH 1/2] powerpc: Use seq_buf to avoid pr_cont() in __die() Christophe Leroy
2019-01-10 10:54   ` Michael Ellerman [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=87k1jcsryz.fsf@concordia.ellerman.id.au \
    --to=mpe@ellerman.id.au \
    --cc=christophe.leroy@c-s.fr \
    --cc=linuxppc-dev@ozlabs.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 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.