History

futex: Remove bogus condition for requeue PI

For requeue PI it's required to establish PI state for the PI futex to which waiters are requeued. This either acquires the user space futex on behalf of the top most waiter on the inner 'waitqueue' futex, or attaches to the PI state of an existing waiter, or creates on attached to the owner of the futex. This code can retry in case of failure, but retry can never happen when the pi state was successfully created. The condition to run this code is: (task_count - nr_wake) < nr_requeue which is always true because: task_count = 0 nr_wake = 1 nr_requeue >= 0 Remove it completely.

Thomas Gleixner committed 5 years ago

Commit 8e746331 parent f6f4ec01 file · +1 −1Browse files

Showing the changes to kernel (1 of 1 file). Show all

Unified · Split

kernel/futex.c+1−1
@@ -2000,7 +2000,7 @@ retry_private: · 1999 unmodified lines
2000 }2000 }
2001 }2001 }
2002 2002
2003 if (requeue_pi && (task_count - nr_wake < nr_requeue)) {2003 if (requeue_pi) {
2004 struct task_struct *exiting = NULL;2004 struct task_struct *exiting = NULL;
2005 2005
2006 /*2006 /*