Received: by 10.213.65.68 with SMTP id h4csp2468054imn; Mon, 2 Apr 2018 08:06:06 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+St9Z0UmydHtVlikqPzbmDk1r6OCiAjLFQ7Pn568xQQxDTKEf3LmU9gpc+ZPaPJgEcZp27 X-Received: by 2002:a17:902:9a82:: with SMTP id w2-v6mr10126854plp.6.1522681566043; Mon, 02 Apr 2018 08:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522681565; cv=none; d=google.com; s=arc-20160816; b=KO2S64YTVPPTsRjzif2NZ++DyAAG5iDIXiPWmD/DZRCx2IRVzWRxskpvFHE0uynLKT XEgxOJG1xCTGB6t711F+vkH8T2dqV3ZvylClsDTdBoeoKTa2SJhpyQJou3MZeUQQcXYV w9xCepeMrgyDxRo3wOrsK9PWPRsDCDk1jJPdCFySz6Iw6b6rbywSBgiFalU4rNbWNG6o MpTqhOpc/boI7iarUQM1JXfcygtkVlbABzrf3P7gGsQRDU58TxzNmwSVYgE/c3ji/cRi Bwhz0nOuNEVqQEE3CWNlBMVxqiUkgX6OH9dQdM5ehv0+BbvRNQbynOkPUONLLwkNUW1T H4XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date :arc-authentication-results; bh=Rl8kpPDhYPorq4/mvkiBrRjypp4yHYKBrI+31Ev03s0=; b=xfUUX3tZRYhU5lZpuaU0vsYC4ct8fRZ/GMqUFVmVK0zbh4PPh86kQ3cK4VPu+fvfri pUZlGOoPb64zPG22dnwhgoqUehhyorlidvWxrbw7K3zHmjQj43NMKUyVfGrfqf/Uas5J +Ov+kmkb5VAE7epZAxgiLw1VnJBIPbXDZbiGHdfRSTMozLOZQg65MczC2OvlJF+1rgr8 7TjTUGDQ0U4MaXriMUw85UtUPykyiuL2xiTiCXR9yPm4GpeOAxCNJsy0irpCsvl53Lm5 yzXMlL5y5NgYVw73zyQGjTppa1hqXmOS7s374zADf3W8Q1nHWMmZ8wADFMGias1eOLRY /D2A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c11si336321pgv.446.2018.04.02.08.05.50; Mon, 02 Apr 2018 08:06:05 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752168AbeDBPEG (ORCPT + 99 others); Mon, 2 Apr 2018 11:04:06 -0400 Received: from resqmta-ch2-06v.sys.comcast.net ([69.252.207.38]:54722 "EHLO resqmta-ch2-06v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752023AbeDBPEC (ORCPT ); Mon, 2 Apr 2018 11:04:02 -0400 Received: from resomta-ch2-08v.sys.comcast.net ([69.252.207.104]) by resqmta-ch2-06v.sys.comcast.net with ESMTP id 3105faejy909b3105fOzCY; Mon, 02 Apr 2018 15:04:01 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-08v.sys.comcast.net with SMTP id 3102ftPpbsz7R3103flSEj; Mon, 02 Apr 2018 15:04:01 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 572A111616E7; Mon, 2 Apr 2018 10:03:58 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 54A2011616E5; Mon, 2 Apr 2018 10:03:58 -0500 (CDT) Date: Mon, 2 Apr 2018 10:03:58 -0500 (CDT) From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Alan Cox cc: Mathieu Desnoyers , Peter Zijlstra , "Paul E . McKenney" , 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) In-Reply-To: <20180401171356.085a2a33@alans-desktop> Message-ID: References: <20180327160542.28457-1-mathieu.desnoyers@efficios.com> <20180327160542.28457-3-mathieu.desnoyers@efficios.com> <20180401171356.085a2a33@alans-desktop> User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-CMAE-Envelope: MS4wfL7vMM2q1MR4bAwHTPZ9sTwW7Ys5OR32VPXDmgMnJfcF1J2vm7uG6E4OTD8PQqal1S6MZ15r/NG5+PyG9P70h+ZFchHIrc+pLAabj22ASu7r2Bs2khri drZmTnhVZSUhxkhlSYqez34lHfKBuR+h+NLWqEotfJssXmA2WTGDhpbcMzOALVf4Ys88cuJONXDfa/UnkgRPzsHBMOW5UDleZ84MVSsemjQsfCYCZWht5u17 0ECjBy3znVvG4yqhSzos/AbvecDP7yTvCmqc1Ti5bPhu9PmXoEK37zutw0F9tLJvWj76qKYzran0lRKCkcLbxYLTsWBhf7mN/SBomQeeS1AgT8+nIK5E50BX TejOQ/1TXx7tAXetZtFcWZOienl63FlWmTScsol2NgZkhDA7u+xQgdcN3D8/Ei6C9CXfbH2E0TcZChNQ47p5bfK6EBOEW/REU7eWNDUP0Iag7I1IcF1atcHg omYGUCErU/DDuVZzpglNFX1IUtYCKB53xZp2kbvzyDePvtDtxHZiiQWhkJdJeXBqV7hveYuta/+vY4uP1H3EEtpyyiJoMl6Y99c7lx/3nZXQQIJD9RGBs06t 5DR0klefi8ZtYUF/bFXvszmWUbrPBtVwq/GFRHVUyD0NZDyuF+Wop1CfwGDRZ+blNaXYwWbhfxFbOonZavsQQfQr/MXx1LumLH7NGtQ3QcZzGCWUa1aF+1Th oJ4wwizuBvMtEyN8D+VOAFG3B33eSf5LP0F7pT+QHGZRZ4xuevJjuTJmj3k4Mgr8boS/9+qL4GTcz5nNscFtczo8rK4nPV8cBNl8w5GzuR9nBm5HWaYbvjA8 P7z9tuEOHmdmC8EXga6byXyhCYyMMZAplyaIORzmk+KUifHH/tt5BFHAUA7TuU4o2tLG24JKt8IIDHvrd/NCsvnwIOufw4LqMWHpa0RAq3vB5bDjTp20n2A0 ooAnGA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Hardware Execution Context? > > 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).