Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1274159imu; Tue, 20 Nov 2018 14:50:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/WMiHhgOWMwwC6wGQTFX4cfznZjkxL0VYSgraQ+O56/LZHLfknq8jZmbadCwgz+sVa2Nu2/ X-Received: by 2002:a17:902:9881:: with SMTP id s1-v6mr4060547plp.328.1542754241096; Tue, 20 Nov 2018 14:50:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542754241; cv=none; d=google.com; s=arc-20160816; b=lblnQJU1pWhiMi6dSNhyhXmGOoUomjYnJEhoTwFAPKZbgFOiQQFC68SvJ00HQvoCzx V0U3koi3vkza+VggBk8rb8pHQJPRtVKUu8mcsF7iJa5bDWLdZMd+iN6lMSUx6JOEom3+ UnAVU839eEWV/o0tJTo9gZX4wuUQB8yrulcAT/pyVZaIklfLL+C/jKz0i2SF/VrSTPIa j/2c5MkYhbL09xdFlX6m4mRHZP2yibA4/+zngq6tbji1PReg0F0hRCHYcf40iunYRtTd lYdEFMiWHP+ns9NJ9RpFfeMITn80kPdkXVOh23vtEfuVMBc/asOlCSChU0nhOFJyZ/5D tKZg== 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:dkim-signature; bh=SoppcZ4H3ZDInKleFzp7j+ay3HqLr+HiBj8M9YISW3w=; b=eNG+PSDyWUGHANRyoZ2FO/8INUXJ1oP0FQ62Gm5ehTuaDm0NAJCYm6OysSMU5lgCBr j3EtEAYaXiP1sMOXCmfr+4i4dryEMzWAMaZ8dzpezlJ2sRpdLPajTbUaMGyRiOvb4Mpo Z0CcZtNVGk852Beb1KA0aS9DJKU8px3re5DGjeDG8UMlfV/e+R2uzaAY+JrrD9hk0QeO vRT1Oj0tEeqmvApuR6C6at/CNoBcXjarXUMIeX9QdWxL6JDhoJTwTgUlR8a27YnsnGsh q/IUhXudrW5Ff/hWGznUzT6GVclKEReC/hvVzM2XJmRABiyLcDQfZpQgfxMaGdbkqorD oGPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=fWmGQxgq; 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 3si1097224plx.33.2018.11.20.14.50.25; Tue, 20 Nov 2018 14:50:41 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=fWmGQxgq; 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 S1726288AbeKUIsX (ORCPT + 99 others); Wed, 21 Nov 2018 03:48:23 -0500 Received: from merlin.infradead.org ([205.233.59.134]:35886 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726047AbeKUIsX (ORCPT ); Wed, 21 Nov 2018 03:48:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=SoppcZ4H3ZDInKleFzp7j+ay3HqLr+HiBj8M9YISW3w=; b=fWmGQxgqlHLPoSFsgr5uDfVUT MOyUbOki+fcM90UGLbDH8XpSqZIyoEzNepjwNiHrsWzgbcy3Y+FCFfLJjmc+s+RgqF7rTK02UrDac Rg0qlK0Sn9WZBnhzEOxfYgjCiJItsvF52erUNaa+YQy/8vEMqI3cqWL5TMvV7WZJHf1jWMg4OwwGV 4Fvt2CETfLChcZ19ySWCJm3usoOyQVxANFz7HCzNPkV4szp9/7TaLlnTTY4p58xu7gPlqNoRGsx9Q ph/txAeUkePhKqhZV9W5pwnZl4y4xDLcigk6ptt3G3CSEHYcAIpgRnFLDFEb2s5s3AnA8IyH9+ZK0 dsXbLSuCw==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.90_1 #2 (Red Hat Linux)) id 1gPEK7-0000GA-Q5; Tue, 20 Nov 2018 22:16:48 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id CFC6F2029FD58; Tue, 20 Nov 2018 23:16:42 +0100 (CET) Date: Tue, 20 Nov 2018 23:16:42 +0100 From: Peter Zijlstra To: Andi Kleen Cc: Kyle Huey , Kan Liang , 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: <20181120221642.GE2131@hirez.programming.kicks-ass.net> References: <20181120194129.GC13936@tassilo.jf.intel.com> <20181120201144.GD13936@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181120201144.GD13936@tassilo.jf.intel.com> 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 12:11:44PM -0800, Andi Kleen wrote: > > > > Given that we're already at rc3, and that this renders rr unusable, > > > > we'd ask that counter freezing be disabled for the 4.20 release. > > > > > > The boot option should be good enough for the release? > > > > I'm not entirely sure what you mean here. We want you to flip the > > default boot option so this feature is off for this release. i.e. rr > > should work by default on 4.20 and people should have to opt into the > > inaccurate behavior if they want faster PMI servicing. > > I don't think it's inaccurate, it's just different > than what you are used to. > > For profiling including the kernel it's actually far more accurate > because the count is stopped much earlier near the sampling > point. Otherwise there is a considerable over count into > the PMI handler. > > In your case you limit the count to ring 3 so it's always cut off > at the transition point into the kernel, while with freezing > it's at the overflow point. Ooh, so the thing does FREEZE_ON_OVERFLOW _not_ FREEZE_ON_PMI. Yes, that can be a big difference. See, FREEZE_ON_PMI, as advertised by the name, should have no observable effect on counters limited to USR. But something like FREEZE_ON_OVERFLOW will loose everything between the overflow and the eventual PMI, and by freezing early we can't even compensate for it anymore either, introducing drift in the period. And I don't buy the over-count argument, the counter register shows how far over you are; it triggers the overflow when we cross 0, it then continues counting. So if you really care, you can throw away the 'over-count' at PMI time. That doesn't make it more reliable. We don't magically get pt_regs from earlier on or any other state. The only thing where it might make a difference is if you're running multiple counters (groups in perf speak) and want to correlate the count values. Then, and only then, does it matter. Bah.