public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nick Piggin <npiggin@suse.de>
To: Jarek Poplawski <jarkao2@o2.pl>
Cc: Helge Hafting <helge.hafting@aitel.hist.no>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Andi Kleen <ak@suse.de>
Subject: Re: [rfc][patch 3/3] x86: optimise barriers
Date: Fri, 12 Oct 2007 11:44:27 +0200	[thread overview]
Message-ID: <20071012094427.GC19237@wotan.suse.de> (raw)
In-Reply-To: <20071012091213.GC1962@ff.dom.local>

On Fri, Oct 12, 2007 at 11:12:13AM +0200, Jarek Poplawski wrote:
> On Fri, Oct 12, 2007 at 10:42:34AM +0200, Helge Hafting wrote:
> > Jarek Poplawski wrote:
> > >On 04-10-2007 07:23, Nick Piggin wrote:
> > >  
> > >>According to latest memory ordering specification documents from Intel and
> > >>AMD, both manufacturers are committed to in-order loads from cacheable 
> > >>memory
> > >>for the x86 architecture. Hence, smp_rmb() may be a simple barrier.
> > >>    
> > >...
> > >
> > >Great news!
> > >
> > >First it looks like a really great thing that it's revealed at last.
> > >But then... there is probably some confusion: did we have to use
> > >ineffective code for so long?
> > >  
> > You could have tried the optimization before, and
> > gotten better performance. But if without solid knowledge that
> > the optimization is _valid_, you risk having a kernel
> > that performs great but suffer the occational glitch and
> > therefore is unstable and crash the machine "now and then".
> > This sort of thing can't really be figured out by experimentation, because
> > the bad cases might happen only with some processors, some
> > combinations of memory/chipsets, or with some minimum
> > number of processors.  Such problems can be very hard
> > to find, especially considering that other plain bugs also
> > cause crashes.
> > 
> > Therefore, the "ineffective code" was used because it was
> > the only safe alternative. Now we know, so now we may optimize.
> 
> Sorry, I don't understand this logic at all. Since bad cases
> happen independently from any specifications and Intel doesn't
> take any legal responsibility for such information, it seems we
> should better still not optimize?

We already do in probably more critical and lible to be problematic
cases (notably, spin_unlock).

So unless there is reasonable information for us to believe this
will be a problem, IMO the best thing to do is stick with the
specs. Intel is pretty reasonable with documenting errata I think.

With memory barriers specifically, I'm sure we have many more bugs
in the kernel than AMD or Intel have in their chips ;)


  reply	other threads:[~2007-10-12  9:44 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-04  5:21 [rfc][patch 1/3] x86_64: fence nontemproal stores Nick Piggin
2007-10-04  5:22 ` [rfc][patch 2/3] x86: fix IO write barriers Nick Piggin
2007-10-04 17:32   ` Dave Jones
2007-10-04 17:53     ` Andi Kleen
2007-10-04 18:10       ` Dave Jones
2007-10-04 18:21         ` Andi Kleen
2007-10-04 18:41           ` Dave Jones
2007-10-04 18:58             ` Andi Kleen
2007-10-04 19:08               ` Dave Jones
2007-10-04 20:52                 ` Alan Cox
2007-10-04  5:23 ` [rfc][patch 3/3] x86: optimise barriers Nick Piggin
2007-10-12  8:25   ` Jarek Poplawski
2007-10-12  8:42     ` Helge Hafting
2007-10-12  9:12       ` Jarek Poplawski
2007-10-12  9:44         ` Nick Piggin [this message]
2007-10-12 10:04           ` Jarek Poplawski
2007-10-12 12:44         ` Helge Hafting
2007-10-12 13:29           ` Jarek Poplawski
2007-10-15 10:17             ` Helge Hafting
2007-10-15 11:53               ` Jarek Poplawski
2007-10-12  8:57     ` Nick Piggin
2007-10-12  9:55       ` Jarek Poplawski
2007-10-12 10:42         ` Nick Piggin
2007-10-12 11:55           ` Jarek Poplawski
2007-10-12 12:10             ` Jarek Poplawski
2007-10-12 15:13     ` Linus Torvalds
2007-10-15  7:44       ` Jarek Poplawski
2007-10-15  8:09         ` Nick Piggin
2007-10-15  9:10           ` Jarek Poplawski
2007-10-15  9:24             ` Jarek Poplawski
2007-10-16  0:50             ` Nick Piggin
2007-10-16  9:00               ` Jarek Poplawski
2007-10-16  9:14                 ` david
2007-10-16 12:49                   ` Jarek Poplawski
2007-10-15 14:38         ` David Schwartz

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=20071012094427.GC19237@wotan.suse.de \
    --to=npiggin@suse.de \
    --cc=ak@suse.de \
    --cc=helge.hafting@aitel.hist.no \
    --cc=jarkao2@o2.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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