From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 40xDyp4rXpzDrbK for ; Thu, 31 May 2018 14:30:10 +1000 (AEST) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4V4TovI009894 for ; Thu, 31 May 2018 00:30:08 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ja5g98jq3-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 00:30:08 -0400 Received: from localhost by e06smtp05.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 31 May 2018 05:30:05 +0100 Subject: Re: [PATCH v5 3/7] powerpc: use task_pid_nr() for TID allocation To: "Alastair D'Silva" , linuxppc-dev@lists.ozlabs.org Cc: linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, mikey@neuling.org, vaibhav@linux.vnet.ibm.com, aneesh.kumar@linux.vnet.ibm.com, malat@debian.org, felix@linux.vnet.ibm.com, pombredanne@nexb.com, sukadev@linux.vnet.ibm.com, npiggin@gmail.com, gregkh@linuxfoundation.org, arnd@arndb.de, fbarrat@linux.vnet.ibm.com, corbet@lwn.net, "Alastair D'Silva" References: <20180511061303.10728-1-alastair@au1.ibm.com> <20180511061303.10728-4-alastair@au1.ibm.com> From: Andrew Donnellan Date: Thu, 31 May 2018 14:29:57 +1000 MIME-Version: 1.0 In-Reply-To: <20180511061303.10728-4-alastair@au1.ibm.com> Message-Id: <65f643c0-6ac0-a88f-6822-c95d17c83a9f@au1.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 11/05/18 16:12, Alastair D'Silva wrote: > From: Alastair D'Silva > > 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 Thanks for the clarifying comment. The diff is painful to read but I think it makes sense :) Reviewed-by: Andrew Donnellan -- Andrew Donnellan OzLabs, ADL Canberra andrew.donnellan@au1.ibm.com IBM Australia Limited