Hi Peter, "Peter Teoh" <htmldeveloper@gmail.com> writes:RELOC_HIDE is a GCC hack. It does basically p+offset. A per-cpu variable is basically an array the size of the number of possible CPUs in the system. get_cpu_var() checks what current CPU we are running on and gets the array-element corresponding to this CPU. So, really oversimplified, get_cpu_var(foo) translates to something like foo[smp_processor_id()]. But per_cpu(), as Jemery said, allows you to retrieve an element from the array that is not meant for your current CPU. So even if you run on CPU1, you might fetch the element that is meant for use on CPU0. But even if you don't access the cpu-local variable from other CPUs, the element might still be a reference to a shared structure that you have to lock properly. Another CPU might have a reference to this same structure as well in its per-cpu variable. Hannes --
| Amit K. Arora | [RFC] Heads up on sys_fallocate() |
| Linus Torvalds | Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series.. |
| Paul Jackson | Re: cpuset-remove-sched-domain-hooks-from-cpusets |
| Greg KH | [GIT PATCH] driver core patches against 2.6.24 |
git: | |
| Linus Torvalds | Re: [GIT]: Networking |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [klibc] [patch] import socket defines |
