Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933071AbcDYQpc (ORCPT ); Mon, 25 Apr 2016 12:45:32 -0400 Received: from mga09.intel.com ([134.134.136.24]:26387 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932696AbcDYQpb (ORCPT ); Mon, 25 Apr 2016 12:45:31 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,533,1455004800"; d="scan'208";a="91588695" Date: Mon, 25 Apr 2016 09:44:53 -0700 (PDT) From: Vikas Shivappa X-X-Sender: vikas@vshiva-Udesk To: Peter Zijlstra cc: Vikas Shivappa , tony.luck@intel.com, "Shankar, Ravi V" , "Yu, Fenghua" , vikas.shivappa@intel.com, x86@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com, tglx@linutronix.de, mingo@kernel.org, h.peter.anvin@intel.com Subject: Re: [PATCH 3/4] perf/x86/mbm: Fix mbm counting when RMIDs are reused In-Reply-To: <20160425091656.GF3430@twins.programming.kicks-ass.net> Message-ID: References: <1461371241-4258-1-git-send-email-vikas.shivappa@linux.intel.com> <1461371241-4258-4-git-send-email-vikas.shivappa@linux.intel.com> <20160425091656.GF3430@twins.programming.kicks-ass.net> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 950 Lines: 28 On Mon, 25 Apr 2016, Peter Zijlstra wrote: > On Fri, Apr 22, 2016 at 05:27:20PM -0700, Vikas Shivappa wrote: >> When multiple instances of perf reuse RMID, then we need to start >> counting for each instance rather than reporting the current RMID count. >> This patch adds a st_count(start count) per event to track the same. > > what? > Will fix the comit log : When multiple instances of perf reuse RMID for the same PID, then we need to start counting from zero for each new event, rather than reporting the current RMID. This patch adds a st_count(start count) per event to track the same. For ex: 1.RMID1's total_bytes is 100MB for event1(PID1) 2.another perf instance starts measuring the same PID1 with event2. We reuse RMID1 as the PID1 is already counted. 3.event2 stores st_count as 100MB. 4.After some time, when user wants to count event2 and say RMID1's current total_bytes 110MB, we report 110MB - 100MB = 10MB Thanks, Vikas