From a1a5f0da11c9cd305f5e62cf45bbae769817a18f Mon Sep 17 00:00:00 2001 From: Darren Hart Date: Mon, 21 Sep 2009 22:30:38 -0700 Subject: [PATCH] --- yaml --- r: 166449 b: refs/heads/master c: 0729e196147692d84d4c099fcff056eba2ed61d8 h: refs/heads/master i: 166447: b12e336a83d58b3520baea49ef9609ce1ef2f2fc v: v3 --- [refs] | 2 +- trunk/kernel/futex.c | 15 +++------------ 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/[refs] b/[refs] index 9622403ff8a1..7bfb67043bed 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: d8d88fbb186fe3ea37b2a58adb32413c98b59656 +refs/heads/master: 0729e196147692d84d4c099fcff056eba2ed61d8 diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c index f92afbe3d3a1..463af2efa512 100644 --- a/trunk/kernel/futex.c +++ b/trunk/kernel/futex.c @@ -1656,17 +1656,8 @@ static int fixup_owner(u32 __user *uaddr, int fshared, struct futex_q *q, static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q, struct hrtimer_sleeper *timeout) { - queue_me(q, hb); - - /* - * There might have been scheduling since the queue_me(), as we - * cannot hold a spinlock across the get_user() in case it - * faults, and we cannot just set TASK_INTERRUPTIBLE state when - * queueing ourselves into the futex hash. This code thus has to - * rely on the futex_wake() code removing us from hash when it - * wakes us up. - */ set_current_state(TASK_INTERRUPTIBLE); + queue_me(q, hb); /* Arm the timer */ if (timeout) { @@ -1676,8 +1667,8 @@ static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q, } /* - * !plist_node_empty() is safe here without any lock. - * q.lock_ptr != 0 is not safe, because of ordering against wakeup. + * If we have been removed from the hash list, then another task + * has tried to wake us, and we can skip the call to schedule(). */ if (likely(!plist_node_empty(&q->list))) { /*