Received: by 10.223.185.111 with SMTP id b44csp75737wrg; Fri, 9 Mar 2018 01:12:43 -0800 (PST) X-Google-Smtp-Source: AG47ELtAXc/0EEMIoOq5imEQRL4lVM8HqNOUbE5E3ox/FiJy43M2jRq7ywpqLqOZVS/e9Kd69eQ5 X-Received: by 10.101.73.141 with SMTP id r13mr23614996pgs.161.1520586762998; Fri, 09 Mar 2018 01:12:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520586762; cv=none; d=google.com; s=arc-20160816; b=wnMOx6GMYj0YNiXQiC9uBKoOaYEjpO+XSfqeGJYtNv1lbJT/BlwCuCK+jS9djlpBOX cEcT94cp+7tBq202aKz9UsxWAFmFMSlmGZ4w0TgvUdhXqKWJvgOz6suSMYUoqO1Swu/1 tLPV78tSBbA4P9Lm28GNGxt7ANgfGE5KHERUcWayJeZMXrWs/wqsl2x/pQYHobYoqidV oqPdtFQjC6cJA5MJQr+G97QVlpJZmIlxbxPWz4kIBD41/ZyHF7w161RFNcV0F0JYUh4d TkeLSt8dMXv6/d2m1ONPidw5sXzemK9Ll1QXqEAViwQQkEycVZlyKxyW7Tofp/pYgkzw YSSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=2a5N1AiPR790VaU2Msxf4O+/ZwRYbbGiqK7LM4N3Dno=; b=FS44E/iLPflOYlPp/EpixN7DazJ1x2tgxNAuvaizJptC/mCNpi1mrueWLZjip+wVnX NM2ocAufW8vEcqPdHtAyczU/dHlkS7nXzZZCzvgc+ycCNTy6ULaEmjrzid6ERahslvQw LGSO6o7DSKeZe5fyn17mEuQ8xLUSmzhEnWnBFiWtMQt1iV9mwZu5ywex4ZHdq8vRkmux +8Fq6JwwTPWqP5Bg5K8E8SNstsnQpdzpHMJpGHilDUWmdiFI/L+LLexv3vhf7F/zQZZR DXd3YCIrf5cRBGRQ8NpRi3fZaRjfVxIODyLLMlk5Qvfn8zC+ni6fRAxHotdqrVycz860 rT9Q== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p20-v6si530525plo.643.2018.03.09.01.12.28; Fri, 09 Mar 2018 01:12:42 -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; 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 S1751877AbeCIJLK (ORCPT + 99 others); Fri, 9 Mar 2018 04:11:10 -0500 Received: from terminus.zytor.com ([198.137.202.136]:43979 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751258AbeCIJLI (ORCPT ); Fri, 9 Mar 2018 04:11:08 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w299Akf3032154; Fri, 9 Mar 2018 01:10:46 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w299AkNm032151; Fri, 9 Mar 2018 01:10:46 -0800 Date: Fri, 9 Mar 2018 01:10:46 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Kan Liang Message-ID: Cc: jolsa@redhat.com, mingo@kernel.org, acme@redhat.com, alexander.shishkin@linux.intel.com, hpa@zytor.com, eranian@google.com, torvalds@linux-foundation.org, kan.liang@linux.intel.com, tglx@linutronix.de, linux-kernel@vger.kernel.org, peterz@infradead.org, vincent.weaver@maine.edu Reply-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 In-Reply-To: <1518474035-21006-6-git-send-email-kan.liang@linux.intel.com> References: <1518474035-21006-6-git-send-email-kan.liang@linux.intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf/x86/intel: Disable userspace RDPMC usage for large PEBS Git-Commit-ID: 1af22eba248efe2de25658041a80a3d40fb3e92e X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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;