[parisc-linux] [PATCH] Remove spinlock_t from cpu_data (and thus from processor.h)
Matthew Wilcox
matthew at wil.cx
Sun Nov 26 11:38:32 MST 2006
On Sat, Nov 25, 2006 at 11:53:44AM -0500, Kyle McMartin wrote:
> This should enable us to clean up our header files nicely.
Thanks for looking at this.
My first thought was "Surely there's a better way to do this, maybe
DEFINE_PER_CPU".
Then I looked at what you'd had to touch. Essentially, we're
multiplexing 6 different ops onto one interrupt. This would make sense
if we were short of interrupts, but on the vast majority of systems, we
aren't.
We define NOP, RESCHEDULE, CALL_FUNC, CPU_START, CPU_STOP and CPU_TEST.
CPU_TEST is never sent, down to 5. CPU_NOP and CPU_RESCHEDULE are the
same other than debug statements, down to 4. So by taking 3 additional
CPU interrupts, we can eliminate the spinlock entirely.
We could do away with RESCHEDULE if we pass a nop function to CALL_FUNC.
I don't know if we would suffer a performance hit from doing that
though.
We could also only enable CPU_STOP if CPU_HOTPLUG was set. And
fold CPU_START/CPU_STOP into the CALL_FUNC bucket. Or deregister
CPU_START after the CPU's come up.
In any case, I think this is a whole lot preferable to the spinlock that
we're currently using. I have some other ideas (like using set_bit()
and xchg() which would take the atomic_hash_spinlock), but I think
redoing our IPI support in the way I've outlined above is cleaner.
More information about the parisc-linux
mailing list