All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Daney <david.daney@cavium.com>
To: Jeremy Fitzhardinge <jeremy@goop.org>
Cc: Jan Glauber <jang@linux.vnet.ibm.com>,
	Jason Baron <jbaron@redhat.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Michael Ellerman <michael@ellerman.id.au>,
	David Daney <ddaney@caviumnetworks.com>,
	"David S. Miller" <davem@davemloft.net>
Subject: Re: Jump Label initialization
Date: Thu, 29 Sep 2011 10:06:40 -0700	[thread overview]
Message-ID: <4E84A5A0.5010703@cavium.com> (raw)
In-Reply-To: <4E84A09A.2030909@goop.org>

On 09/29/2011 09:45 AM, Jeremy Fitzhardinge wrote:
> On 09/29/2011 05:04 AM, Jan Glauber wrote:
>>
>> s390 does not have the early() variant since it didn't need it. On
>> pre-SMP we probably don't need stop_machine() so creating
>> arch_jump_label_transform_early() by leaving out stop_machine()
>> and patching the code directly should be fine.
>
> Well, it occurs to me that if you're using jump_label_enable() very
> early, then it will be using the full arch_jump_label_transform()
> anyway.  While the stop_machine(), locking, etc that the full version
> does is redundant in a pre-SMP environment, it shouldn't hurt, so
> perhaps there's no need for an _early variant at all.
>

You need a way to guarantee that the code you are modifying is not in 
the instruction cache of the off-line CPUs.

On our (Cavium) SMP MIPS systems, these off-line CPUs are most likely 
spinning in architecture specific smp startup code somewhere in the 
kernel image.  If this code happened to be adjacent to something the 
arch_jump_label_transform_early() would touch, we could have a problem.

The solution is fairly simple, just invalidate the instruction cache 
immediately upon leaving the spinning loop.

David Daney

      reply	other threads:[~2011-09-29 17:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-29  2:14 Jump Label initialization Jeremy Fitzhardinge
2011-09-29  2:28 ` David Miller
2011-09-29  7:37 ` Peter Zijlstra
2011-09-29 22:20   ` Jeremy Fitzhardinge
2011-09-29 22:23     ` Steven Rostedt
2011-09-29 12:04 ` Jan Glauber
2011-09-29 12:40   ` Steven Rostedt
2011-09-29 13:10     ` Jan Glauber
2011-09-29 16:45   ` Jeremy Fitzhardinge
2011-09-29 17:06     ` David Daney [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=4E84A5A0.5010703@cavium.com \
    --to=david.daney@cavium.com \
    --cc=davem@davemloft.net \
    --cc=ddaney@caviumnetworks.com \
    --cc=jang@linux.vnet.ibm.com \
    --cc=jbaron@redhat.com \
    --cc=jeremy@goop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@ellerman.id.au \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.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.