This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
lll_futex_wake_unlock customized on sparc -- why?
- From: Torvald Riegel <triegel at redhat dot com>
- To: David Miller <davem at davemloft dot net>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Thu, 18 Dec 2014 00:44:59 +0100
- Subject: lll_futex_wake_unlock customized on sparc -- why?
- Authentication-results: sourceware.org; auth=none
Dave, do you know why sparc lowlevellock.h avoids FUTEX_WAKE_OP (see
code snippet below)? The only client of this function seems to be in
nptl/pthread_cond_signal.c, which falls back to normal FUTEX_WAKE due to
this change.
Is this customization essential, or just bit-rot? Except this change,
sparc lowlevellock.h seems to have standard futex operations; it would
be nice if we could use the generic lowlevellock-futex.h on sparc too.
Thanks.
/* Returns non-zero if error happened, zero if success. */
#ifdef __sparc32_atomic_do_lock
/* Avoid FUTEX_WAKE_OP if supporting pre-v9 CPUs. */
# define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) 1
#else
# define lll_futex_wake_unlock(futexp, nr_wake, nr_wake2, futexp2, private) \
({ \
INTERNAL_SYSCALL_DECL (__err); \
long int __ret; \
\
__ret = INTERNAL_SYSCALL (futex, __err, 6, (futexp), \
__lll_private_flag (FUTEX_WAKE_OP, private), \
(nr_wake), (nr_wake2), (futexp2), \
FUTEX_OP_CLEAR_WAKE_IF_GT_ONE); \
INTERNAL_SYSCALL_ERROR_P (__ret, __err); \
})
#endif