Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754029AbbGISdQ (ORCPT ); Thu, 9 Jul 2015 14:33:16 -0400 Received: from mail-lb0-f173.google.com ([209.85.217.173]:34248 "EHLO mail-lb0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753529AbbGISdG (ORCPT ); Thu, 9 Jul 2015 14:33:06 -0400 MIME-Version: 1.0 From: Andy Lutomirski Date: Thu, 9 Jul 2015 11:32:45 -0700 Message-ID: Subject: [CORE TOPIC] lightweight per-cpu locks / restartable sequences To: "ksummit-discuss@lists.linuxfoundation.org" , "linux-kernel@vger.kernel.org" Cc: Peter Zijlstra , Paul Turner , Mathieu Desnoyers 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: 1187 Lines: 26 Several people have suggested that Linux should provide users with a lightweight mechanism that allows light-weight fancy per-cpu operations. This could be used to implement free lists or counters without any barriers or atomic operations, for example. There are at least three approaches floating around. Paul Turner proposed a single block of userspace code that aborts if it's preempted -- within that block, percpu variables can be used safely. Mathieu Desnoyers proposed a more complex variant. I proposed a much simpler approach of just offering percpu gs bases on x86, allowing cmpxchg (as opposed to lock cmpxchg) to access percpu variables. None of these should be hard to implement, but it would be nice to hash out whether the kernel should support such a mechanism at all and, if so, what it would look like. Jon Corbet unsurprisingly has a nice writeup here: http://lwn.net/SubscriberLink/650333/f23d07040a58cd46/ --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/