public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Petr Mladek <pmladek@suse.cz>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Jiri Kosina <jkosina@suse.cz>,
	linux-kernel@vger.kernel.org, x86@kernel.org
Subject: Re: [PATCH 2/6] x86: allow to call text_poke_bp during boot
Date: Sat, 19 Oct 2013 14:33:50 -0700	[thread overview]
Message-ID: <20131019213350.GH4118@linux.vnet.ibm.com> (raw)
In-Reply-To: <20131019151919.2d4778d2@gandalf.local.home>

On Sat, Oct 19, 2013 at 03:19:19PM -0400, Steven Rostedt wrote:
> 
> [ Added Paul because he'll understand this ]
> 
> On Sat, 19 Oct 2013 15:16:58 -0400
> Steven Rostedt <rostedt@goodmis.org> wrote:
> 
> > On Sun, 20 Oct 2013 00:02:32 +0900
> > Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> wrote:
> > 
> > > (2013/10/18 23:27), Petr Mladek wrote:
> > > > We would like to use text_poke_bp in ftrace. It might be called also during
> > > > boot when the interupts are disabled. We need to enable them for syncing
> > > > the cores on each CPU. Otherwise, there might be a deadlock, see the
> > > > warning in "smp_call_function_many", kernel/smp.c:371.
> > > 
> > > Steven, is this really needed?
> > > I think if this is the special use(e.g. boottime test),
> > > we'd better to run it after boot...
> > > 
> > 
> > It's used to convert the calls to mcount to nops. But maybe a better
> > thing to do is to check if we only have a single CPU:
> > 
> > static void run_sync(void)
> > {
> > 	if (num_online_cpus() != 1)
> 
> Hmm, to be more robust to handle our future "ideal" machines, perhaps
> this should be:
> 
> 	/* Ideally we would like to run on zero CPUS! */
> 	if (num_online_cpus() < 2)

To be really safe, shouldn't you use complex numbers?  Just in case
you end up running on a system with 5i-3 CPUs or something.  ;-)

							Thanx, Paul

> -- Steve
> 
> 
> > 		on_each_cpu(do_sync_core, NULL, 1);
> > }
> > 
> > 
> > I believe that the only time we call this function with interrupts
> > disabled is before SMP is set up. Thus, the above change would handle
> > that case.
> > 
> > -- Steve
> 


  reply	other threads:[~2013-10-19 21:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 14:27 [PATCH 2/6] x86: allow to call text_poke_bp during boot Petr Mladek
2013-10-19 15:02 ` Masami Hiramatsu
2013-10-19 19:16   ` Steven Rostedt
2013-10-19 19:19     ` Steven Rostedt
2013-10-19 21:33       ` Paul E. McKenney [this message]
2013-10-19 21:58         ` Steven Rostedt
2013-10-19 22:02         ` Steven Rostedt
2013-10-20 15:42           ` Paul E. McKenney
2013-10-28  9:18             ` Masami Hiramatsu

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=20131019213350.GH4118@linux.vnet.ibm.com \
    --to=paulmck@linux.vnet.ibm.com \
    --cc=fweisbec@gmail.com \
    --cc=jkosina@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=pmladek@suse.cz \
    --cc=rostedt@goodmis.org \
    --cc=x86@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