On Thursday 05 June 2008 04:18:19 Mike Travis wrote:
Yes. Because the only true per-cpu vars are the static ones, cpu_local_inc()
only works on identifiers, not arbitrary pointers. Once this is fixed, we
should be enhancing the infrastructure to allow that (AFAICT it's not too
hard, but we should add an __percpu marker for sparse).
I think the latter: __get_cpu_ptr() perhaps?
Indeed.
Yes, this should be fixed. I thought i386 had optimized versions pre-merge,
but I was wrong (%gs for per-cpu came later, and noone cleaned up these naive
versions). Did you want me to write them?
I actually think that using local_t == atomic_t is better than
preempt_disable/enable for most archs which can't do atomic deref-and-inc.
You might be right, but note that local_t is 64 bit on 64-bit platforms. And
speculation of possible use cases isn't a good reason to rip out working
infrastructure :)
Cheers,
Rusty.
--