Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1222038imu; Tue, 20 Nov 2018 13:48:26 -0800 (PST) X-Google-Smtp-Source: AFSGD/W8j3UqohFtOJJZv1R2QpoqJ3ZFwBl7lonKYfZG4L3ZaGJza+fRE0Rdz1KzFHQdG+MmM8jP X-Received: by 2002:a63:507:: with SMTP id 7mr444026pgf.411.1542750506902; Tue, 20 Nov 2018 13:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542750506; cv=none; d=google.com; s=arc-20160816; b=H1omESnBvCcxTemVhzs/z8N/8fDeemmRYIe7Cq/BzFfdu49mQtfbvERcwdpCLyU6Wh vyhL4q8qH4004VyTQkLR9logjacCsK9e9XDJ9hozoHb4b2/2amMzGPktmMvEC3WzpM6Z wwuv1rDPc/SczyEmPokg770Hd5aAYVAnFhUrQGWRKaNCD6XDJUU0uV1nT+0Umc9ddlPK +o9V+moivOCAonk7ctuktckXVmh/IzgpO4vNLVDg2imv168FjyvJV79cVue65kas4t/F oS/DHBUKzIveeFlgayxML/zHB8ssQMF9DxFXkJxxVnjC3EgAvAoV7GKHbL6MPMxFinao gJ1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=c4Mx4xoo0SOnqc8GkEhoqygnyA2JFl4/0RvL1igw+gs=; b=X4/MGxEeId4qyG4bQLYQlaC/I0tWbBxEy3GBxS1nnm1qENS09XNoP1lQKKDyvbjPuy lr8NjM3lbdgXq5KJvA5+MoVGt9rkZLQoyjootCBCGQmYW3DljI0c1ZOvvlKGk60gVCZ5 1xXEj/cM1tK1f1C1BwZ8n5rawXBgK0XlTxCtwpiJTYeg4auEwBZs/mDIOFT2NJtAlWUO 8PqwRY4Qa/zo0XR7mTTVctrN5d8BKxBNvnqavSmQAFWWfcYcT10I6SGMTZGelSbXP3Vt XVSbE4Js6wj+PRY0XVK4Bc/yXjVL96CqmtgElW0c6eijLFamgnRidjQVo0pOhAvc+v1e Qs4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kylehuey.com header.s=google header.b="Y/528pzZ"; 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 w6si4954522pfb.191.2018.11.20.13.48.11; Tue, 20 Nov 2018 13:48:26 -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=@kylehuey.com header.s=google header.b="Y/528pzZ"; 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 S1726158AbeKUIRx (ORCPT + 99 others); Wed, 21 Nov 2018 03:17:53 -0500 Received: from mail-vs1-f65.google.com ([209.85.217.65]:42825 "EHLO mail-vs1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbeKUIRx (ORCPT ); Wed, 21 Nov 2018 03:17:53 -0500 Received: by mail-vs1-f65.google.com with SMTP id b74so2017805vsd.9 for ; Tue, 20 Nov 2018 13:46:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kylehuey.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=c4Mx4xoo0SOnqc8GkEhoqygnyA2JFl4/0RvL1igw+gs=; b=Y/528pzZjps892DM9klEZqgYVl275V5S1qHOGcc2si0xaCIjEtNcNre1XbDzpPCLNH Bs3TN9oCOjP6Es9ZYOmrqaO7fFbK+qOboW4muV/QkvnNa+ltTJsJYNoCu1tUzms/PXJP 2GavqqGN23RLnLo4MNRcZgPXpWwapDGwVgdsrDbIZ61HKCjnZ0egdSumfQw1J+o96pYh WoJA2tDo2nGnpJWW4BFyQqHy49B7YOCRXBcezgFICurQ9Sc2tJNQYU42C/a7vV8v1dsI 4t0UNoXsek/+cdfjSxVVN3rvgCFNRY88tF5ob3QVGPdAN+yf6j61pGloMTAC7Z1XRo+Y f/Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=c4Mx4xoo0SOnqc8GkEhoqygnyA2JFl4/0RvL1igw+gs=; b=doYP9wBiNdC4fZzEHO/rJ2LySP0/SvyvaaEzVL9+xbpSLy9q6DKN2BwDyVIn5h3ws1 Z3RL1Jrx3SvAyIrlEcZtmjMIBbLLUNs687fbasONK41EfGofFKcVJyClrB2xENln04Fw rY4Ufom/HQsQ4dQ9Tr1HKkUFha831TwwQHiX54CapZ+mqbtxDenMnu/JFu3TN6tBnA1o A+X27g3Jv6np0dot7ogOpN0YHb/JzF710ueLRipR123nkGXZLeuKk5Qlne47AXGgKzWu k9oaZ4TeWZseiXWfpxDyDzlVwhxP9IB9II7VDDl08+zwh7WvZdsu+4jLDTGIEyu7gxf3 j92A== X-Gm-Message-State: AGRZ1gLXLMdXsHMf9+YFrB2ol/VIJgv3znUYsuXMj5d/Lhyjs+D/14fx WjUo4zgUpynaJrKX6nvWOFrWBP5LF/viXrXRHzFcyA== X-Received: by 2002:a67:6346:: with SMTP id x67mr1600973vsb.114.1542750396637; Tue, 20 Nov 2018 13:46:36 -0800 (PST) MIME-Version: 1.0 References: <20181120194129.GC13936@tassilo.jf.intel.com> <20181120201144.GD13936@tassilo.jf.intel.com> <20181120211803.GF13936@tassilo.jf.intel.com> In-Reply-To: <20181120211803.GF13936@tassilo.jf.intel.com> From: Kyle Huey Date: Tue, 20 Nov 2018 13:46:05 -0800 Message-ID: Subject: Re: [REGRESSION] x86, perf: counter freezing breaks rr To: Andi Kleen Cc: Kan Liang , "Peter Zijlstra (Intel)" , Ingo Molnar , "Robert O'Callahan" , Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa , Linus Torvalds , Stephane Eranian , Thomas Gleixner , Vince Weaver , acme@kernel.org, open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 20, 2018 at 1:18 PM Andi Kleen wrote: > > > I suppose that's fair that it's better for some use cases. The flip > > side is that it's no longer possible to get exactly accurate counts > > from user space if you're using the PMI (because any events between > > the overflow itself and the transition to the PMI handler are > > permanently lost) which is catastrophically bad for us :) > > Yes that's a fair point. For most usages it doesn't matter. > > I suspect that's a case for supporting opt-out for freezing > per perf event, and rr using that. I don't see how you could easily opt-out on a per perf event basis. If I'm reading the SDM correctly the Freeze_PerfMon_On_PMI setting is global and affects all counters on that CPU. Even counters that don't use the PMI at all will still be frozen if another counter overflows and counter freezing is enabled. It would seem that a counter that wants to use counter freezing and a counter that wants the behavior we want would be mutually exclusive. I suppose the kernel could handle all of that but it's a bit involved. - Kyle