From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752758AbdBGAdb (ORCPT ); Mon, 6 Feb 2017 19:33:31 -0500 Received: from mail-vk0-f53.google.com ([209.85.213.53]:35851 "EHLO mail-vk0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752172AbdBGAda (ORCPT ); Mon, 6 Feb 2017 19:33:30 -0500 MIME-Version: 1.0 In-Reply-To: <3908561D78D1C84285E8C5FCA982C28F3A2AD7AF@ORSMSX114.amr.corp.intel.com> References: <1484879563-29977-1-git-send-email-vikas.shivappa@linux.intel.com> <3908561D78D1C84285E8C5FCA982C28F3A2A8947@ORSMSX114.amr.corp.intel.com> <3908561D78D1C84285E8C5FCA982C28F3A2AD68D@ORSMSX114.amr.corp.intel.com> <3908561D78D1C84285E8C5FCA982C28F3A2AD7AF@ORSMSX114.amr.corp.intel.com> From: David Carrillo-Cisneros Date: Mon, 6 Feb 2017 16:33:27 -0800 Message-ID: Subject: Re: [PATCH 00/12] Cqm2: Intel Cache quality monitoring fixes To: "Luck, Tony" Cc: Thomas Gleixner , Vikas Shivappa , "Shivappa, Vikas" , Stephane Eranian , linux-kernel , x86 , "hpa@zytor.com" , Ingo Molnar , Peter Zijlstra , "Shankar, Ravi V" , "Yu, Fenghua" , "Kleen, Andi" , "Anvin, H Peter" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 6, 2017 at 3:27 PM, Luck, Tony wrote: >> cgroup mode gives a per-CPU breakdown of event and running time, the >> tool aggregates it into running time vs event count. Both per-cpu >> breakdown and the aggregate are useful. >> >> Piggy-backing on perf's cgroup mode would give us all the above for free. > > Do you have some sample output from a perf run on a cgroup measuring a > "normal" event showing what you get? # perf stat -I 1000 -e cycles -a -C 0-1 -A -x, -G / 1.000116648,CPU0,20677864,,cycles,/ 1.000169948,CPU1,24760887,,cycles,/ 2.000453849,CPU0,36120862,,cycles,/ 2.000480259,CPU1,12535575,,cycles,/ 3.000664762,CPU0,7564504,,cycles,/ 3.000692552,CPU1,7307480,,cycles,/ > > I think that requires that we still go through perf ->start() and ->stop() functions > to know how much time we spent running. I thought we were looking at bundling > the RMID updates into the same spot in sched() where we switch the CLOSID. > More or less at the "start" point, but there is no "stop". If we are switching between > runnable processes, it amounts to pretty much the same thing ... except we bill > to someone all the time instead of having a gap in the context switch where we > stopped billing to the old task and haven't started billing to the new one yet. Another problem is that it will require a perf event all the time for timing measurements to be consistent with RMID measurements. The only sane option I can come up is to do timing in RDT the way perf cgroup does it (keep a per-cpu time that increases with local clock's delta). A reader can add the times for all CPUs in cpu_mask. > > But if we idle ... then we don't "stop". Shouldn't matter much from a measurement > perspective because idle won't use cache or consume bandwidth. But we'd count > that time as "on cpu" for the last process to run. I may be missing something basic but isn't __switch_to called when switching to the idle task? that will update the CLOSID and RMID to whatever the idle task in on, isnt it? Thanks, David