diff options
Diffstat (limited to 'kernel/futex.c')
-rw-r--r-- | kernel/futex.c | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/kernel/futex.c b/kernel/futex.c index d73ef1f3e55d..8e3c3ffe1b9a 100644 --- a/kernel/futex.c +++ b/kernel/futex.c | |||
@@ -403,9 +403,9 @@ static void free_pi_state(struct futex_pi_state *pi_state) | |||
403 | * and has cleaned up the pi_state already | 403 | * and has cleaned up the pi_state already |
404 | */ | 404 | */ |
405 | if (pi_state->owner) { | 405 | if (pi_state->owner) { |
406 | spin_lock_irq(&pi_state->owner->pi_lock); | 406 | raw_spin_lock_irq(&pi_state->owner->pi_lock); |
407 | list_del_init(&pi_state->list); | 407 | list_del_init(&pi_state->list); |
408 | spin_unlock_irq(&pi_state->owner->pi_lock); | 408 | raw_spin_unlock_irq(&pi_state->owner->pi_lock); |
409 | 409 | ||
410 | rt_mutex_proxy_unlock(&pi_state->pi_mutex, pi_state->owner); | 410 | rt_mutex_proxy_unlock(&pi_state->pi_mutex, pi_state->owner); |
411 | } | 411 | } |
@@ -470,18 +470,18 @@ void exit_pi_state_list(struct task_struct *curr) | |||
470 | * pi_state_list anymore, but we have to be careful | 470 | * pi_state_list anymore, but we have to be careful |
471 | * versus waiters unqueueing themselves: | 471 | * versus waiters unqueueing themselves: |
472 | */ | 472 | */ |
473 | spin_lock_irq(&curr->pi_lock); | 473 | raw_spin_lock_irq(&curr->pi_lock); |
474 | while (!list_empty(head)) { | 474 | while (!list_empty(head)) { |
475 | 475 | ||
476 | next = head->next; | 476 | next = head->next; |
477 | pi_state = list_entry(next, struct futex_pi_state, list); | 477 | pi_state = list_entry(next, struct futex_pi_state, list); |
478 | key = pi_state->key; | 478 | key = pi_state->key; |
479 | hb = hash_futex(&key); | 479 | hb = hash_futex(&key); |
480 | spin_unlock_irq(&curr->pi_lock); | 480 | raw_spin_unlock_irq(&curr->pi_lock); |
481 | 481 | ||
482 | spin_lock(&hb->lock); | 482 | spin_lock(&hb->lock); |
483 | 483 | ||
484 | spin_lock_irq(&curr->pi_lock); | 484 | raw_spin_lock_irq(&curr->pi_lock); |
485 | /* | 485 | /* |
486 | * We dropped the pi-lock, so re-check whether this | 486 | * We dropped the pi-lock, so re-check whether this |
487 | * task still owns the PI-state: | 487 | * task still owns the PI-state: |
@@ -495,15 +495,15 @@ void exit_pi_state_list(struct task_struct *curr) | |||
495 | WARN_ON(list_empty(&pi_state->list)); | 495 | WARN_ON(list_empty(&pi_state->list)); |
496 | list_del_init(&pi_state->list); | 496 | list_del_init(&pi_state->list); |
497 | pi_state->owner = NULL; | 497 | pi_state->owner = NULL; |
498 | spin_unlock_irq(&curr->pi_lock); | 498 | raw_spin_unlock_irq(&curr->pi_lock); |
499 | 499 | ||
500 | rt_mutex_unlock(&pi_state->pi_mutex); | 500 | rt_mutex_unlock(&pi_state->pi_mutex); |
501 | 501 | ||
502 | spin_unlock(&hb->lock); | 502 | spin_unlock(&hb->lock); |
503 | 503 | ||
504 | spin_lock_irq(&curr->pi_lock); | 504 | raw_spin_lock_irq(&curr->pi_lock); |
505 | } | 505 | } |
506 | spin_unlock_irq(&curr->pi_lock); | 506 | raw_spin_unlock_irq(&curr->pi_lock); |
507 | } | 507 | } |
508 | 508 | ||
509 | static int | 509 | static int |
@@ -558,7 +558,7 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, | |||
558 | * change of the task flags, we do this protected by | 558 | * change of the task flags, we do this protected by |
559 | * p->pi_lock: | 559 | * p->pi_lock: |
560 | */ | 560 | */ |
561 | spin_lock_irq(&p->pi_lock); | 561 | raw_spin_lock_irq(&p->pi_lock); |
562 | if (unlikely(p->flags & PF_EXITING)) { | 562 | if (unlikely(p->flags & PF_EXITING)) { |
563 | /* | 563 | /* |
564 | * The task is on the way out. When PF_EXITPIDONE is | 564 | * The task is on the way out. When PF_EXITPIDONE is |
@@ -567,7 +567,7 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, | |||
567 | */ | 567 | */ |
568 | int ret = (p->flags & PF_EXITPIDONE) ? -ESRCH : -EAGAIN; | 568 | int ret = (p->flags & PF_EXITPIDONE) ? -ESRCH : -EAGAIN; |
569 | 569 | ||
570 | spin_unlock_irq(&p->pi_lock); | 570 | raw_spin_unlock_irq(&p->pi_lock); |
571 | put_task_struct(p); | 571 | put_task_struct(p); |
572 | return ret; | 572 | return ret; |
573 | } | 573 | } |
@@ -586,7 +586,7 @@ lookup_pi_state(u32 uval, struct futex_hash_bucket *hb, | |||
586 | WARN_ON(!list_empty(&pi_state->list)); | 586 | WARN_ON(!list_empty(&pi_state->list)); |
587 | list_add(&pi_state->list, &p->pi_state_list); | 587 | list_add(&pi_state->list, &p->pi_state_list); |
588 | pi_state->owner = p; | 588 | pi_state->owner = p; |
589 | spin_unlock_irq(&p->pi_lock); | 589 | raw_spin_unlock_irq(&p->pi_lock); |
590 | 590 | ||
591 | put_task_struct(p); | 591 | put_task_struct(p); |
592 | 592 | ||
@@ -760,7 +760,7 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) | |||
760 | if (!pi_state) | 760 | if (!pi_state) |
761 | return -EINVAL; | 761 | return -EINVAL; |
762 | 762 | ||
763 | spin_lock(&pi_state->pi_mutex.wait_lock); | 763 | raw_spin_lock(&pi_state->pi_mutex.wait_lock); |
764 | new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); | 764 | new_owner = rt_mutex_next_owner(&pi_state->pi_mutex); |
765 | 765 | ||
766 | /* | 766 | /* |
@@ -789,23 +789,23 @@ static int wake_futex_pi(u32 __user *uaddr, u32 uval, struct futex_q *this) | |||
789 | else if (curval != uval) | 789 | else if (curval != uval) |
790 | ret = -EINVAL; | 790 | ret = -EINVAL; |
791 | if (ret) { | 791 | if (ret) { |
792 | spin_unlock(&pi_state->pi_mutex.wait_lock); | 792 | raw_spin_unlock(&pi_state->pi_mutex.wait_lock); |
793 | return ret; | 793 | return ret; |
794 | } | 794 | } |
795 | } | 795 | } |
796 | 796 | ||
797 | spin_lock_irq(&pi_state->owner->pi_lock); | 797 | raw_spin_lock_irq(&pi_state->owner->pi_lock); |
798 | WARN_ON(list_empty(&pi_state->list)); | 798 | WARN_ON(list_empty(&pi_state->list)); |
799 | list_del_init(&pi_state->list); | 799 | list_del_init(&pi_state->list); |
800 | spin_unlock_irq(&pi_state->owner->pi_lock); | 800 | raw_spin_unlock_irq(&pi_state->owner->pi_lock); |
801 | 801 | ||
802 | spin_lock_irq(&new_owner->pi_lock); | 802 | raw_spin_lock_irq(&new_owner->pi_lock); |
803 | WARN_ON(!list_empty(&pi_state->list)); | 803 | WARN_ON(!list_empty(&pi_state->list)); |
804 | list_add(&pi_state->list, &new_owner->pi_state_list); | 804 | list_add(&pi_state->list, &new_owner->pi_state_list); |
805 | pi_state->owner = new_owner; | 805 | pi_state->owner = new_owner; |
806 | spin_unlock_irq(&new_owner->pi_lock); | 806 | raw_spin_unlock_irq(&new_owner->pi_lock); |
807 | 807 | ||
808 | spin_unlock(&pi_state->pi_mutex.wait_lock); | 808 | raw_spin_unlock(&pi_state->pi_mutex.wait_lock); |
809 | rt_mutex_unlock(&pi_state->pi_mutex); | 809 | rt_mutex_unlock(&pi_state->pi_mutex); |
810 | 810 | ||
811 | return 0; | 811 | return 0; |
@@ -1010,7 +1010,7 @@ void requeue_futex(struct futex_q *q, struct futex_hash_bucket *hb1, | |||
1010 | plist_add(&q->list, &hb2->chain); | 1010 | plist_add(&q->list, &hb2->chain); |
1011 | q->lock_ptr = &hb2->lock; | 1011 | q->lock_ptr = &hb2->lock; |
1012 | #ifdef CONFIG_DEBUG_PI_LIST | 1012 | #ifdef CONFIG_DEBUG_PI_LIST |
1013 | q->list.plist.lock = &hb2->lock; | 1013 | q->list.plist.spinlock = &hb2->lock; |
1014 | #endif | 1014 | #endif |
1015 | } | 1015 | } |
1016 | get_futex_key_refs(key2); | 1016 | get_futex_key_refs(key2); |
@@ -1046,7 +1046,7 @@ void requeue_pi_wake_futex(struct futex_q *q, union futex_key *key, | |||
1046 | 1046 | ||
1047 | q->lock_ptr = &hb->lock; | 1047 | q->lock_ptr = &hb->lock; |
1048 | #ifdef CONFIG_DEBUG_PI_LIST | 1048 | #ifdef CONFIG_DEBUG_PI_LIST |
1049 | q->list.plist.lock = &hb->lock; | 1049 | q->list.plist.spinlock = &hb->lock; |
1050 | #endif | 1050 | #endif |
1051 | 1051 | ||
1052 | wake_up_state(q->task, TASK_NORMAL); | 1052 | wake_up_state(q->task, TASK_NORMAL); |
@@ -1394,7 +1394,7 @@ static inline void queue_me(struct futex_q *q, struct futex_hash_bucket *hb) | |||
1394 | 1394 | ||
1395 | plist_node_init(&q->list, prio); | 1395 | plist_node_init(&q->list, prio); |
1396 | #ifdef CONFIG_DEBUG_PI_LIST | 1396 | #ifdef CONFIG_DEBUG_PI_LIST |
1397 | q->list.plist.lock = &hb->lock; | 1397 | q->list.plist.spinlock = &hb->lock; |
1398 | #endif | 1398 | #endif |
1399 | plist_add(&q->list, &hb->chain); | 1399 | plist_add(&q->list, &hb->chain); |
1400 | q->task = current; | 1400 | q->task = current; |
@@ -1529,18 +1529,18 @@ retry: | |||
1529 | * itself. | 1529 | * itself. |
1530 | */ | 1530 | */ |
1531 | if (pi_state->owner != NULL) { | 1531 | if (pi_state->owner != NULL) { |
1532 | spin_lock_irq(&pi_state->owner->pi_lock); | 1532 | raw_spin_lock_irq(&pi_state->owner->pi_lock); |
1533 | WARN_ON(list_empty(&pi_state->list)); | 1533 | WARN_ON(list_empty(&pi_state->list)); |
1534 | list_del_init(&pi_state->list); | 1534 | list_del_init(&pi_state->list); |
1535 | spin_unlock_irq(&pi_state->owner->pi_lock); | 1535 | raw_spin_unlock_irq(&pi_state->owner->pi_lock); |
1536 | } | 1536 | } |
1537 | 1537 | ||
1538 | pi_state->owner = newowner; | 1538 | pi_state->owner = newowner; |
1539 | 1539 | ||
1540 | spin_lock_irq(&newowner->pi_lock); | 1540 | raw_spin_lock_irq(&newowner->pi_lock); |
1541 | WARN_ON(!list_empty(&pi_state->list)); | 1541 | WARN_ON(!list_empty(&pi_state->list)); |
1542 | list_add(&pi_state->list, &newowner->pi_state_list); | 1542 | list_add(&pi_state->list, &newowner->pi_state_list); |
1543 | spin_unlock_irq(&newowner->pi_lock); | 1543 | raw_spin_unlock_irq(&newowner->pi_lock); |
1544 | return 0; | 1544 | return 0; |
1545 | 1545 | ||
1546 | /* | 1546 | /* |