File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -3703,16 +3703,19 @@ void futex_exit_recursive(struct task_struct *tsk)
3703
3703
3704
3704
void futex_exit_release (struct task_struct * tsk )
3705
3705
{
3706
- tsk -> futex_state = FUTEX_STATE_EXITING ;
3707
- /*
3708
- * Ensure that all new tsk->pi_lock acquisitions must observe
3709
- * FUTEX_STATE_EXITING. Serializes against attach_to_pi_owner().
3710
- */
3711
- smp_mb ();
3712
3706
/*
3713
- * Ensure that we must observe the pi_state in exit_pi_state_list().
3707
+ * Switch the state to FUTEX_STATE_EXITING under tsk->pi_lock.
3708
+ *
3709
+ * This ensures that all subsequent checks of tsk->futex_state in
3710
+ * attach_to_pi_owner() must observe FUTEX_STATE_EXITING with
3711
+ * tsk->pi_lock held.
3712
+ *
3713
+ * It guarantees also that a pi_state which was queued right before
3714
+ * the state change under tsk->pi_lock by a concurrent waiter must
3715
+ * be observed in exit_pi_state_list().
3714
3716
*/
3715
3717
raw_spin_lock_irq (& tsk -> pi_lock );
3718
+ tsk -> futex_state = FUTEX_STATE_EXITING ;
3716
3719
raw_spin_unlock_irq (& tsk -> pi_lock );
3717
3720
3718
3721
futex_exec_release (tsk );
You can’t perform that action at this time.
0 commit comments