Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1278096imu; Tue, 20 Nov 2018 14:56:00 -0800 (PST) X-Google-Smtp-Source: AFSGD/UzgShS3lXkPKrmzANOl4l2wJVTfmBaJEpC44RFZ2XtIP8gPGjt9KKK4OP0F19iX6qbI8Ym X-Received: by 2002:a63:1b48:: with SMTP id b8mr3687992pgm.187.1542754560033; Tue, 20 Nov 2018 14:56:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542754560; cv=none; d=google.com; s=arc-20160816; b=0WrOxFh/Laqt6Xwgqdo5Hqe03Rq+tTbwKQQnQ99JAEqobWLiE7XFyEd2fwBQQVSvNY MOA6MbbXYUZV3AO6jd26GIsOWMOaLZhpkFJQg4oSgn3Bni/tjud5M+MWWHbHQ90gQwbb 8OPe+oV9VEhJRhAgWFg+erkQ7rl4s61pSHLJ2l9qbDPySRQxc5R2fulKOCs2m1IalryF gBk25gKwmmpFN1rszlVNzTqrVUDiR+nZwYVCkBxOjlDSRmD0dSx835Kw4K7d6qBjPhHa Z4zf50ziwr/g34EjdXRkNXNuX6O5sRpADReW9hi4u9Sd0nSA34j45CHX/GFUAyBfFdKN h1Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=G1vDOuaxk8m4Fz2E+5AzsL5IehPnNqea5lYuwBy8nfY=; b=e9G5wrW+nXra5gMVojgQdDVSOU03qwFbundumH/5HRPfEDgeQYnGb6KLGwYeyATBue Vxt2tTD96MI1spcUJyksWbdGVocxG3ZMIFpF0UBYzm9iPm1cs/pBdE0jlbCdS6zw6Vh6 7TKxvPJ3ctCGgLmGOVJs36/5yEW60rVqUYhti+1UXkE3mwFlNMJ9M5yvmiZ/nJQ2+yhR lQoS6uj+oBXsQ0Z+ADQ5pKceAHdxwfolTW0LsdU/fvWQ90X/vnF82eDNtMgglCftk8x8 fPH3W87BZtO/yNCXy7+8gEUU4cdk5u6eNHs70ihKj2lsXWZAIuRWP+seN/jnXnySEYhe SHgg== 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 11si43098508pgs.126.2018.11.20.14.55.44; Tue, 20 Nov 2018 14:55:59 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726434AbeKUIuZ (ORCPT + 99 others); Wed, 21 Nov 2018 03:50:25 -0500 Received: from mga07.intel.com ([134.134.136.100]:56487 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726105AbeKUIuY (ORCPT ); Wed, 21 Nov 2018 03:50:24 -0500 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 20 Nov 2018 14:19:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,258,1539673200"; d="scan'208";a="109807369" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.126]) by fmsmga001.fm.intel.com with ESMTP; 20 Nov 2018 14:19:01 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id B564C3018C4; Tue, 20 Nov 2018 14:19:01 -0800 (PST) Date: Tue, 20 Nov 2018 14:19:01 -0800 From: Andi Kleen To: Kyle Huey 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 Subject: Re: [REGRESSION] x86, perf: counter freezing breaks rr Message-ID: <20181120221901.GG13936@tassilo.jf.intel.com> References: <20181120194129.GC13936@tassilo.jf.intel.com> <20181120201144.GD13936@tassilo.jf.intel.com> <20181120211803.GF13936@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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 01:46:05PM -0800, Kyle Huey wrote: > 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. Yes it's a per CPU setting. You wouldn't be able to opt-in. If anyone opts out on a CPU it would be disabled on that CPU while that event is active. -Andi