From mboxrd@z Thu Jan 1 00:00:00 1970 From: Mathieu Desnoyers Subject: Re: [PATCH 4/6] kvm tools: Add rwlock wrapper Date: Fri, 27 May 2011 10:18:18 -0400 Message-ID: <20110527141818.GD30292@Krystal> References: <1306426743.3065.34.camel@lappy> <20110526180518.GA3572@elte.hu> <4DDE97CE.4000302@redhat.com> <20110526202531.GA2765@elte.hu> <20110526230508.GA15983@Krystal> <20110527102533.GA24608@elte.hu> <20110527110729.GA26920@elte.hu> <20110527111057.GA27058@elte.hu> <20110527112443.GA27397@elte.hu> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Pekka Enberg , Avi Kivity , Sasha Levin , john@jfloren.net, kvm@vger.kernel.org, asias.hejun@gmail.com, gorcunov@gmail.com, prasadjoshi124@gmail.com, "Paul E. McKenney" To: Ingo Molnar Return-path: Received: from mail.openrapids.net ([64.15.138.104]:38398 "EHLO blackscsi.openrapids.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750935Ab1E0OSU (ORCPT ); Fri, 27 May 2011 10:18:20 -0400 Content-Disposition: inline In-Reply-To: <20110527112443.GA27397@elte.hu> Sender: kvm-owner@vger.kernel.org List-ID: * Ingo Molnar (mingo@elte.hu) wrote: > > * Ingo Molnar wrote: > > > Note that you do not want the context switch event, but the CPU > > migration event: that will notify user-space when it gets migrated > > to another CPU. This is the case that RCU really needs. > > Also note that the main current use-case of perf events is > instrumentation, thus if you make use of this facility for user-space > RCU you need to check whether the events are all precise and arrive > in time to the target process, etc. > > Statistical behavior isnt a big problem for instrumentation but it's > a showstopper for RCU, obviously! :-) > > If you find such bugs then we want to fix them, so there's no > fundamental *desire* from us for these events to be statistical and > inaccurate anywhere. The accuracy vs speed tradeoff is actually quite different from the instrumentation vs low-level-synchronization point of views. It might be acceptable in some sampling situations to get some inaccuracy due to lack of locking if it makes the data collection tool reasonably fast for real-life use (note that I am talking about "sampling", not event-based tracing here). So there are situations where adding locking will make the overhead prohibitive for sampling, but would be required for the perfect accuracy needed by RCU. So although the desire might not be to get inaccurate data, the actual desire to get it in a low-overhead fashion can lead to different decisions regarding the accuracy vs speed tradeoff. Thanks, Mathieu -- Mathieu Desnoyers Operating System Efficiency R&D Consultant EfficiOS Inc. http://www.efficios.com