Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp197079imm; Wed, 30 May 2018 21:32:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ/vr4GEZTnyh4Hxi4E5cmoJxsEFRflPoW3TeTapA6s30qDsMOkUAhNKMUT3qs99ePOn9oU X-Received: by 2002:a17:902:1002:: with SMTP id b2-v6mr5408729pla.344.1527741121675; Wed, 30 May 2018 21:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527741121; cv=none; d=google.com; s=arc-20160816; b=HX22bg2j6GIOKZjsUpJUOwI7HMMOv+PYFrHEsXUvzmBkxOkJYvpjmYTcvE8HtrK2HQ Abwr/dTWqCMWevQV8Qd0Cb8J5fOtUr5ACluf4X6gvu0CMTx0sNTTbqAMoiQzU6r36xcU lS+JYvZm34ValhfRPXyYfhcqcdab/hjWsbskG85LD4RBgYS9/k5sMznpoJj0uqateaha AyKIkQ0uFYd2cn319p4bwiWPyaf5zxgpGKZVevlC0tCad7jwx0ykk7/SjakZ+x4N1vsl nJdiFrzp4+uk6goXJF166pK3IHxiHf6eQrULWNFAWjVLFHv959fwO1i0RoAj8X/hj+Ep kofg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject:arc-authentication-results; bh=sNN62QCcFl1HuijOsZtiTZlep2PC5zwPEGAhflq3Wg0=; b=GXnVjLJ7RVJuybmaarPmrmIHHSRjr4yu20FSWllBF4Kc8PZ8U2Wn+hSaNm31fSKGw8 GRsZCW/QLeT3qPCA8FKGQhXZYLU+snWnbU6tUKw8ndPixWx6FPe+f/TFk8f23bGyV0pl 7rgB3TSKAVZFx5HTWN+8zoYHBRmEmH0Ck3p9gtJEpMu8Wwa1i1OAh4xXRPcho5d3W01U sXDiMztbkl+ynAJeIGlNf3gaXG8E1/InL/aSbn6B7rNXJ37Q+dEmeTgEmzryq7eYhYpk YigAorbIJtxs/rOLzL8lVma8oniH8/kjMuPq3PgYPJ5Sh2flyT65BKF8E5ITznu6yhbH sZnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b59-v6si36395827plc.335.2018.05.30.21.31.47; Wed, 30 May 2018 21:32:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753824AbeEaEaz (ORCPT + 99 others); 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 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w4V4Un1F009526 for ; Thu, 31 May 2018 00:30:53 -0400 Received: from e06smtp05.uk.ibm.com (e06smtp05.uk.ibm.com [195.75.94.101]) by mx0b-001b2d01.pphosted.com with ESMTP id 2ja6uee4pm-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 31 May 2018 00:30:51 -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 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp05.uk.ibm.com (192.168.101.135) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 31 May 2018 05:30:00 +0100 Received: from d06av23.portsmouth.uk.ibm.com (d06av23.portsmouth.uk.ibm.com [9.149.105.59]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w4V4TxPI17367226 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 31 May 2018 04:29:59 GMT Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A991FA4040; Thu, 31 May 2018 05:21:09 +0100 (BST) Received: from d06av23.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3AA94A4055; Thu, 31 May 2018 05:21:09 +0100 (BST) Received: from ozlabs.au.ibm.com (unknown [9.192.253.14]) by d06av23.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 31 May 2018 05:21:09 +0100 (BST) Received: from [10.61.2.125] (haven.au.ibm.com [9.192.254.114]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by ozlabs.au.ibm.com (Postfix) with ESMTPSA id 9C5A4A0222; Thu, 31 May 2018 14:29:57 +1000 (AEST) 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 Precedence: bulk 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