]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc: use task_pid_nr() for TID allocation
authorAlastair D'Silva <alastair@d-silva.org>
Fri, 11 May 2018 06:12:59 +0000 (16:12 +1000)
committerMichael Ellerman <mpe@ellerman.id.au>
Sun, 3 Jun 2018 10:40:31 +0000 (20:40 +1000)
commit36afbf1d04b5de11f50f580d19a1fd90e0ce6f75
treed24635c72fdf6d279c20574381df9b722f54cc0e
parent6229da0b57a4d3de696c6f4f24137a2c44e205af
powerpc: use task_pid_nr() for TID allocation

The current implementation of TID allocation, using a global IDR, may
result in an errant process starving the system of available TIDs.
Instead, use task_pid_nr(), as mentioned by the original author. The
scenario described which prevented it's use is not applicable, as
set_thread_tidr can only be called after the task struct has been
populated.

In the unlikely event that 2 threads share the TID and are waiting,
all potential outcomes have been determined safe.

Signed-off-by: Alastair D'Silva <alastair@d-silva.org>
Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/include/asm/switch_to.h
arch/powerpc/kernel/process.c