diff options
Diffstat (limited to 'patches/0061-futex-Correct-the-number-of-requeued-waiters-for-PI.patch')
-rw-r--r-- | patches/0061-futex-Correct-the-number-of-requeued-waiters-for-PI.patch | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/patches/0061-futex-Correct-the-number-of-requeued-waiters-for-PI.patch b/patches/0061-futex-Correct-the-number-of-requeued-waiters-for-PI.patch new file mode 100644 index 000000000000..feedde19f5e2 --- /dev/null +++ b/patches/0061-futex-Correct-the-number-of-requeued-waiters-for-PI.patch @@ -0,0 +1,37 @@ +From: Thomas Gleixner <tglx@linutronix.de> +Date: Sun, 15 Aug 2021 23:29:10 +0200 +Subject: [PATCH 61/72] futex: Correct the number of requeued waiters for PI + +The accounting is wrong when either the PI sanity check or the +requeue PI operation fails. Adjust it in the failure path. + +Will be simplified in the next step. + +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.416427548@linutronix.de +--- + kernel/futex.c | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -2116,6 +2116,8 @@ static int futex_requeue(u32 __user *uad + + /* Ensure we requeue to the expected futex for requeue_pi. */ + if (requeue_pi && !match_futex(this->requeue_pi_key, &key2)) { ++ /* Don't account for it */ ++ task_count--; + ret = -EINVAL; + break; + } +@@ -2157,6 +2159,8 @@ static int futex_requeue(u32 __user *uad + */ + this->pi_state = NULL; + put_pi_state(pi_state); ++ /* Don't account for it */ ++ task_count--; + /* + * We stop queueing more waiters and let user + * space deal with the mess. |