From: Jarek Poplawski <jarkao2@o2.pl>
To: Nick Piggin <npiggin@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
Helge Hafting <helge.hafting@aitel.hist.no>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andi Kleen <ak@suse.de>
Subject: Re: [rfc][patch 3/3] x86: optimise barriers
Date: Tue, 16 Oct 2007 11:00:05 +0200 [thread overview]
Message-ID: <20071016090005.GC1000@ff.dom.local> (raw)
In-Reply-To: <20071016005033.GB5851@wotan.suse.de>
On Tue, Oct 16, 2007 at 02:50:33AM +0200, Nick Piggin wrote:
> On Mon, Oct 15, 2007 at 11:10:00AM +0200, Jarek Poplawski wrote:
...
> > I'm not performance-words at all, so I can't help you, sorry. But, I
> > understand people who care about this, and think there is a popular
> > conviction barriers and locked instructions are costly, so I'm
> > surprised there is any "problem" now with finding these gains...
>
> It's more expensive than nothing, sure. However in real code, algorithmic
> complexity, cache misses and cacheline bouncing tend to be much bigger
> issues.
>
> I can't think of a place in the kernel where smp_rmb matters _that_ much.
> seqlocks maybe (timers, dcache lookup), vmscan... Obviously removing the
> lfence is not going to hurt. Maybe we even gain 0.01% performance in
> someone's workload.
>
> Also, remember: if loads are already in-order, then lfence is a noop,
> right? (in practice it seems to have to do a _little_ bit of work, but
> it's like a dozen cycles).
You are right: considering current CPUs there could be no performance
problem at all. Removing LOCKs for older ones should probably matter
more, but as a matter of fact, now I wouldn't bet even on this - it
could be mostly noop as well.
> > As a matter of fact it's not natural for me at all. I expected the
> > other direction, and I still doubt programmers' intentions could be
> > "automatically" predicted good enough, so IMHO, it's not for long.
>
> Really? Consider the consequences if, instead of releasing this latest
> document tightening consistency, Intel found that out of order loads
> were worth 5% more performance and implemented them in their next chip.
> The chip could be completely backwards compatible, but all your old code
> would break, because it was broken to begin with (because it was outside
> the spec).
I've different opinion on this: I expect any spec to describe current
implementation. Before issuing new models any changes of
implementation should be made public with proper margin of time. Then
system could be optimally adjusted to a real hardware, instead of
planned only, but possibly never realized (plus doing such not used
things with old means is usually more costly: lock vs. lfence). There
is still problem of specs' completness: there are probably often some
things unspecified which could brake on a new model, so never 100%
guarantee anyway.
> IMO Intel did exactly the right thing from an engineering perspective,
> and so did Linux to always follow the spec.
But, if you follow the spec - you don't follow the spec! Why do you
ignore so much this part of Intel's spec:
"This document contains information which Intel may change at any
time without notice. Do not finalize a design with this information."
Maybe it's a real Intel intention and not for lawyers only? (Btw, it
seems we have an example.)
Regards,
Jarek P.
next prev parent reply other threads:[~2007-10-16 8:57 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
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 [this message]
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=20071016090005.GC1000@ff.dom.local \
--to=jarkao2@o2.pl \
--cc=ak@suse.de \
--cc=helge.hafting@aitel.hist.no \
--cc=linux-kernel@vger.kernel.org \
--cc=npiggin@suse.de \
--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