Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1139947imm; Thu, 6 Sep 2018 16:26:00 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYUVUfkjLPk5GRZGSLjceHg4xs7CLqCPFKJTznmVn/yu4NLRHV3/MvJCwc2TWzRl9971pGm X-Received: by 2002:a63:4826:: with SMTP id v38-v6mr5296034pga.379.1536276360073; Thu, 06 Sep 2018 16:26:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536276360; cv=none; d=google.com; s=arc-20160816; b=byXwg9JGcof7ogzBHUlGkEgoEK5JLZEh8u75rqpWP31nVpezjMdPO3kkmfMFQ6OOez DR2wr3ECUXCKBidBH3wBCGji4+V3kyJFxkjptgd/6kgF0qJLJteeizk0YvivQFFG9x0g f9AHBegfu+qAxjoq8YSg2TEMsY5F5xnSDIt+bES5LdA26ua4QznFQBpdHjGu99CmXVUi a686CKEgfU8Tad2gD1ExF84GEFbiNU+LOOwBRc045dq79fIkaIOkUVGUUV2gzIRIM17E 3lEMQXUMuP1Nw3Mag3a1qhC40FW/cqwIzgj9dwuEwBFM0qUl8RQv6cOQh10gTOIY6Ar7 Vh6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=YwIVDT0gBoB/uQoFJcQBXDYMb744gpwldTE4IzQgEK4=; b=zRfhApnr3fsPxMKihJfWzv7Vv2hbW3jo1ZmdFgdfa2BidJBwGvxKXQbwAnrx6Hv55x jUGpnDLSyXZqtRxT0tcVBSCNlTHdqi5tWoRV+JqG9P7LjoUt0ePQ59TU0RerKbwLnIAS dJItUqdetFg7soHARJDu09joAtBIuqhhVZNh+QAhzXdWrM+qsTAnIWa0V+RbwhitsDiX Hc8RXpuUqEh7GzyRlcv9j8CZwqtyUip7LVSKQwTJa+EPzYTt/laWwMck7pYE51bVV/Aw 9ygw+N9zEPVrt02g8Zyk1tj7ALDxxMRRoLOiJzxKtsUc0imad0ERg0vOeJ4qVU7+6waR rDpg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y193-v6si6220821pgd.512.2018.09.06.16.25.44; Thu, 06 Sep 2018 16:26:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729987AbeIGBOh (ORCPT + 99 others); Thu, 6 Sep 2018 21:14:37 -0400 Received: from mga02.intel.com ([134.134.136.20]:28857 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbeIGBOg (ORCPT ); Thu, 6 Sep 2018 21:14:36 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Sep 2018 13:37:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,339,1531810800"; d="scan'208";a="89607092" Received: from rchatre-mobl.amr.corp.intel.com (HELO [10.24.14.122]) ([10.24.14.122]) by orsmga002.jf.intel.com with ESMTP; 06 Sep 2018 13:37:14 -0700 Subject: Re: [PATCH V2 5/6] x86/intel_rdt: Use perf infrastructure for measurements To: Peter Zijlstra Cc: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com, mingo@redhat.com, acme@kernel.org, vikas.shivappa@linux.intel.com, gavin.hindman@intel.com, jithu.joseph@intel.com, dave.hansen@intel.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org References: <30b32ebd826023ab88f3ab3122e4c414ea532722.1534450299.git.reinette.chatre@intel.com> <20180906141524.GF24106@hirez.programming.kicks-ass.net> <40894b6f-c421-32fb-39c3-3dddbed5aa91@intel.com> <20180906194441.GA9358@worktop.programming.kicks-ass.net> <2465aa4d-fa84-cb0c-082a-15240472b349@intel.com> <20180906202943.GE9358@worktop.programming.kicks-ass.net> From: Reinette Chatre Message-ID: <12da3ce5-710b-b18e-8c0c-a0aa3724afd2@intel.com> Date: Thu, 6 Sep 2018 13:37:14 -0700 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180906202943.GE9358@worktop.programming.kicks-ass.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/6/2018 1:29 PM, Peter Zijlstra wrote: > On Thu, Sep 06, 2018 at 01:05:05PM -0700, Reinette Chatre wrote: >> When I separate the above into the two functions it just becomes either: >> rdpmcl(l2_hit_pmcnum, l2_hits_after); >> rdpmcl(l2_miss_pmcnum, l2_miss_after); >> or: >> rdpmcl(l3_hit_pmcnum, l3_hits_after); >> rdpmcl(l3_miss_pmcnum, l3_miss_after); >> > > Right, which is the exact _same_ code, so you only need a single > function. > From my understanding it is not this code specifically that is causing the cache misses but instead the code and variables used to decide whether to run them or not. These would still be needed when I extract the above into inline functions. Reinette