diff options
| -rw-r--r-- | kernel/futex.c | 23 | 
1 files changed, 10 insertions, 13 deletions
| diff --git a/kernel/futex.c b/kernel/futex.c index 0672ff88f159..d077201b393d 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
| @@ -2102,11 +2102,11 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb, | |||
| 2102 | * We call schedule in futex_wait_queue_me() when we enqueue and return there | 2102 | * We call schedule in futex_wait_queue_me() when we enqueue and return there | 
| 2103 | * via the following: | 2103 | * via the following: | 
| 2104 | * 1) wakeup on uaddr2 after an atomic lock acquisition by futex_requeue() | 2104 | * 1) wakeup on uaddr2 after an atomic lock acquisition by futex_requeue() | 
| 2105 | * 2) wakeup on uaddr2 after a requeue and subsequent unlock | 2105 | * 2) wakeup on uaddr2 after a requeue | 
| 2106 | * 3) signal (before or after requeue) | 2106 | * 3) signal | 
| 2107 | * 4) timeout (before or after requeue) | 2107 | * 4) timeout | 
| 2108 | * | 2108 | * | 
| 2109 | * If 3, we setup a restart_block with futex_wait_requeue_pi() as the function. | 2109 | * If 3, cleanup and return -ERESTARTNOINTR. | 
| 2110 | * | 2110 | * | 
| 2111 | * If 2, we may then block on trying to take the rt_mutex and return via: | 2111 | * If 2, we may then block on trying to take the rt_mutex and return via: | 
| 2112 | * 5) successful lock | 2112 | * 5) successful lock | 
| @@ -2114,7 +2114,7 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb, | |||
| 2114 | * 7) timeout | 2114 | * 7) timeout | 
| 2115 | * 8) other lock acquisition failure | 2115 | * 8) other lock acquisition failure | 
| 2116 | * | 2116 | * | 
| 2117 | * If 6, we setup a restart_block with futex_lock_pi() as the function. | 2117 | * If 6, return -EWOULDBLOCK (restarting the syscall would do the same). | 
| 2118 | * | 2118 | * | 
| 2119 | * If 4 or 7, we cleanup and return with -ETIMEDOUT. | 2119 | * If 4 or 7, we cleanup and return with -ETIMEDOUT. | 
| 2120 | * | 2120 | * | 
| @@ -2232,14 +2232,11 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared, | |||
| 2232 | rt_mutex_unlock(pi_mutex); | 2232 | rt_mutex_unlock(pi_mutex); | 
| 2233 | } else if (ret == -EINTR) { | 2233 | } else if (ret == -EINTR) { | 
| 2234 | /* | 2234 | /* | 
| 2235 | * We've already been requeued, but we have no way to | 2235 | * We've already been requeued, but cannot restart by calling | 
| 2236 | * restart by calling futex_lock_pi() directly. We | 2236 | * futex_lock_pi() directly. We could restart this syscall, but | 
| 2237 | * could restart the syscall, but that will look at | 2237 | * it would detect that the user space "val" changed and return | 
| 2238 | * the user space value and return right away. So we | 2238 | * -EWOULDBLOCK. Save the overhead of the restart and return | 
| 2239 | * drop back with EWOULDBLOCK to tell user space that | 2239 | * -EWOULDBLOCK directly. | 
| 2240 | * "val" has been changed. That's the same what the | ||
| 2241 | * restart of the syscall would do in | ||
| 2242 | * futex_wait_setup(). | ||
| 2243 | */ | 2240 | */ | 
| 2244 | ret = -EWOULDBLOCK; | 2241 | ret = -EWOULDBLOCK; | 
| 2245 | } | 2242 | } | 
