[PATCH] Use C11-like atomics instead of plain memory accesses in x86 lock elision.

Torvald Riegel triegel@redhat.com
Fri Dec 2 09:56:00 GMT 2016


This uses atomic operations to access lock elision metadata that is
accessed concurrently (ie, adapt_count fields).  The size of the data is
less than a word but accessed only with atomic loads and stores;
therefore, we add support for shorter-size atomic load and stores too.

Once committed, I will add a note to the Concurrency page on the wiki.
The reason for just enabling shorter-size atomic loads and stores is
that so far, we have no need for shorter-size atomic read-modify-write
operations, and it would be harder to enable these on certain archs than
just loads and stores.

Other architectures that use lock elision should apply similar changes.

Tested on x86_64-linux.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: atomics-lock-elision.patch
Type: text/x-patch
Size: 9996 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20161202/b676ab63/attachment.bin>


More information about the Libc-alpha mailing list