Re: Faster getcpu() and sched_getcpu()

From: Andi Kleen
Date: Mon Sep 29 2008 - 10:48:52 EST


On Mon, Sep 29, 2008 at 12:27:09AM -0700, dean gaudet wrote:
> Andi Kleen wrote:
> > I'm still not sure why you say no redzone is that expensive? Do you
> > have numbers? I know it's a few instructions, but it shouldn't
> > be that expensive.
> >
> >
>
> it depends on the processor involved and the kernel config options --
> i.e. if frame pointers are enabled then the stack frame guarantees a
> store operation (push rbp) and on processors which do memops in-order
> this delays the other memops in the vsyscall (i.e. testing the cache or
> executing SIDT). it was 2 or 3 cycles difference in most cases iirc.

Ok frame pointers are always a performance disasters on some CPUs.
Perhaps they should be just unconditionally disabled for vsyscall.c
and the vdso

-Andi
--
ak@xxxxxxxxxxxxxxx
--
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/