From: Andi Kleen <ak@muc.de>
To: Andi Kleen <ak@muc.de>
Cc: Jamie Lokier <jamie@shareable.org>,
Linus Torvalds <torvalds@transmeta.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Runtime memory barrier patching II
Date: Tue, 22 Apr 2003 01:56:54 +0200 [thread overview]
Message-ID: <20030421235654.GA15229@averell> (raw)
In-Reply-To: <20030421234611.GA15191@averell>
On Tue, Apr 22, 2003 at 01:46:11AM +0200, Andi Kleen wrote:
> On Tue, Apr 22, 2003 at 01:35:57AM +0200, Jamie Lokier wrote:
> > Andi Kleen wrote:
> > > The patching code is quite generic and could be used to patch other
> > > instructions
> >
> > Such as removing the lock prefix when running non-SMP?
>
> Yes, could work. But you need a new variant of alternative()
Thinking about it will need more work, making it much harder:
- you need to move it after the CPU detection because before
you don't know how many CPUs are there or not.
- you need to define a new pseudo X86 feature bit for SMP active
- you can't easily put an assembly "i" argument into the LOCK_PREFIX
macro, so you have to hardcode the feature bit in there
(not difficult, but ugly)
First part is somewhat nasty which makes it look not too attractive.
Before doing the necessary changes for that someone (= not me)
should probably do some benchmarks first to see if it's worth it
at all. I suspect it is on the P4.
But: all the distributions I'm aware of install separate SMP
and UP kernels. So it wouldn't be a big improvement for them.
And the other users likely compile a custom kernel anyways.
> or eat worse code. The current alternative() can only handle
> constant sized original instructions, which requires that you
> use a constant sized constraint (e.g. (%0) ... "r" (ptr)) etc.)
> "m" is unfortunately variable size.
Actually that was a bit too strict. It can deal with longer
code (the patch code will transparently nop that), just not with shorter
paths.
-Andi
next prev parent reply other threads:[~2003-04-21 23:44 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-21 19:27 [PATCH] Runtime memory barrier patching Andi Kleen
2003-04-21 19:59 ` Linus Torvalds
2003-04-21 20:53 ` Andi Kleen
2003-04-21 21:04 ` Linus Torvalds
2003-04-21 21:43 ` Ulrich Drepper
2003-04-21 22:05 ` Linus Torvalds
2003-04-21 22:45 ` Andi Kleen
2003-04-21 22:11 ` Andi Kleen
2003-04-21 22:23 ` Linus Torvalds
2003-04-21 22:59 ` Andi Kleen
2003-04-21 23:35 ` Jamie Lokier
2003-04-21 23:46 ` Andi Kleen
2003-04-21 23:56 ` Andi Kleen [this message]
2003-04-21 23:57 ` Jamie Lokier
2003-04-22 0:06 ` Linus Torvalds
2003-04-22 0:13 ` Jamie Lokier
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=20030421235654.GA15229@averell \
--to=ak@muc.de \
--cc=jamie@shareable.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.com \
/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