]> git.baikalelectronics.ru Git - kernel.git/commit
futex: Remove bogus condition for requeue PI
authorThomas Gleixner <tglx@linutronix.de>
Sun, 15 Aug 2021 21:29:09 +0000 (23:29 +0200)
committerIngo Molnar <mingo@kernel.org>
Tue, 17 Aug 2021 17:05:44 +0000 (19:05 +0200)
commitd8320fd82f24b0f3617c8baf641700cc3f33cd16
tree27270a917e3de9a3cb45865d5dde7652af35619e
parentcfbc5b536b686809e921dc9f516ebc69ff1a9c9f
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.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20210815211305.362730187@linutronix.de
kernel/futex.c