aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/futex.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index f92afbe3d3a1..463af2efa512 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1656,17 +1656,8 @@ out:
1656static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q, 1656static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q,
1657 struct hrtimer_sleeper *timeout) 1657 struct hrtimer_sleeper *timeout)
1658{ 1658{
1659 queue_me(q, hb);
1660
1661 /*
1662 * There might have been scheduling since the queue_me(), as we
1663 * cannot hold a spinlock across the get_user() in case it
1664 * faults, and we cannot just set TASK_INTERRUPTIBLE state when
1665 * queueing ourselves into the futex hash. This code thus has to
1666 * rely on the futex_wake() code removing us from hash when it
1667 * wakes us up.
1668 */
1669 set_current_state(TASK_INTERRUPTIBLE); 1659 set_current_state(TASK_INTERRUPTIBLE);
1660 queue_me(q, hb);
1670 1661
1671 /* Arm the timer */ 1662 /* Arm the timer */
1672 if (timeout) { 1663 if (timeout) {
@@ -1676,8 +1667,8 @@ static void futex_wait_queue_me(struct futex_hash_bucket *hb, struct futex_q *q,
1676 } 1667 }
1677 1668
1678 /* 1669 /*
1679 * !plist_node_empty() is safe here without any lock. 1670 * If we have been removed from the hash list, then another task
1680 * q.lock_ptr != 0 is not safe, because of ordering against wakeup. 1671 * has tried to wake us, and we can skip the call to schedule().
1681 */ 1672 */
1682 if (likely(!plist_node_empty(&q->list))) { 1673 if (likely(!plist_node_empty(&q->list))) {
1683 /* 1674 /*