From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755432AbcHSUtq (ORCPT ); Fri, 19 Aug 2016 16:49:46 -0400 Received: from slow1-d.mail.gandi.net ([217.70.178.86]:55854 "EHLO slow1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752435AbcHSUtn (ORCPT ); Fri, 19 Aug 2016 16:49:43 -0400 Date: Fri, 19 Aug 2016 13:44:50 -0700 From: Josh Triplett To: Linus Torvalds Cc: Mathieu Desnoyers , Peter Zijlstra , "Paul E. McKenney" , Boqun Feng , Andy Lutomirski , Dave Watson , Linux Kernel Mailing List , Linux API , Paul Turner , Andrew Morton , Russell King , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , Andrew Hunter , Andi Kleen , Chris Lameter , Ben Maurer , Steven Rostedt , Catalin Marinas , Will Deacon , Michael Kerrisk Subject: Re: [RFC PATCH v8 1/9] Restartable sequences system call Message-ID: <20160819204450.GB27677@cloud> References: <1471637274-13583-1-git-send-email-mathieu.desnoyers@efficios.com> <1471637274-13583-2-git-send-email-mathieu.desnoyers@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 19, 2016 at 01:23:57PM -0700, Linus Torvalds wrote: > On Fri, Aug 19, 2016 at 1:07 PM, Mathieu Desnoyers > wrote: > > > > Benchmarking various approaches for reading the current CPU number: > > So I'd like to see the benchmarks of something that actually *does* something. > > IOW, what's the bigger-picture "this is what it actually is useful > for, and how it speeds things up". > > Nobody gets a cpu number just to get a cpu number - it's not a useful > thing to benchmark. What does getcpu() so much that we care? The combination of CPU number and restartable sequence allows userspace to write "per-CPU" rather than "per-thread" algorithms, just as the kernel can. The kernel can do that with preempt_disable(). Userspace can do it with "tell me my CPU and restart me if preempted". But yes, this needs a benchmark of, for instance, urcu implemented on top of this, or some concrete data structure.