Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 212129
b: refs/heads/master
c: fb62db2
h: refs/heads/master
i:
  212127: 97853a8
v: v3
  • Loading branch information
Randy Dunlap authored and Ingo Molnar committed Oct 14, 2010
1 parent fd125fe commit b6fdbd8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 15e408cd6ccc3f4f453d87ccd5bc7a84d59feb96
refs/heads/master: fb62db2ba943b1683f1d7181bb2988fce4c60870
25 changes: 14 additions & 11 deletions trunk/kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ struct futex_pi_state {

/**
* struct futex_q - The hashed futex queue entry, one per waiting task
* @list: priority-sorted list of tasks waiting on this futex
* @task: the task waiting on the futex
* @lock_ptr: the hash bucket lock
* @key: the key the futex is hashed on
Expand All @@ -104,7 +105,7 @@ struct futex_pi_state {
*
* A futex_q has a woken state, just like tasks have TASK_RUNNING.
* It is considered woken when plist_node_empty(&q->list) || q->lock_ptr == 0.
* The order of wakup is always to make the first condition true, then
* The order of wakeup is always to make the first condition true, then
* the second.
*
* PI futexes are typically woken before they are removed from the hash list via
Expand Down Expand Up @@ -295,7 +296,7 @@ void put_futex_key(int fshared, union futex_key *key)
* Slow path to fixup the fault we just took in the atomic write
* access to @uaddr.
*
* We have no generic implementation of a non destructive write to the
* We have no generic implementation of a non-destructive write to the
* user address. We know that we faulted in the atomic pagefault
* disabled section so we can as well avoid the #PF overhead by
* calling get_user_pages() right away.
Expand Down Expand Up @@ -515,7 +516,7 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb,
*/
pi_state = this->pi_state;
/*
* Userspace might have messed up non PI and PI futexes
* Userspace might have messed up non-PI and PI futexes
*/
if (unlikely(!pi_state))
return -EINVAL;
Expand Down Expand Up @@ -736,8 +737,8 @@ static void wake_futex(struct futex_q *q)

/*
* We set q->lock_ptr = NULL _before_ we wake up the task. If
* a non futex wake up happens on another CPU then the task
* might exit and p would dereference a non existing task
* a non-futex wake up happens on another CPU then the task
* might exit and p would dereference a non-existing task
* struct. Prevent this by holding a reference on p across the
* wake up.
*/
Expand Down Expand Up @@ -1131,11 +1132,13 @@ static int futex_proxy_trylock_atomic(u32 __user *pifutex,

/**
* futex_requeue() - Requeue waiters from uaddr1 to uaddr2
* uaddr1: source futex user address
* uaddr2: target futex user address
* nr_wake: number of waiters to wake (must be 1 for requeue_pi)
* nr_requeue: number of waiters to requeue (0-INT_MAX)
* requeue_pi: if we are attempting to requeue from a non-pi futex to a
* @uaddr1: source futex user address
* @fshared: 0 for a PROCESS_PRIVATE futex, 1 for PROCESS_SHARED
* @uaddr2: target futex user address
* @nr_wake: number of waiters to wake (must be 1 for requeue_pi)
* @nr_requeue: number of waiters to requeue (0-INT_MAX)
* @cmpval: @uaddr1 expected value (or %NULL)
* @requeue_pi: if we are attempting to requeue from a non-pi futex to a
* pi futex (pi to pi requeue is not supported)
*
* Requeue waiters on uaddr1 to uaddr2. In the requeue_pi case, try to acquire
Expand Down Expand Up @@ -2651,7 +2654,7 @@ static int __init futex_init(void)
* of the complex code paths. Also we want to prevent
* registration of robust lists in that case. NULL is
* guaranteed to fault and we get -EFAULT on functional
* implementation, the non functional ones will return
* implementation, the non-functional ones will return
* -ENOSYS.
*/
curval = cmpxchg_futex_value_locked(NULL, 0, 0);
Expand Down

0 comments on commit b6fdbd8

Please sign in to comment.