[PATCH] Don't busy-lock-loop in preemptable spinlocks
Paul Mackerras points out that doing the _raw_spin_trylock each time through the loop will generate tons of unnecessary bus traffic. Instead, after we fail to get the lock we should poll it with simple loads until we see that it is clear and then retry the atomic op. Assuming a reasonable cache design, the loads won't generate any bus traffic until another cpu writes to the cacheline containing the lock. Agreed. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Showing
Please register or sign in to comment