From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Zijlstra Subject: Re: [RFC PATCH v7 1/7] Restartable sequences system call Date: Wed, 3 Aug 2016 14:27:17 +0200 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 Return-path: Content-Disposition: inline In-Reply-To: <1806206514.82247.1469502139408.JavaMail.zimbra-vg+e7yoeK/dWk0Htik3J/w@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Mathieu Desnoyers Cc: Andy Lutomirski , Andrew Morton , Russell King , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.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 List-Id: linux-api@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.