[PATCH][RFC] unlikely spinlocks

Paul Mackerras paulus at samba.org
Mon Mar 14 20:47:10 EST 2005


Jake Moilanen writes:

> On our raw spinlocks, we currently have an attempt at the lock, and if
> we do not get it we enter a spin loop.  This spinloop will likely
> continue for awhile, and we pridict likely.  
> 
> Shouldn't we predict that we will get out of the loop so our next
> instructions are already prefetched.  Even when we miss because the lock
> is still held, it won't matter since we are waiting anyways.

Possibly the best thing is not to put a static prediction on it at
all, and let the machine's dynamic branch prediction decide which path
to predict?

Paul.



More information about the Linuxppc64-dev mailing list