diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-03-27 04:16:27 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-27 11:44:49 -0500 |
commit | 8f17d3a5049d32392b79925c73a0cf99ce6d5af0 (patch) | |
tree | 3c2aa0cbe337684d353dd2cfb0c177b4ae15217c /kernel/futex.c | |
parent | 8fdd6c6df7889dc89df3d9fe0f5bbe6733e39f48 (diff) |
[PATCH] lightweight robust futexes updates
- fix: initialize the robust list(s) to NULL in copy_process.
- doc update
- cleanup: rename _inuser to _inatomic
- __user cleanups and other small cleanups
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: Ulrich Drepper <drepper@redhat.com>
Cc: Andi Kleen <ak@muc.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index feb724b2554e..9c9b2b6b22dd 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -913,15 +913,15 @@ err_unlock: | |||
913 | * Process a futex-list entry, check whether it's owned by the | 913 | * Process a futex-list entry, check whether it's owned by the |
914 | * dying task, and do notification if so: | 914 | * dying task, and do notification if so: |
915 | */ | 915 | */ |
916 | int handle_futex_death(unsigned int *uaddr, struct task_struct *curr) | 916 | int handle_futex_death(u32 __user *uaddr, struct task_struct *curr) |
917 | { | 917 | { |
918 | unsigned int futex_val; | 918 | u32 uval; |
919 | 919 | ||
920 | repeat: | 920 | retry: |
921 | if (get_user(futex_val, uaddr)) | 921 | if (get_user(uval, uaddr)) |
922 | return -1; | 922 | return -1; |
923 | 923 | ||
924 | if ((futex_val & FUTEX_TID_MASK) == curr->pid) { | 924 | if ((uval & FUTEX_TID_MASK) == curr->pid) { |
925 | /* | 925 | /* |
926 | * Ok, this dying thread is truly holding a futex | 926 | * Ok, this dying thread is truly holding a futex |
927 | * of interest. Set the OWNER_DIED bit atomically | 927 | * of interest. Set the OWNER_DIED bit atomically |
@@ -932,12 +932,11 @@ repeat: | |||
932 | * thread-death.) The rest of the cleanup is done in | 932 | * thread-death.) The rest of the cleanup is done in |
933 | * userspace. | 933 | * userspace. |
934 | */ | 934 | */ |
935 | if (futex_atomic_cmpxchg_inuser(uaddr, futex_val, | 935 | if (futex_atomic_cmpxchg_inatomic(uaddr, uval, |
936 | futex_val | FUTEX_OWNER_DIED) != | 936 | uval | FUTEX_OWNER_DIED) != uval) |
937 | futex_val) | 937 | goto retry; |
938 | goto repeat; | ||
939 | 938 | ||
940 | if (futex_val & FUTEX_WAITERS) | 939 | if (uval & FUTEX_WAITERS) |
941 | futex_wake((unsigned long)uaddr, 1); | 940 | futex_wake((unsigned long)uaddr, 1); |
942 | } | 941 | } |
943 | return 0; | 942 | return 0; |
@@ -985,7 +984,6 @@ void exit_robust_list(struct task_struct *curr) | |||
985 | if (handle_futex_death((void *)entry + futex_offset, | 984 | if (handle_futex_death((void *)entry + futex_offset, |
986 | curr)) | 985 | curr)) |
987 | return; | 986 | return; |
988 | |||
989 | /* | 987 | /* |
990 | * Fetch the next entry in the list: | 988 | * Fetch the next entry in the list: |
991 | */ | 989 | */ |