Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2184105imu; Thu, 10 Jan 2019 09:37:27 -0800 (PST) X-Google-Smtp-Source: ALg8bN7zAUG4PJk+TAOHh9A/pLS/G9eHJ/NlrZWSvc/cMyPkudsYIpmVibQTFGKaSOyjXtU42IbF X-Received: by 2002:a63:4d66:: with SMTP id n38mr7988870pgl.270.1547141847497; Thu, 10 Jan 2019 09:37:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547141847; cv=none; d=google.com; s=arc-20160816; b=CK7YXtwU13W7IDmtHu/7hJGeIzfc/0F56AEboVnh3okbZTSr7KkZ//JEXoP6nd5Lsm /8m6FJIrQpxN5D/oIfBuSAUKuny6XKEWKjfxiFtxS709QfbK08Hhh3gR4rDwXNCkkvVT aBWGl2ZUcdQUSlhFWeHoOWQHUryxPG56tFoK3JobZMZ+zqgrwq72xSrCoJ0H4/GXWZEp x5YUsw+AJDPeldSdTdDHgQvBP5feHzSYlla7jgEAYeNG4uGglIJMlZavCStj3+FkFE0e Ui+HqTHobcQvsGDTiU3Y1ELlH2IWZCur6iv+OhGHSPghq4//ZiPNsTKYFRSWghl4jw6f hnuw== 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:message-id :subject:cc:to:date:from:dkim-signature; bh=o6qUe06YqHQTyRo2Af+8txW+aEDBqL66YmFXoMwGjWY=; b=ZrgOp8SYxXMEklhCDzemvoBy/LEJh2h1a6/7zcAqS/PUu9XUj9p6bYq1HOp4DgICux MckPjyISnNm+MtYTs0BpOcZlUlwaij3haBFtqrRdDc+Zi1ylOBPAfcbd/sUMoiQnIusl irMdl6YH9OJpA09tHQNmVRqDc7cD4Riq0+6tXPjDShro80aHShfQ0sAUcE/JRUQYtI+D uV71MpHGH27ftu5tpJY6QRtlhLG8Qn0adlVmxjRBY+wnnsn1sG9auc8tQQjnz8Ys8xno t1CzVSO9intZj7RCsLrBxK//dsUgykJpAhWZ+wG+153kemHkIQwJwbi1koxTDQ0XMrin OWiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b=GEqBY4dV; 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 a3si3589418pga.297.2019.01.10.09.37.12; Thu, 10 Jan 2019 09:37:27 -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=GEqBY4dV; 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 S1730607AbfAJRfS (ORCPT + 99 others); Thu, 10 Jan 2019 12:35:18 -0500 Received: from mail-qt1-f171.google.com ([209.85.160.171]:34160 "EHLO mail-qt1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729918AbfAJRfS (ORCPT ); Thu, 10 Jan 2019 12:35:18 -0500 Received: by mail-qt1-f171.google.com with SMTP id r14so14231451qtp.1 for ; Thu, 10 Jan 2019 09:35:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maine.edu; s=google; h=from:date:to:cc:subject:message-id:user-agent:mime-version; bh=o6qUe06YqHQTyRo2Af+8txW+aEDBqL66YmFXoMwGjWY=; b=GEqBY4dVG+au7h3k/qeJtwlrSHRQVwvvL8SNGbzFHpTIjV/L+A5Q5MO1qQQaFeJ0LP ic/6GDzq7YTh6JL41/+Wl5kAcuV8F5TPt6gePdCguJR0lCVxqaqH6HtKS15stiQjBaH7 KilDG+BKe9FIn9pPQskziEn5ZjqqNbXn/YRqg= 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:message-id:user-agent :mime-version; bh=o6qUe06YqHQTyRo2Af+8txW+aEDBqL66YmFXoMwGjWY=; b=eLyaZHN1FFsqOfKftuoBus6IO5WbSZmCYsMH048rMdsgb73svjStCdwLDgQ84GT1Rr vzDJRBseMmSWE/N2o3Z18HIykZHBM+hb4v4EWcOTarirswVLR4NxVEEDb+lVgHrVyYKC YJGwUfyzyDNOZLYtIzZNsJceOx2YP4S5H2z1PoU7xwX5eyi/9P/OumWd+aYEgURRVSU9 PtrA9GUYQJh1erOjvsTRzpGb1UKgKWaiA0U3lVwEy389Nz7o6s5My+TXaMwYmSiZOeLK zU0y8LPmpQXCUj4pGXPEvReBB+FIBGvi6zoHlLNCoLa0ofc02575X8MZSk12HACYaVoF Ctwg== X-Gm-Message-State: AJcUukcWfJc+g+lbbvSvnhVbXDahb6pFq7aXl/QJFM/OXF7MBLzYN92P etRAHbvWYDX3KsYf9gW5QuTMtTWLgv8= X-Received: by 2002:a37:8107:: with SMTP id c7mr9698660qkd.77.1547141717041; Thu, 10 Jan 2019 09:35:17 -0800 (PST) Received: from macbook-air (weaver.eece.maine.edu. [130.111.218.23]) by smtp.gmail.com with ESMTPSA id y4sm44959932qtc.47.2019.01.10.09.35.15 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 10 Jan 2019 09:35:16 -0800 (PST) From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Thu, 10 Jan 2019 12:35:12 -0500 (EST) X-X-Sender: vince@macbook-air To: Peter Zijlstra cc: linux-kernel@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo Subject: perf: rdpmc bug when viewing all procs on remote cpu Message-ID: 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 Hello I think this is a bug turned up by PAPI. I've been trying to track down where this happens in the perf_event code myself, but it might be faster to just report it. If you create a per-process attached to CPU event: perf_event_open(attr, 0, X, -1, 0); the mmap event index is set to "0" (not available) on all cores but the current one so the rdpmc read code can properly fall back to read(). However if you create an all-process attached to CPU event: perf_event_open(attr, -1, X, -1, 0); the mmap event index is set as if this were a valid event and so the rdpmc succeeds even though it shouldn't (we're trying to read an event value on a remote cpu with a local rdpmc). so I think somehow in the perf_event_open pid=-1 case rdpmc is not getting blocked properly... Vince