Re: [RFC Patch]Use ar.kr2 for smp_processor_id

From: Keith Owens <kaos_at_sgi.com>
Date: 2007-02-09 10:59:00
Zou Nan hai (on 08 Feb 2007 15:14:54 +0800) wrote:
>  I think using a static value to cache getcpu will heavily bounced on
>that cache line contain the static value if multi cpus calls getcpu very
>frequently. 

AFAICT, Tony's suggestion[*] is all in user space, e.g. glibc.  Each
application will get its own thread local copy of the static variable,
there is no globally shared static value so no cache line bouncing.

>  then implement current_thread_info()->cpu in fsys call should be
>better?

Maybe.  Implement it, time it and see which is faster.

[*] http://marc.theaimsgroup.com/?l=linux-ia64&m=117087180232044&w=2

BTW Tony, in that code there is no need to initialise cpu to ~0 nor to
test for that value.  On the first call it is guaranteed that ar.k3 !=
save_ar_k3.

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Fri Feb 09 11:48:18 2007

This archive was generated by hypermail 2.1.8 : 2007-02-09 11:48:35 EST