What is the difference between percpu_xxx and this_cpu_xxx?
Hi,
If my understanding was correct, from the kernel source code, it appears that percpu_xxx and this_cpu_xxx have the same semantics and implementation in effect, haven’t them?
If so, why do we need two API for the same thing?
Best Regards,
Huang Ying
Quoted 7 lines · Huang Ying
Hi,
If my understanding was correct, from the kernel source code, it appears that
percpu_xxxandthis_cpu_xxxhave the same semantics and implementation in effect, haven’t them?If so, why do we need two API for the same thing?
History mostly, and transition.
percpu_inc() was an x86 only thing
__get_cpu_var(var)++ -> percpu_inc(var) -> this_cpu_inc(var)
Hi, Eric,
Quoted 7 lines · Eric Dumazet
Quoted 6 lines · Huang Ying
Hi,
If my understanding was correct, from the kernel source code, it appears that
percpu_xxxandthis_cpu_xxxhave the same semantics and implementation in effect, haven’t them?
Quoted 7 lines
Quoted 1 line
If so, why do we need two API for the same thing?
History mostly, and transition.
percpu_inc()was an x86 only thing__get_cpu_var(var)++ ->
percpu_inc(var)->this_cpu_inc(var)
Thanks for clarification. Is there someone working on the transition? Is that possible to translate most percpu_xxx to this_cpu_xxx blindly?
Best Regards,
Huang Ying
Quoted 17 lines · Huang Ying
Hi, Eric,
Quoted 14 lines · Eric Dumazet
Quoted 7 lines · Huang Ying
Hi,
If my understanding was correct, from the kernel source code, it appears that
percpu_xxxandthis_cpu_xxxhave the same semantics and implementation in effect, haven’t them?If so, why do we need two API for the same thing?
History mostly, and transition.
percpu_inc()was an x86 only thing__get_cpu_var(var)++ ->
percpu_inc(var)->this_cpu_inc(var)
Also, we used to need separate accessors for static and dynamic percpu variables, so we have quite a few duplications in the interface.
Quoted 2 lines
Thanks for clarification. Is there someone working on the transition? Is that possible to translate most
percpu_xxxtothis_cpu_xxxblindly?
It's on my todo list but AFAIK nobody is actually working on it yet.
Thanks.
Signature · 1 line
tejun