Re: Faster getcpu() and sched_getcpu()

From: dean gaudet
Date: Mon Sep 29 2008 - 03:27:42 EST


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.

-dean

--
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/