Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754482AbYAQDDI (ORCPT ); Wed, 16 Jan 2008 22:03:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751776AbYAQDC4 (ORCPT ); Wed, 16 Jan 2008 22:02:56 -0500 Received: from ms-smtp-01.nyroc.rr.com ([24.24.2.55]:59851 "EHLO ms-smtp-01.nyroc.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751248AbYAQDCz (ORCPT ); Wed, 16 Jan 2008 22:02:55 -0500 Date: Wed, 16 Jan 2008 22:02:49 -0500 (EST) From: Steven Rostedt X-X-Sender: rostedt@gandalf.stny.rr.com To: Mathieu Desnoyers cc: john stultz , LKML , Ingo Molnar , Linus Torvalds , Andrew Morton , Peter Zijlstra , Christoph Hellwig , Gregory Haskins , Arnaldo Carvalho de Melo , Thomas Gleixner , Tim Bird , Sam Ravnborg , "Frank Ch. Eigler" , Steven Rostedt , Paul Mackerras , Daniel Walker Subject: Re: [RFC PATCH 16/22 -v2] add get_monotonic_cycles In-Reply-To: <20080117025004.GE2322@Krystal> Message-ID: References: <20080115220824.GB22242@Krystal> <20080116031730.GA2164@Krystal> <20080116145604.GB31329@Krystal> <1f1b08da0801161436k4a7ac1e3kd83590951e7bebb9@mail.gmail.com> <1200523867.6127.5.camel@localhost.localdomain> <1200536889.6127.52.camel@localhost.localdomain> <20080117024000.GD2322@Krystal> <20080117025004.GE2322@Krystal> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1293 Lines: 38 On Wed, 16 Jan 2008, Mathieu Desnoyers wrote: > It would imply the creation of a new vsyscall : vgetschedperiod > > It would read a counter that would increment each time the thread is > scheduled out (or in). It would be a per thread counter (not a per cpu > counter) so we can deal appropriately with a stopped thread that would > happen to come back running a loooong time afterward (if we do per-cpu > counters, we could get the same 32 bits counter value falsely if it is > shared with other thread activity). > > Then, the clocksource read code would look like : > > int period; > > do { > period = vgetschedperiod(); > > perform the clocksource read.. > > } while (period != vgetschedperiod()); > > Therefore, we would be sure that we have not been scheduled out while > reading the value. I think this new vsyscall could be useful for others. > Actually, it would make implementation of RCU in user-space possible (as > long as the read-side can retry the read operation). This is something that I would agree is useful. -- Steve -- 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/