Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752312AbbFYAH6 (ORCPT ); Wed, 24 Jun 2015 20:07:58 -0400 Received: from mail-lb0-f174.google.com ([209.85.217.174]:34291 "EHLO mail-lb0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751847AbbFYAHt (ORCPT ); Wed, 24 Jun 2015 20:07:49 -0400 MIME-Version: 1.0 In-Reply-To: <20150624222609.6116.86035.stgit@kitami.mtv.corp.google.com> References: <20150624222609.6116.86035.stgit@kitami.mtv.corp.google.com> From: Andy Lutomirski Date: Wed, 24 Jun 2015 17:07:28 -0700 Message-ID: Subject: Re: [RFC PATCH 0/3] restartable sequences: fast user-space percpu critical sections To: Paul Turner Cc: Peter Zijlstra , "Paul E. McKenney" , Mathieu Desnoyers , Andrew Hunter , Andi Kleen , Lai Jiangshan , Linux API , "linux-kernel@vger.kernel.org" , Steven Rostedt , Josh Triplett , Ingo Molnar , Andrew Morton , Linus Torvalds , Chris Lameter Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 945 Lines: 23 On Wed, Jun 24, 2015 at 3:26 PM, Paul Turner wrote: > This is a fairly small series demonstrating a feature we've found to be quite > powerful in practice, "restartable sequences". > On an extremely short glance, I'm starting to think that the right approach, at least for x86, is to implement per-cpu gsbase. Then you could do cmpxchg with a gs prefix to atomically take a percpu lock and atomically release a percpu lock and check whether someone else stole the lock from you. (Note: cmpxchg, unlike lock cmpxchg, is very fast.) This is totally useless for other architectures, but I think it would be reasonable clean on x86. Thoughts? I can elaborate if necessary. --Andy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/