From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB95AC4332B for ; Wed, 18 Mar 2020 20:43:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BFEF520773 for ; Wed, 18 Mar 2020 20:43:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ailZOps1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726971AbgCRUnT (ORCPT ); Wed, 18 Mar 2020 16:43:19 -0400 Received: from merlin.infradead.org ([205.233.59.134]:42300 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726647AbgCRUnT (ORCPT ); Wed, 18 Mar 2020 16:43:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=oGlJP/cmQF74W01lZDvZS2p/EZnU4amRSfPq9wPSqKo=; b=ailZOps1Hhs1hW9bDTEgiRDWay CJaNiGMFz4rag/E5zoMPMrXJVbBheUXhO7RccSK4AV+GYXMvZp1TQpPdKOQg3uNLxYEJlLwRsCTM+ nKOIhFRw2txYwRbdizMlmUIn2hv3t5pC21BLzulGFujEoKwF41BmkKdxa2GPyN29LLagPA1Lmf8bb m9tPny7VpgDE4h+KjSZiicn9PT+e3HIFefRBBO1Yn2MhCIVxrlSpDnCQWccDXK5zpRxN/vZwDJHq1 YrMu/+R2vKajEMh0A6yprxRp1r/6pvIFegrnLpOk8elrcEqHQAuLd2E5vLBvS7blnSDNFMdWu0O7I BCc+obkg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1jEfWm-0003uQ-Jb; Wed, 18 Mar 2020 20:43:00 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id C0A9530047A; Wed, 18 Mar 2020 21:42:57 +0100 (CET) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id B29452038CEEB; Wed, 18 Mar 2020 21:42:57 +0100 (CET) Date: Wed, 18 Mar 2020 21:42:57 +0100 From: Peter Zijlstra To: Kim Phillips Cc: Stephane Eranian , Ingo Molnar , Ingo Molnar , Thomas Gleixner , Borislav Petkov , Alexander Shishkin , Arnaldo Carvalho de Melo , "H. Peter Anvin" , Jiri Olsa , Mark Rutland , Michael Petlan , Namhyung Kim , LKML , x86 Subject: Re: [PATCH 1/3 v2] perf/amd/uncore: Prepare L3 thread mask code for Family 19h support Message-ID: <20200318204257.GL20730@hirez.programming.kicks-ass.net> References: <20200313231024.17601-1-kim.phillips@amd.com> <2581de5a-969b-93c7-0565-2eef51717900@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2581de5a-969b-93c7-0565-2eef51717900@amd.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 18, 2020 at 09:46:41AM -0500, Kim Phillips wrote: > > But this does not work with the cpumask programmed for the amd_l3 PMU. This mask > > shows, as it should, one CPU/CCX. So that means that when I do: > > > > $ perf stat -a amd_l3/event=llc_event/ > > > > This only collects on the CPUs listed in the cpumask: 0,4,8,12 .... > > That means that L3 events generated by the other CPUs on the CCX are > > not monitored. > > I can easily see the problem by pinning a memory bound program to > > CPU64, for instance. > > Right, the higher level code calls the driver with a single cpu==0 > call if the perf tool is invoked with a simple -a style system-wide. > If the tool is invoked with supplemental switches to -a, like -C 0-255, > and -A, the driver gets called multiple times with all the unique cpu > values. The latter is the expected invocation style when measuring > a benchmark pinned on a subset of cpus, i.e., when evaluating > the driver, and is the more deterministic behaviour for the driver > to have, given it cannot tell the difference otherwise. That seems to suggest it is all horribly broken.