[PATCH] Fix __lll_timedlock_wait busy-wait issue
Torvald Riegel
triegel@redhat.com
Fri Mar 28 18:25:00 GMT 2014
On Thu, 2014-03-27 at 22:01 +0000, Joseph S. Myers wrote:
> I don't know how this might relate to
> <https://sourceware.org/bugzilla/show_bug.cgi?id=15119> (see
> <https://sourceware.org/ml/libc-ports/2013-01/msg00084.html> and
> <https://sourceware.org/ml/libc-ports/2013-02/msg00021.html> and the rest
> of that thread). But my preference for how to address this is definitely
> to move to unifying lowlevellock.[ch] files across as many architectures
> as possible - which requires someone to understand the differences and
> produce a careful analysis that shows what the best form for generic files
> is and what cases actually require architecture-specific files to override
> those generic files (preferably overriding only the bits that need
> overriding).
>
I agree. My gut feeling is that the locks should eventually become
unified C code, using atomics to do the synchronization;
architecture-specific code should be either in the atomics or in more
generally useful spin-waiting code (which could be used by other sync
constructs as well). The futex syscall is really on the slowpath; if
you hit it, you will have had at least a cache miss on the futex var,
and doing the syscall will likely give you more cache misses.
Therefore, I don't see a reason why the futex syscall needs to have
custom asm implementations such as on x86 currently.
More information about the Libc-ports
mailing list