Commit d8d88fbb186fe3ea37b2a58adb32413c98b59656

Authored by Darren Hart
Committed by Ingo Molnar
1 parent d96ee56ce0

futex: Correct futex_q woken state commentary

Use kernel-doc format to describe struct futex_q.

Correct the wakeup definition to eliminate the statement about
waking the waiter between the plist_del() and the q->lock_ptr = 0.

Note in the comment that PI futexes have a different definition of
the woken state.

Signed-off-by: Darren Hart <dvhltc@us.ibm.com>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Dinakar Guniguntala <dino@in.ibm.com>
Cc: John Stultz <johnstul@us.ibm.com>
LKML-Reference: <20090922053029.8717.62798.stgit@Aeon>
Signed-off-by: Ingo Molnar <mingo@elte.hu>

Showing 1 changed file with 16 additions and 16 deletions Side-by-side Diff

... ... @@ -89,36 +89,36 @@
89 89 union futex_key key;
90 90 };
91 91  
92   -/*
93   - * We use this hashed waitqueue instead of a normal wait_queue_t, so
  92 +/**
  93 + * struct futex_q - The hashed futex queue entry, one per waiting task
  94 + * @task: the task waiting on the futex
  95 + * @lock_ptr: the hash bucket lock
  96 + * @key: the key the futex is hashed on
  97 + * @pi_state: optional priority inheritance state
  98 + * @rt_waiter: rt_waiter storage for use with requeue_pi
  99 + * @requeue_pi_key: the requeue_pi target futex key
  100 + * @bitset: bitset for the optional bitmasked wakeup
  101 + *
  102 + * We use this hashed waitqueue, instead of a normal wait_queue_t, so
94 103 * we can wake only the relevant ones (hashed queues may be shared).
95 104 *
96 105 * A futex_q has a woken state, just like tasks have TASK_RUNNING.
97 106 * It is considered woken when plist_node_empty(&q->list) || q->lock_ptr == 0.
98 107 * The order of wakup is always to make the first condition true, then
99   - * wake up q->waiter, then make the second condition true.
  108 + * the second.
  109 + *
  110 + * PI futexes are typically woken before they are removed from the hash list via
  111 + * the rt_mutex code. See unqueue_me_pi().
100 112 */
101 113 struct futex_q {
102 114 struct plist_node list;
103   - /* Waiter reference */
104   - struct task_struct *task;
105 115  
106   - /* Which hash list lock to use: */
  116 + struct task_struct *task;
107 117 spinlock_t *lock_ptr;
108   -
109   - /* Key which the futex is hashed on: */
110 118 union futex_key key;
111   -
112   - /* Optional priority inheritance state: */
113 119 struct futex_pi_state *pi_state;
114   -
115   - /* rt_waiter storage for requeue_pi: */
116 120 struct rt_mutex_waiter *rt_waiter;
117   -
118   - /* The expected requeue pi target futex key: */
119 121 union futex_key *requeue_pi_key;
120   -
121   - /* Bitset for the optional bitmasked wakeup */
122 122 u32 bitset;
123 123 };
124 124