Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751527AbdHNNao (ORCPT ); Mon, 14 Aug 2017 09:30:44 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:49967 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750989AbdHNNan (ORCPT ); Mon, 14 Aug 2017 09:30:43 -0400 Subject: Re: [PATCH v6 14/17] powerpc: Add support for setting SPRN_TIDR From: Benjamin Herrenschmidt Reply-To: benh@au1.ibm.com To: Michael Neuling , Sukadev Bhattiprolu , Michael Ellerman Cc: stewart@linux.vnet.ibm.com, linuxppc-dev@ozlabs.org, linux-kernel@vger.kernel.org, apopple@au1.ibm.com, oohall@gmail.com Date: Mon, 14 Aug 2017 23:30:35 +1000 In-Reply-To: <1502694131.9844.7.camel@neuling.org> References: <1502233622-9330-1-git-send-email-sukadev@linux.vnet.ibm.com> <1502233622-9330-15-git-send-email-sukadev@linux.vnet.ibm.com> <1502694131.9844.7.camel@neuling.org> Organization: IBM Australia Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.24.4 (3.24.4-1.fc26) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable x-cbid: 17081413-0044-0000-0000-00000282475C X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17081413-0045-0000-0000-0000071543CE Message-Id: <1502717435.4493.29.camel@au1.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-14_11:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1706020000 definitions=main-1708140222 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 983 Lines: 25 On Mon, 2017-08-14 at 17:02 +1000, Michael Neuling wrote: > > +/* > > + * We need to assign an unique thread id to each thread in a process. This > > + * thread id is intended to be used with the Fast Thread-wakeup (aka Core- > > + * to-core wakeup) mechanism being implemented on top of Virtual Accelerator > > + * Switchboard (VAS). > > + * > > + * To get a unique thread-id per process we could simply use task_pid_nr() > > + * but the problem is that task_pid_nr() is not yet available for the thread > > + * when copy_thread() is called. Fixing that would require changing more > > + * intrusive arch-neutral code in code path in copy_process()?. > > + * > > + * Further, to assign unique thread ids within each process, we need an > > + * atomic field (or an IDR) in task_struct, which again intrudes into the > > + * arch-neutral code. > > Really? > > > + * So try to assign globally unique thraed ids for now. > > Yuck! Also CAPI has size limits for the TIDR afaik Ben.