Re: [S390] minor fault path optimization.
From: Andi Kleen
Date: Mon Mar 19 2007 - 10:01:10 EST
On Monday 19 March 2007 14:31, Christoph Hellwig wrote:
> On Mon, Mar 19, 2007 at 02:02:06PM +0100, Martin Schwidefsky wrote:
> > From: Martin Schwidefsky <schwidefsky@xxxxxxxxxx>
> >
> > [S390] minor fault path optimization.
> >
> > The minor fault path has grown a lot in terms of cycles. In particular
> > the kprobes hook is very costly. Optimize the path to save a couple of
> > cycles. If kprobes is enabled more than 300 cycles can be avoided if
> > kprobes_running() is false.
>
> Actually there is a lot more fishy here. This code is duplicated over
> every single architecture. It uses a notifier chain that only ever has
> one actual uaesr. It exports interfaces that are potential harmful.
Agreed, it should be fixed generically.
I think the right fix would be to make the notifier call an inline
that checks the call chain in the caller. That would be cheap enough,
except for the cache line that might need to be referenced.
For the cache line the short term fix would be to find some other
global cache line that is referenced in the fault path anyways and put
it on the same (e.g. by just putting the variable next to it or
using a shared structure)
Longer term might be something like Ben LaHaise's patch that can patch
code inline for rarely-read globals.
> Please do the right thing to optimize this instead and rip out the brandead
> notifier chain mechanisms and directly call into the krobes handler if
> kprobes are active,
No, we should keep the debugger hooks here. Otherwise there will be a zillion
external patches patches code in at these places for the various debuggers,
resulting in a merge nightmare for lots of people.
-Andi
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/