Received: by 10.213.65.68 with SMTP id h4csp2490107imn; Mon, 2 Apr 2018 08:28:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx48t03n5P+sMj31nNSCtaJYZ3DcIcG/E8sPWxrd0ybvI3B57guIe1KUbJEhW/0k/3LXI7rfi X-Received: by 2002:a17:902:82cb:: with SMTP id u11-v6mr10242935plz.369.1522682925473; Mon, 02 Apr 2018 08:28:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522682925; cv=none; d=google.com; s=arc-20160816; b=O5nQyfOeL19y5EZqmxxysB5HVutXHGM/SCyfqJPzRrOwhuKXQlf3MH6xicV3cS3RgK Kj5BynX+1eHFyqJd2MQrLp1VPkvFS/RFsouLBVyrlLmk0VIkal40EJrNn1bYZIdhir/i 7G7n1SwvFHe72zv5X97UN9VbWQsiNPibk/2+2/p+tay9zaH+U5IKchQCUMKHYWqJUGMa AzCekeL19uM/cAfAmNHcvt45kZi3Sjv3BpDxTscFlLintFzTg3793dcwTOflUO8xrCyW f3agsXwmXXKfZWfIn/QGH/XgYZJ30mDHO2aKNC/RF5z6qmBEm5WqCgt8uozKmiWk7E3E 6nbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:user-agent:in-reply-to :content-disposition:mime-version:references:reply-to:subject:cc:to :from:date:arc-authentication-results; bh=6vWt8pKW43ENESlTwmeefmKkDvHHF3552xFCcPxPg+g=; b=MLGHYiCvb1ggzqfCICjmxCDrIqAUfGfh34rqpgZDzWtu7nyaieiiMQHNzZhL7f5OfR gD48+CO6EguXCR/BbE9gnxhc5yLUN6nyODDt6hf/5IhLiY0lFHW2HCY8GLzu9U/CbJuG uEw4E7uwskdnuu7BUgjFyXFcoAx4vX97JI6rp9fxqLAf9qY/ztAPgE0xmcLdG+pUSca3 TFxzCH0nQ2rP4hYSZSnG0MDqO2rqBUHf0ziccjLs0fMWcgWHLpTX4fkK2r9Oko3Tr7kN LUTliySUOkxd1FB4jyhIa/gDfSTCBMcE/aRM55lBdVFEps+mLXH8686LKKyYrLP2jNKZ Taag== 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 x14si378208pgc.165.2018.04.02.08.28.30; Mon, 02 Apr 2018 08:28:45 -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 S1752823AbeDBP04 (ORCPT + 99 others); Mon, 2 Apr 2018 11:26:56 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:46058 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752110AbeDBP0w (ORCPT ); Mon, 2 Apr 2018 11:26:52 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w32FQnHr032720 for ; Mon, 2 Apr 2018 11:26:51 -0400 Received: from e15.ny.us.ibm.com (e15.ny.us.ibm.com [129.33.205.205]) by mx0b-001b2d01.pphosted.com with ESMTP id 2h3ne9n1y2-1 (version=TLSv1.2 cipher=AES256-SHA256 bits=256 verify=NOT) for ; Mon, 02 Apr 2018 11:26:49 -0400 Received: from localhost by e15.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 2 Apr 2018 11:26:47 -0400 Received: from b01cxnp22033.gho.pok.ibm.com (9.57.198.23) by e15.ny.us.ibm.com (146.89.104.202) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 2 Apr 2018 11:26:40 -0400 Received: from b01ledav003.gho.pok.ibm.com (b01ledav003.gho.pok.ibm.com [9.57.199.108]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w32FQe7t47382692; Mon, 2 Apr 2018 15:26:40 GMT Received: from b01ledav003.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 17592B2046; Mon, 2 Apr 2018 12:28:48 -0400 (EDT) Received: from paulmck-ThinkPad-W541 (unknown [9.70.82.108]) by b01ledav003.gho.pok.ibm.com (Postfix) with ESMTP id D3ED8B2052; Mon, 2 Apr 2018 12:28:47 -0400 (EDT) Received: by paulmck-ThinkPad-W541 (Postfix, from userid 1000) id 0ED9916C62D7; Mon, 2 Apr 2018 08:27:36 -0700 (PDT) Date: Mon, 2 Apr 2018 08:27:36 -0700 From: "Paul E. McKenney" To: Christopher Lameter Cc: Alan Cox , Mathieu Desnoyers , Peter Zijlstra , Boqun Feng , Andy Lutomirski , Dave Watson , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, Paul Turner , Andrew Morton , Russell King , Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Andrew Hunter , Andi Kleen , Ben Maurer , Steven Rostedt , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Alexander Viro Subject: Re: [RFC PATCH for 4.17 02/21] rseq: Introduce restartable sequences system call (v12) Reply-To: paulmck@linux.vnet.ibm.com References: <20180327160542.28457-1-mathieu.desnoyers@efficios.com> <20180327160542.28457-3-mathieu.desnoyers@efficios.com> <20180401171356.085a2a33@alans-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-GCONF: 00 x-cbid: 18040215-0036-0000-0000-000002DA9C42 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008789; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000255; SDB=6.01012077; UDB=6.00515778; IPR=6.00791347; MB=3.00020376; MTD=3.00000008; XFM=3.00000015; UTC=2018-04-02 15:26:46 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18040215-0037-0000-0000-000043D7AAC9 Message-Id: <20180402152736.GL3948@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-04-02_07:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1804020172 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 02, 2018 at 10:03:58AM -0500, Christopher Lameter wrote: > On Sun, 1 Apr 2018, Alan Cox wrote: > > > > Restartable sequences are atomic with respect to preemption > > > (making it atomic with respect to other threads running on the > > > same CPU), as well as signal delivery (user-space execution > > > contexts nested over the same thread). > > > > CPU generally means 'big lump with legs on it'. You are not atomic to the > > same CPU, because that CPU may have 30+ cores with 8 threads per core. > > > > It could do with some better terminology (hardware thread, CPU context ?) > > Well we call it a "CPU" in the scheduler context I think. We could use > better terminology throughout the kernel tools and source. Agreed, it has been "CPU" for "single hardware thread" for a very long time. People tend to use "core" for "group of hardware threads" and "socket" for "big lump with legs on it". > Hardware Execution Context? Should be even more fun when non-CPU hardware execution contexts show up in force within each core. ;-) But the terminology in place for non-CPU hardware execution contexts should be able to survive that event. > > > In a typical usage scenario, the thread registering the rseq > > > structure will be performing loads and stores from/to that > > > structure. It is however also allowed to read that structure > > > from other threads. The rseq field updates performed by the > > > kernel provide relaxed atomicity semantics, which guarantee > > > that other threads performing relaxed atomic reads of the cpu > > > number cache will always observe a consistent value. > > > > So what happens to your API if the kernel atomics get improved ? You are > > effectively exporting rseq behaviour from private to public. > > There is already a pretty complex coherency model guiding kernel atomics. > Improvements/changes to that are difficult and the effect will ripple > throughout the kernel. So I would suggest that these areas of the kernel > are pretty "petrified" (or written in stone). I suspect that there are much more pressing areas of confusion in any case! Thanx, Paul