public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
To: michael@ellerman.id.au
Cc: Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Jason Baron <jbaron@redhat.com>,
	mingo@elte.hu, mathieu.desnoyers@polymtl.ca, hpa@zytor.com,
	tglx@linutronix.de, andi@firstfloor.org, roland@redhat.com,
	rth@redhat.com, masami.hiramatsu.pt@hitachi.com,
	fweisbec@gmail.com, avi@redhat.com, davem@davemloft.net,
	sam@ravnborg.org, ddaney@caviumnetworks.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] jump label: add enabled/disabled state to jump label key entries
Date: Fri, 26 Nov 2010 08:26:05 +1100	[thread overview]
Message-ID: <1290720365.32570.133.camel@pasglop> (raw)
In-Reply-To: <1290692564.689.28.camel@concordia>

On Fri, 2010-11-26 at 00:42 +1100, Michael Ellerman wrote:
> > Ooh, nice, so the CPUs won't get all confused because you change
> code
> > from under their ifetch cache?
> 
> Apparently not, at least according to the architecture.

As long as you are atomically changing one word fully aligned (remember,
no variable length instructions on ppc :-) you are fine. The other CPU
will see either the old or the new value, not something in between.

The dcbf/sync/icbi/isync is really only necessary on older processors.
dcbf will broadcast a request to flush that line out of D, sync will
wait for that to complete, icbi will broadcast an invalidate of that
line out of I, sync will wait for that to have gone out and isync will
locally synchronize the pipeline (toss prefetch).

Now, P5 and later have a HW snoop of I/D, so dcbf isn't useful. You need
at least an isync tho to ensure prefetched stuff has been tossed or you
may still execute the "old" instructions for a little while.

On P7 (I'm not sure about 5 and 6 here), additionally, they have sneaky
optimisations in isync (bcs some people abuse it as a read barrier)
using a scoreboard to decide what to do. In essence, that means that
alone, it won't toss prefetch unless scoreboarded to do so by a previous
icbi. So one icbi (regardless of how much you want to invalidate and
with any address) followed by isync will do.

An interrupt will do too tho :-)

Cheers,
Ben.


  reply	other threads:[~2010-11-25 21:27 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-23 21:27 [PATCH 0/3] jump label: updates for 2.6.37 Jason Baron
2010-11-23 21:27 ` [PATCH 1/3] jump label: add enabled/disabled state to jump label key entries Jason Baron
2010-11-23 23:43   ` Mathieu Desnoyers
2010-11-24  0:00     ` Steven Rostedt
2010-11-24  0:24       ` Mathieu Desnoyers
2010-11-24 18:24         ` Jason Baron
2010-11-24 18:39           ` Peter Zijlstra
2010-11-24 19:07             ` Jason Baron
2010-11-24  8:20   ` Peter Zijlstra
2010-11-24 14:54     ` Jason Baron
2010-11-24 15:11       ` Peter Zijlstra
2010-11-24 15:19         ` Jason Baron
2010-11-24 15:24           ` Peter Zijlstra
2010-11-24 15:42             ` Jason Baron
2010-11-24 15:53               ` Steven Rostedt
2010-11-25  2:39                 ` Michael Ellerman
2010-11-25  6:52                   ` Peter Zijlstra
2010-11-25 13:14                     ` Mathieu Desnoyers
2010-11-25 13:42                     ` Michael Ellerman
2010-11-25 21:26                       ` Benjamin Herrenschmidt [this message]
2010-11-24 16:56               ` David Daney
2010-11-24 15:15       ` Steven Rostedt
2010-11-24 15:21         ` Jason Baron
2010-11-24 15:25           ` Peter Zijlstra
2010-11-24 15:57           ` Steven Rostedt
2010-11-24 19:18             ` Jason Baron
2010-11-24 15:21         ` Peter Zijlstra
2010-11-23 21:27 ` [PATCH 2/3] jump label: move jump table to r/w section Jason Baron
2010-11-23 23:55   ` Mathieu Desnoyers
2010-11-24  0:04     ` Steven Rostedt
2010-11-24  0:27       ` Mathieu Desnoyers
2010-11-24  0:35         ` Steven Rostedt
2010-11-24  2:18     ` Steven Rostedt
2010-11-24  2:59       ` Steven Rostedt
2010-11-23 21:27 ` [PATCH 3/3] jump label: add docs Jason Baron
2010-11-23 21:36 ` [PATCH 0/3] jump label: updates for 2.6.37 H. Peter Anvin
2010-11-23 23:11   ` Steven Rostedt
2010-11-23 23:32     ` H. Peter Anvin
2010-11-24  0:10       ` Steven Rostedt
2010-11-24  0:36         ` Steven Rostedt
2010-11-24  0:37           ` H. Peter Anvin
2010-11-23 21:42 ` Steven Rostedt
2010-11-23 21:56   ` Jason Baron
2010-11-23 23:10     ` Steven Rostedt
2010-11-24  8:29       ` Peter Zijlstra
2010-11-24  9:21         ` Andi Kleen
2010-11-24 12:47         ` Steven Rostedt
2010-11-24 13:49           ` Steven Rostedt

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=1290720365.32570.133.camel@pasglop \
    --to=benh@kernel.crashing.org \
    --cc=andi@firstfloor.org \
    --cc=avi@redhat.com \
    --cc=davem@davemloft.net \
    --cc=ddaney@caviumnetworks.com \
    --cc=fweisbec@gmail.com \
    --cc=hpa@zytor.com \
    --cc=jbaron@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mathieu.desnoyers@polymtl.ca \
    --cc=michael@ellerman.id.au \
    --cc=mingo@elte.hu \
    --cc=peterz@infradead.org \
    --cc=roland@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=rth@redhat.com \
    --cc=sam@ravnborg.org \
    --cc=tglx@linutronix.de \
    /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