Received: by 10.223.185.111 with SMTP id b44csp377802wrg; Fri, 9 Mar 2018 06:32:32 -0800 (PST) X-Google-Smtp-Source: AG47ELvEfb61l99BdjXgO3U4nyjyFU7w2ORpy4HGW/VvvTCE1H4g6/EGBdVHf5Trejgrj4wXGNm6 X-Received: by 10.99.3.6 with SMTP id 6mr5103109pgd.5.1520605952302; Fri, 09 Mar 2018 06:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520605952; cv=none; d=google.com; s=arc-20160816; b=Q3yy8gtSyxPkYPqWsWyoiSbaSHp268CGrtEWH1Q5A2Y6JUk2o4BkTjwykwGoWCuriF 0Lh6udQm2wBY44e5xjhvw89m5foWdffgPr5JYpdhQ7aqzCbGnVZaW9ngudMsJQDEPPlF 1G9bcYgMBi+SXOCIgbIEQldHbcUN4cMSjnYox5UyybswmktHaapBf7ObB1Vin0Yr5vRu 2GncQK8w2tCKOxIRojkT+jwa0Sn6ry9iIxp+PkIM7rrRpGdAyvjAjxwIiu2RjOtrdWxM l3oeQdWJxosh6zc4b5i4AyFP/MLaHsLWaEL8VocJGrLIuq6LLu7lb3yNW52sPCaOzTbY 4x4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:date:from:dkim-signature :arc-authentication-results; bh=0RUYMAyv7l0AeqmyhS8rDCpxEGCQFiQ2oOgh2icb3bk=; b=OmFlkW2pIzZSd6H3DIB2qsPbWq/qQiPxYHQLg/sAE1kzyrTjyNe2XYgG3J1vV2Ov7r RbroWJWjcjApToUQB14jCBUFr5olNeX104AV27YWLcRUf2/GQulWoPB3kAhrvaJXvX7k rJGt29w4GEKzteI1Wvacd91WICtJjoSqjnTSin14LCI8TrNES+6vuXxPRqYL6JDSMCRT JAuEbY0SmOQONnHoZ5i8RF9RFOEL5JOXRvsYX3fETvEybVmF/WXbxZg5dlk5EDChprBm DYkXu/pk42TaNpGY0iVFtHwOXb4BfFZaNFob0BAUH67uBsZ4N8qBN/psQTIYgk0c6LCB 9MWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=JpaTXDRl; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h67si788244pgc.324.2018.03.09.06.32.17; Fri, 09 Mar 2018 06:32:32 -0800 (PST) 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; dkim=pass header.i=@maine.edu header.s=google header.b=JpaTXDRl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932076AbeCIObS (ORCPT + 99 others); Fri, 9 Mar 2018 09:31:18 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:33193 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751068AbeCIObR (ORCPT ); Fri, 9 Mar 2018 09:31:17 -0500 Received: by mail-it0-f66.google.com with SMTP id w19-v6so2868015ite.0 for ; Fri, 09 Mar 2018 06:31:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maine.edu; s=google; h=from:date:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=0RUYMAyv7l0AeqmyhS8rDCpxEGCQFiQ2oOgh2icb3bk=; b=JpaTXDRlax1g6kgV35zQGA/YZcpTzAeuWe0PrA3RmUUTNZYKfSVmQLubmSuWvwCPQN 2ODWFUO4sXjQJJHK08BozAdkdDH6F9HZI09D3p823aihrusEX21HPjZXmC0JEGsuTrlp iZtMmO9uqV+vbJTaPa33xeReGdj+ofxX2x7IE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=0RUYMAyv7l0AeqmyhS8rDCpxEGCQFiQ2oOgh2icb3bk=; b=SbGtURC1tPCbHvbqEYa73XROOD2Ew6b2o6HNvWb3QHwRhLeaQpr/GRjcspH63Q1hJK wUcBMdshKh0dex/4SHUZx7XvT7WbrUtXHmrMmyLXa+X+Z/LGfww6dKQwdWw08mq3PEIs yyce9qosxFy4buX89aKyGtGzzSQgvMUN979Y60jVXlXELBvsSlkFB7qJrRjGT/O6Go7U fH70ifo6v0qFQae977JeRvfEnkN8I5tUBmei95tIveu13291MrpnezYaV17ZT6yiOnIo 5pu6sY/HS3qrHNCeSc4hr5abg9yDcR20csv+XMZpU76S8sRd3nA7chdmmjft29jC+bdu uqLQ== X-Gm-Message-State: AElRT7G4+MlZ16eAr2l3gLt9Ru8I79ZkcdxRNuTQpv6KdVA8UMvDpen9 Ik9E5ejZTB3E5InAzH9/yxhI9g== X-Received: by 10.36.41.67 with SMTP id p64mr3590476itp.123.1520605876616; Fri, 09 Mar 2018 06:31:16 -0800 (PST) Received: from macbook-air (weaver.eece.maine.edu. [130.111.218.23]) by smtp.gmail.com with ESMTPSA id e95sm959180iod.46.2018.03.09.06.31.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Mar 2018 06:31:15 -0800 (PST) From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Fri, 9 Mar 2018 09:31:11 -0500 (EST) X-X-Sender: vince@macbook-air To: kan.liang@linux.intel.com, vincent.weaver@maine.edu, linux-kernel@vger.kernel.org, peterz@infradead.org, tglx@linutronix.de, torvalds@linux-foundation.org, eranian@google.com, acme@redhat.com, hpa@zytor.com, alexander.shishkin@linux.intel.com, mingo@kernel.org, jolsa@redhat.com cc: linux-tip-commits@vger.kernel.org Subject: Re: [tip:perf/core] perf/x86/intel: Disable userspace RDPMC usage for large PEBS In-Reply-To: Message-ID: References: <1518474035-21006-6-git-send-email-kan.liang@linux.intel.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 9 Mar 2018, tip-bot for Kan Liang wrote: > Commit-ID: 1af22eba248efe2de25658041a80a3d40fb3e92e > Gitweb: https://git.kernel.org/tip/1af22eba248efe2de25658041a80a3d40fb3e92e > Author: Kan Liang > AuthorDate: Mon, 12 Feb 2018 14:20:35 -0800 > Committer: Ingo Molnar > CommitDate: Fri, 9 Mar 2018 08:22:23 +0100 > > perf/x86/intel: Disable userspace RDPMC usage for large PEBS > So this whole commit log is about disabling RDPMC usage for "large PEBS" but the actual change disables RDPMC if "PERF_X86_EVENT_FREERUNNING" Either the commit log is really misleading, or else a poor name was chosen for this feature. Vince > Userspace RDPMC cannot possibly work for large PEBS, which was introduced in: > > b8241d20699e ("perf/x86/intel: Implement batched PEBS interrupt handling (large PEBS interrupt threshold)") > > When the PEBS interrupt threshold is larger than one, there is no way > to get exact auto-reload times and value for userspace RDPMC. Disable > the userspace RDPMC usage when large PEBS is enabled. > > The only exception is when the PEBS interrupt threshold is 1, in which > case user-space RDPMC works well even with auto-reload events. > > Signed-off-by: Kan Liang > Signed-off-by: Peter Zijlstra (Intel) > Cc: Alexander Shishkin > Cc: Arnaldo Carvalho de Melo > Cc: Jiri Olsa > Cc: Linus Torvalds > Cc: Peter Zijlstra > Cc: Stephane Eranian > Cc: Thomas Gleixner > Cc: Vince Weaver > Cc: acme@kernel.org > Fixes: b8241d20699e ("perf/x86/intel: Implement batched PEBS interrupt handling (large PEBS interrupt threshold)") > Link: http://lkml.kernel.org/r/1518474035-21006-6-git-send-email-kan.liang@linux.intel.com > Signed-off-by: Ingo Molnar > --- > arch/x86/events/core.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c > index 00a6251981d2..9c86e10f1196 100644 > --- a/arch/x86/events/core.c > +++ b/arch/x86/events/core.c > @@ -2117,7 +2117,8 @@ static int x86_pmu_event_init(struct perf_event *event) > event->destroy(event); > } > > - if (READ_ONCE(x86_pmu.attr_rdpmc)) > + if (READ_ONCE(x86_pmu.attr_rdpmc) && > + !(event->hw.flags & PERF_X86_EVENT_FREERUNNING)) > event->hw.flags |= PERF_X86_EVENT_RDPMC_ALLOWED; > > return err; >