From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757867AbcHCM22 (ORCPT ); Wed, 3 Aug 2016 08:28:28 -0400 Received: from merlin.infradead.org ([205.233.59.134]:46244 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754542AbcHCM2W (ORCPT ); Wed, 3 Aug 2016 08:28:22 -0400 Date: Wed, 3 Aug 2016 14:27:17 +0200 From: Peter Zijlstra To: Mathieu Desnoyers Cc: Andy Lutomirski , Andrew Morton , Russell King , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-kernel@vger.kernel.org, linux-api , Paul Turner , Andrew Hunter , Andi Kleen , Dave Watson , Chris Lameter , Ben Maurer , rostedt , "Paul E. McKenney" , Josh Triplett , Linus Torvalds , Catalin Marinas , Will Deacon , Michael Kerrisk , Boqun Feng Subject: Re: [RFC PATCH v7 1/7] Restartable sequences system call Message-ID: <20160803122717.GL6862@twins.programming.kicks-ass.net> References: <1469135662-31512-1-git-send-email-mathieu.desnoyers@efficios.com> <1469135662-31512-2-git-send-email-mathieu.desnoyers@efficios.com> <1806206514.82247.1469502139408.JavaMail.zimbra@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1806206514.82247.1469502139408.JavaMail.zimbra@efficios.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 26, 2016 at 03:02:19AM +0000, Mathieu Desnoyers wrote: > We really care about preemption here. Every migration implies a > preemption from a user-space perspective. If we would only care > about keeping the CPU id up-to-date, hooking into migration would be > enough. But since we want atomicity guarantees for restartable > sequences, we need to hook into preemption. > It allows user-space to perform update operations on per-cpu data without > requiring heavy-weight atomic operations. Well, a CMPXCHG without LOCK prefix isn't all that expensive on x86. It is however on PPC and possibly other architectures, so in name of simplicity supporting only the one variant makes sense.