From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753837AbeEaEaz (ORCPT ); Thu, 31 May 2018 00:30:55 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44922 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750949AbeEaEay (ORCPT ); Thu, 31 May 2018 00:30:54 -0400 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 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180511061303.10728-4-alastair@au1.ibm.com> Content-Language: en-AU X-TM-AS-GCONF: 00 x-cbid: 18053104-0020-0000-0000-000002953380 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18053104-0021-0000-0000-000020E0AC16 Message-Id: <65f643c0-6ac0-a88f-6822-c95d17c83a9f@au1.ibm.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-31_02:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1805310049 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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