[PATCH v5 3/7] powerpc: use task_pid_nr() for TID allocation

Andrew Donnellan andrew.donnellan at au1.ibm.com
Thu May 31 14:29:57 AEST 2018


On 11/05/18 16:12, Alastair D'Silva wrote:
> From: Alastair D'Silva <alastair at d-silva.org>
> 
> 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 at d-silva.org>

Thanks for the clarifying comment. The diff is painful to read but I 
think it makes sense :)

Reviewed-by: Andrew Donnellan <andrew.donnellan at au1.ibm.com>

-- 
Andrew Donnellan              OzLabs, ADL Canberra
andrew.donnellan at au1.ibm.com  IBM Australia Limited



More information about the Linuxppc-dev mailing list