[PATCH] Use generic lowlevellock-futex.h in x86_64 lowlevellock.h.

Torvald Riegel triegel@redhat.com
Wed Dec 17 23:16:00 GMT 2014


This patch replaces the custom futex operations for x86_64 with the
generic ones from lowlevellock-futex.h.  It also adds a few
#ifdef __ASSEMBLER__ to the generic Linux one to make this work.

In the long term, we'd want to use the fully generic low-level lock
implementation on x86_64 too, but this would require more code
inspection and/or measurements to assess the impacts on performance of
such a change.
Furthermore, there is still x86_64 assembly code that uses futexes, and
we need some of the futex macros (e.g., SYS_futex) be defined somewhere
for those assembly files.  Thus, it seems easier to remove the
lowlevellock.h ones the other assembly uses of futexes have been
replaced with C code.

OK?

2014-12-17  Torvald Riegel  <triegel@redhat.com>

	* sysdeps/unix/sysv/linux/x86_64/lowlevellock.h: Include
	<lowlevellock-futex.h>.  Remove FUTEX_* constants defined there.
	(__lll_private_flag): Remove.
	(lll_futex_wait): Likewise.
	(lll_futex_timed_wait): Likewise.
	(lll_futex_wake): Likewise.
	(lll_futex_requeue): Likewise.
	(lll_wait_tid): Use lll_futex_wait instead of assembly code.
	(__lll_timedwait_tid): Spell out argument names.
	(lll_timedwait_tid): Add comments and parentheses around macro
	arguments.
	* sysdeps/unix/sysv/linux/lowlevellock-futex.h: Make FUTEX_* constants,
	LLL_SHARED and LLL_PRIVATE usable from assembly code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lll-x86_64.patch
Type: text/x-patch
Size: 7908 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/libc-alpha/attachments/20141217/2fc3eb0b/attachment.bin>


More information about the Libc-alpha mailing list