This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] improving spinning in adaptive mutexes


On 3/1/2013 9:57 AM, Torvald Riegel wrote:
> Do you have any suggestions for what would be appropriate back-off on Tilera archs, and why? I don't have access to the hardware, so I couldn't make a guess based on experiments. 

Our code typically uses a pattern of starting with ~20 cycles backoff, then does bounded exponential backoff up to about ~2000 cycles.  The high backoff is helpful on a 64+ core chip when all the cores end up trying to acquire a lock at once.  If cores are sending too many requests at once, what happens is that (since we have a 2D mesh network for communications) cores nearer to the home cache of the lock end up getting preferentially serviced and the farther away cores can take quite a while to be serviced.

See arch/tile/lib/spinlock_common.h in the Linux sources for some sample code.

-- 
Chris Metcalf, Tilera Corp.
http://www.tilera.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]