[PATCH] back-off algorithm for spinning

Attilio Rao attilio at freebsd.org
Mon Jun 2 13:37:31 UTC 2008

The attached patch implements a back-off algorithm for adaptive
spinning in order to reduce cache traffics in big SMP environments.
I really need to tune values (CAP and SHIFT) on a big SMP machine
(16/32 ways possibily) and currently I have no-one available.

Some tips:
- uint32_t has been choosen for the back-off counters as we want a
fixed size because we want to have a deterministic size for words
- Possibily, in the spinlock case, the loop for the first number of
loop counting can be reduced now, but we still need to maintain the
same difference between this and the later value for determining
"spinlock held too long".

Revisions are appreciated.


Peace can only be achieved by understanding - A. Einstein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lock_backoff.diff
Type: application/octet-stream
Size: 6232 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-smp/attachments/20080602/4007731b/lock_backoff.obj

More information about the freebsd-smp mailing list