summaryrefslogtreecommitdiffstats
path: root/kernel/futex.c
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2006-01-03 16:59:55 +0100
committerJeff Garzik <jgarzik@pobox.com>2006-01-03 16:59:55 +0100
commit02f693c7118f6be9e677070eb630c1f3a654cdd3 (patch)
treeb5493c816a1f76a01319a84955c5ba07d47517c3 /kernel/futex.c
parentMerge branch 'upstream' (diff)
parentMerge branch 'master' (diff)
downloadlinux-02f693c7118f6be9e677070eb630c1f3a654cdd3.tar.xz
linux-02f693c7118f6be9e677070eb630c1f3a654cdd3.zip
Merge branch 'upstream'
Diffstat (limited to 'kernel/futex.c')
-rw-r--r--kernel/futex.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/futex.c b/kernel/futex.c
index 5872e3507f35..5e71a6bf6f6b 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -270,7 +270,13 @@ static void wake_futex(struct futex_q *q)
/*
* The waiting task can free the futex_q as soon as this is written,
* without taking any locks. This must come last.
+ *
+ * A memory barrier is required here to prevent the following store
+ * to lock_ptr from getting ahead of the wakeup. Clearing the lock
+ * at the end of wake_up_all() does not prevent this store from
+ * moving.
*/
+ wmb();
q->lock_ptr = NULL;
}