Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1048987imm; Wed, 8 Aug 2018 09:52:59 -0700 (PDT) X-Google-Smtp-Source: AA+uWPz335o8FuSD9mmuCPE7lF9UEX31L4gTgeXXKAn4OmGaP505oga+pzkPco2xkXVyIk+g3vTz X-Received: by 2002:a62:c819:: with SMTP id z25-v6mr3764605pff.44.1533747179145; Wed, 08 Aug 2018 09:52:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533747179; cv=none; d=google.com; s=arc-20160816; b=Pky4bU67vV7myxVUc8cnZ497XYnUjrztDpuwd9HeW0KPJOlA1m4sGRJ5ZUNGfh8y7w b16eY98MdwTFpfD2Tqe9R2aeA7Y1FRb840IopGofXfLaGPUbsd9BhaezlUrNCP9w3PBl kGvpOZY0HRSf5Z38gNBUTgOeKIDZxJk5X7Jl4+GVM3JHxZy8EZvqAAVOHlijRXzwMYMu dfXufxTaPq4tcm/2tIuZgbs6HuQCLCJZ8xtLKBLaYQh5CHTtqIDopa2qNVx9ntZZFLgB Is6IM8fWt+m+KVX3dwKKIr4SV2OnqJ7F2LgLuUJpUKBHZJHqiETQVXKOyOGe3eSl8umV YQkg== 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:arc-authentication-results; bh=FGVe8+ujNOGK5D57oWaolbm0gkaV9KvXJG1QImR4ChU=; b=qYYXMNZJghdysAJk7ZBLmysvO1950cKWffiTop/uX3cHs4WLpi1sa+Esv8CmC8Isev FsjhWNGTLA9BGK+iT1tVd2WVeuQWQ/DA7i1guJ1wUplWS/BirIMRv3zZ5+yK8ePwGk3A anexo9+O0E3gGLyWUUO29m9jF5u4Xb4ot4K2uziaDV4rHc/UmingLum19xem+SQ3wcYo MRVqKo5gAG3ttqKPe0W41IWZejE9e7/1XQECpdbICUQyV8jeKsV5A/EHHrDAKZZl2qzB 93zoBEWmLXrQR7zPPL5Y5qPmVD/VG7sbZJP8VTBwGwmFVeM074TjEPZgKffuXI9DmaO6 yvLg== 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 c27-v6si4777358pgc.11.2018.08.08.09.52.44; Wed, 08 Aug 2018 09:52:59 -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 S1727867AbeHHTM0 (ORCPT + 99 others); Wed, 8 Aug 2018 15:12:26 -0400 Received: from mga17.intel.com ([192.55.52.151]:5547 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727347AbeHHTM0 (ORCPT ); Wed, 8 Aug 2018 15:12:26 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Aug 2018 09:51:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,458,1531810800"; d="scan'208";a="60884020" Received: from rchatre-mobl.amr.corp.intel.com (HELO [10.24.14.134]) ([10.24.14.134]) by fmsmga007.fm.intel.com with ESMTP; 08 Aug 2018 09:51:47 -0700 Subject: Re: [PATCH 0/2] x86/intel_rdt and perf/x86: Fix lack of coordination with perf To: Peter Zijlstra , "Luck, Tony" Cc: "Hansen, Dave" , "tglx@linutronix.de" , "mingo@redhat.com" , "Yu, Fenghua" , "vikas.shivappa@linux.intel.com" , "Hindman, Gavin" , "Joseph, Jithu" , "hpa@zytor.com" , "x86@kernel.org" , "linux-kernel@vger.kernel.org" References: <57c011e1-113d-c38f-c318-defbad085843@intel.com> <20180806221225.GO2458@hirez.programming.kicks-ass.net> <08d51131-7802-5bfe-2cae-d116807183d1@intel.com> <20180807093615.GY2494@hirez.programming.kicks-ass.net> <3908561D78D1C84285E8C5FCA982C28F7D3A10EF@ORSMSX110.amr.corp.intel.com> <413c3b6f-770d-9549-4249-c2407267b63c@intel.com> <20180808074111.GM2494@hirez.programming.kicks-ass.net> <3908561D78D1C84285E8C5FCA982C28F7D3A1B83@ORSMSX110.amr.corp.intel.com> <20180808164722.GR2494@hirez.programming.kicks-ass.net> From: Reinette Chatre Message-ID: <8592e828-5a71-7331-ad2f-cc59abc8ba94@intel.com> Date: Wed, 8 Aug 2018 09:51:47 -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: <20180808164722.GR2494@hirez.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 8/8/2018 9:47 AM, Peter Zijlstra wrote: > On Wed, Aug 08, 2018 at 03:55:54PM +0000, Luck, Tony wrote: >>> So _why_ doesn't this work? As said by Tony, that first call should >>> prime the caches, so the second and third calls should not generate any >>> misses. >> >> How much code/data is involved? If there is a lot, then you may be unlucky >> with cache coloring and the later parts of the "prime the caches" code path >> may evict some lines loaded in the early parts. > > Well, Reinette used perf_event_read_local() which is unfortunately quite > a bit. But the inline I proposed is a single load and depending on > rdpmcl() or native_read_pmc() a call to or just a single inline asm > rdpmc instruction. > > That should certainly work I think. I am in the process of testing this variation. Reinette