Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1422788AbbD2JNY (ORCPT ); Wed, 29 Apr 2015 05:13:24 -0400 Received: from casper.infradead.org ([85.118.1.10]:59264 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1422769AbbD2JNT (ORCPT ); Wed, 29 Apr 2015 05:13:19 -0400 Date: Wed, 29 Apr 2015 11:13:05 +0200 From: Peter Zijlstra To: Andy Lutomirski Cc: "Brown, Len" , Andy Lutomirski , "linux-kernel@vger.kernel.org" , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo Subject: Re: [RFC] x86, perf: Add an aperfmperf driver Message-ID: <20150429091305.GP5029@twins.programming.kicks-ass.net> References: <2c37309d20afadf88ad4a82cf0ce02b9152801e2.1430256154.git.luto@kernel.org> <1A7043D5F58CCB44A599DFD55ED4C9484686CC03@fmsmsx115.amr.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1137 Lines: 24 On Tue, Apr 28, 2015 at 03:43:38PM -0700, Andy Lutomirski wrote: > On Tue, Apr 28, 2015 at 3:29 PM, Brown, Len wrote: > >> Thoughts? Would it make sense at all? Did I wire it up right? This is > >> the only PMU driver I've ever written, and it could have any number of > >> issues. > > > > APERF/MPERF, as with all per-thread MSRs, must be accessed > > from the local processor. I didn't see where this driver > > distinguishes the CPU. Also, I assume the intent is to return > > a snapshot, rather than sampling, yes? > > I think that the perf core takes care of that for us, but I'm not entirely sure. It does indeed. The events are always created/used in either task or cpu context, and in the case of task context they're context switched along, which again results in strict per cpu usage. Since this driver has no state to track nothing else is required. -- 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/