diff options
author | Darren Hart <dvhltc@us.ibm.com> | 2009-04-02 17:19:38 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-02 17:39:53 -0400 |
commit | cd84a42f315e50edd454c27a3da3951ccd3d735a (patch) | |
tree | fa13b2faa6c2f73255f52a65cd4f572d9bd95e1a /kernel/futex.c | |
parent | 833bb3046b6cb320e775ea2160ddca87d53260d5 (diff) |
futex: comment requeue key reference semantics
We've tripped over the futex_requeue drop_count refering to key2
instead of key1. The code is actually correct, but is non-intuitive.
This patch adds an explicit comment explaining the requeue.
Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index 6b50a024bca2..eef8cd26b5e5 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -883,7 +883,12 @@ retry_private: | |||
883 | out_unlock: | 883 | out_unlock: |
884 | double_unlock_hb(hb1, hb2); | 884 | double_unlock_hb(hb1, hb2); |
885 | 885 | ||
886 | /* drop_futex_key_refs() must be called outside the spinlocks. */ | 886 | /* |
887 | * drop_futex_key_refs() must be called outside the spinlocks. During | ||
888 | * the requeue we moved futex_q's from the hash bucket at key1 to the | ||
889 | * one at key2 and updated their key pointer. We no longer need to | ||
890 | * hold the references to key1. | ||
891 | */ | ||
887 | while (--drop_count >= 0) | 892 | while (--drop_count >= 0) |
888 | drop_futex_key_refs(&key1); | 893 | drop_futex_key_refs(&key1); |
889 | 894 | ||