From b52b945200dc52e063ed38d144197d5d0dd952ad Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Fri, 23 Dec 2005 19:54:46 -0800 Subject: [PATCH] --- yaml --- r: 15321 b: refs/heads/master c: 8e31108b9f41069d55cb9b019ac8262c55fd2616 h: refs/heads/master i: 15319: 79a471b5a4a3107364407b2f1f78f8376f2abe34 v: v3 --- [refs] | 2 +- trunk/kernel/futex.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index ddeb1a0be42a..536e339da863 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 6003a93e7bf6c02f33c02976ff364785d4273295 +refs/heads/master: 8e31108b9f41069d55cb9b019ac8262c55fd2616 diff --git a/trunk/kernel/futex.c b/trunk/kernel/futex.c index 5872e3507f35..5e71a6bf6f6b 100644 --- a/trunk/kernel/futex.c +++ b/trunk/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; }