Re: [PATCH] futex: cmpxchg_futex_value_locked API change

From: Michal Simek
Date: Wed Mar 09 2011 - 06:08:37 EST


Michel Lespinasse wrote:
Aplogies for the long CC list - as this proposal involves asm changes
in many architectures, and I have only been able to test on x86,
I have tried to include one maintainer from every arch so they can
hopefully double check me. I do think I got all architectures right,
but you can never be 100% sure...

------------------------------------8<---------------------------------

The cmpxchg_futex_value_locked API was funny in that it returned either
the original, user-exposed futex value OR an error code such as -EFAULT.
This was confusing at best, and could be a source of livelocks in places
that retry the cmpxchg_futex_value_locked after trying to fix the issue
by running fault_in_user_writeable().

This change makes the cmpxchg_futex_value_locked API more similar to the
get_futex_value_locked one, returning an error code and updating the
original value through a reference argument.

Signed-off-by: Michel Lespinasse <walken@xxxxxxxxxx>
---
arch/alpha/include/asm/futex.h | 22 +++++++++-------
arch/arm/include/asm/futex.h | 23 +++++++++--------
arch/frv/include/asm/futex.h | 3 +-
arch/ia64/include/asm/futex.h | 9 ++++--
arch/microblaze/include/asm/futex.h | 24 ++++++++++--------

For microblaze:
Tested-by: Michal Simek <monstr@xxxxxxxxx>

M

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/