diff options
author | Pierre Peiffer <pierre.peiffer@bull.net> | 2007-05-09 05:35:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-09 15:30:55 -0400 |
commit | d0aa7a70bf03b9de9e995ab272293be1f7937822 (patch) | |
tree | 194b30b7b8374b946f166996cb99fb95eb3b7819 /include | |
parent | c19384b5b296905d4988c7c684ff540a0f9d65be (diff) |
futex_requeue_pi optimization
This patch provides the futex_requeue_pi functionality, which allows some
threads waiting on a normal futex to be requeued on the wait-queue of a
PI-futex.
This provides an optimization, already used for (normal) futexes, to be used
with the PI-futexes.
This optimization is currently used by the glibc in pthread_broadcast, when
using "normal" mutexes. With futex_requeue_pi, it can be used with
PRIO_INHERIT mutexes too.
Signed-off-by: Pierre Peiffer <pierre.peiffer@bull.net>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Ulrich Drepper <drepper@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/futex.h | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/include/linux/futex.h b/include/linux/futex.h index 34e54f2b8997..1bd8dfcb037b 100644 --- a/include/linux/futex.h +++ b/include/linux/futex.h | |||
@@ -17,6 +17,7 @@ union ktime; | |||
17 | #define FUTEX_LOCK_PI 6 | 17 | #define FUTEX_LOCK_PI 6 |
18 | #define FUTEX_UNLOCK_PI 7 | 18 | #define FUTEX_UNLOCK_PI 7 |
19 | #define FUTEX_TRYLOCK_PI 8 | 19 | #define FUTEX_TRYLOCK_PI 8 |
20 | #define FUTEX_CMP_REQUEUE_PI 9 | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | * Support for robust futexes: the kernel cleans up held futexes at | 23 | * Support for robust futexes: the kernel cleans up held futexes at |
@@ -85,9 +86,14 @@ struct robust_list_head { | |||
85 | #define FUTEX_OWNER_DIED 0x40000000 | 86 | #define FUTEX_OWNER_DIED 0x40000000 |
86 | 87 | ||
87 | /* | 88 | /* |
89 | * Some processes have been requeued on this PI-futex | ||
90 | */ | ||
91 | #define FUTEX_WAITER_REQUEUED 0x20000000 | ||
92 | |||
93 | /* | ||
88 | * The rest of the robust-futex field is for the TID: | 94 | * The rest of the robust-futex field is for the TID: |
89 | */ | 95 | */ |
90 | #define FUTEX_TID_MASK 0x3fffffff | 96 | #define FUTEX_TID_MASK 0x0fffffff |
91 | 97 | ||
92 | /* | 98 | /* |
93 | * This limit protects against a deliberately circular list. | 99 | * This limit protects against a deliberately circular list. |
@@ -111,6 +117,7 @@ handle_futex_death(u32 __user *uaddr, struct task_struct *curr, int pi); | |||
111 | * We set bit 0 to indicate if it's an inode-based key. | 117 | * We set bit 0 to indicate if it's an inode-based key. |
112 | */ | 118 | */ |
113 | union futex_key { | 119 | union futex_key { |
120 | u32 __user *uaddr; | ||
114 | struct { | 121 | struct { |
115 | unsigned long pgoff; | 122 | unsigned long pgoff; |
116 | struct inode *inode; | 123 | struct inode *inode; |