Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1199547imu; Tue, 20 Nov 2018 13:23:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/XRXAywb0rEJxfUwxatjPWDhNjvfyxtgzlNLX4iz7844lZglhoXXSOZJMbx7Lq5J4DDn/c6 X-Received: by 2002:a17:902:9a91:: with SMTP id w17-v6mr3769247plp.274.1542748996759; Tue, 20 Nov 2018 13:23:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542748996; cv=none; d=google.com; s=arc-20160816; b=DHZpdl/NwFftNAa4skV9Tt4ojQRlSeGQyywFodwBSlfKV+ibm8Eyt7XI8w5RQtar/c iCo0TuXKXsk6xK51aEd859ArHrVy5V2z36gucvko5knHKEAB+Jj55B5crt+cvOCIetYZ QY/WVGjHowiqk/Hruz9zZzR05GwhitPWe2tEKYTRL3tP9CD9rPP4XpJFGLBiJ2FlNi/7 4BGoQ+iB2AJC4X4J0dIHSBlJcr1ZA5wdoJWx6dFeXByzQ9uNDaFX7h1659bR9Gr1Bo9W /RtJKYRyl9KkP3NNPbKLMOxflOMRNokxJ2aprJaq3qhNAF7ebw2QGyf3HuLqSPjgtapT 9B7A== 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=wKk1mDC16JJ9caAL5YFzkAgYBMKvbRSypLiP/vbYkLA=; b=MsSe2u9/3bKHSDXQbgIz6UtQ5Qgu2VmMRj3esWUgVSM3f64CMHu3adGFZTjIEH/DFI zH9XVCbpgZQrEGc3tgyOZ7h5GHMmHzlyZKtVXSEKDeNqv0KKQd96BYJdTVJJ/eqhSBO1 qZfk3Qnt3EI7zq4X5zqnN0wlHgOA8jcCS+jRoG9xHpr99uTsSBnWL3ROYWjyvw+iB5OX IMcMteR5GODZjxuTlbDSdNXL1XoTAnjsLI21+Bgx/GpJIyKy6kLodamV19GFew2NGTIy segX/4lhv8fdqKIVKLiu+uDvl0jjASV8Q+vjqqC+fUuLGKujGcomOu03PxUAno1heMWn 50mQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OL1Q6rTg; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e6si44263023pgp.504.2018.11.20.13.23.01; Tue, 20 Nov 2018 13:23:16 -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=@google.com header.s=20161025 header.b=OL1Q6rTg; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726485AbeKUHuu (ORCPT + 99 others); Wed, 21 Nov 2018 02:50:50 -0500 Received: from mail-vs1-f67.google.com ([209.85.217.67]:44938 "EHLO mail-vs1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbeKUHuu (ORCPT ); Wed, 21 Nov 2018 02:50:50 -0500 Received: by mail-vs1-f67.google.com with SMTP id g68so1973133vsd.11 for ; Tue, 20 Nov 2018 13:19:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=wKk1mDC16JJ9caAL5YFzkAgYBMKvbRSypLiP/vbYkLA=; b=OL1Q6rTgv9msbpcka0MmUdZWBvAOleTNjyDcI8yrfz4VsKC8/swt13rTl6Fqw/UFqv ZwmQEq5d5x5sNA3FANcyMT3HOgu+XOM5QPHfBXelCJWaQ0vpb8zueR93Pox5CdN/5VOS c4pQM6GC3JV7CuHkfZMqxjvHmyBEwd5OHRwwgR0z03Va0WfFUlq+d8oght41omOMlQUE gyUkrWCRHEHgEz2dm5xKgD04IDbeqypJoJ/eqtDBEo50HMpIzgFt1NMKokjMAZx8qeNH kLRyRTfon6Kz8ONsmMR005Tg5aG1AOyl0/RdIh1b+Uq9sEI7awZJw4MAxEkPSqM/K5EM 1QOA== 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=wKk1mDC16JJ9caAL5YFzkAgYBMKvbRSypLiP/vbYkLA=; b=CQ1ZZMOPwuyz2BXmUCbCH85dzs4BJojjvbn8i5BT98CrZWyBXjFiKkziE/6jfdW3c/ DmRFy1LBxQV9XQvp+qBvAhNRB0+xrMAvqR9rHv6hIuwSrBOqp7K00qu4wVDhnW7cCQ5S en3i8YsXQK4k7MmqPx1u6T8CFaJjAy2N6XejYz3NAr0XBYu35aCxR2TabpQQwplcQgyB 7IcbZc5Twf7O2AjFffzvdXGmGY1n8FVNG3xx9fTvPvOGcpT958HuDH2wTSpc255N/8Z5 Jda35D4wtVe3EiMer05jZUwo4Fwy3bKt6su991Fa0DnjAuEkGj5x3D0veXCseDZYRtPK wadw== X-Gm-Message-State: AGRZ1gLWiEz7rEJ+4ZRDzJUFD6kDX8Z4HlKbHHIKrP4X/LOGJqTR26RU KXQ5H3ZWcsYLerynHOpnC/EAAf7SF7zxhYpRKiw/JA== X-Received: by 2002:a67:2704:: with SMTP id n4mr1616332vsn.208.1542748780168; Tue, 20 Nov 2018 13:19:40 -0800 (PST) MIME-Version: 1.0 References: <20181120194129.GC13936@tassilo.jf.intel.com> <20181120201144.GD13936@tassilo.jf.intel.com> In-Reply-To: From: Stephane Eranian Date: Tue, 20 Nov 2018 13:19:28 -0800 Message-ID: Subject: Re: [REGRESSION] x86, perf: counter freezing breaks rr To: Kyle Huey Cc: Andi Kleen , "Liang, Kan" , Peter Zijlstra , Ingo Molnar , robert@ocallahan.org, Alexander Shishkin , Arnaldo Carvalho de Melo , Jiri Olsa , Linus Torvalds , Thomas Gleixner , Vince Weaver , Arnaldo Carvalho de Melo , LKML 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 12:53 PM Kyle Huey wrote: > > On Tue, Nov 20, 2018 at 12:11 PM 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. > > 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 :) > Let me make sure I got this right. During recording, you count on retired-cond-branch and you record the value of the PMU counter at specific locations, e.g., syscalls. During replay, you program the branch-conditional-retired to overflow on interrupt at each recorded values. So if you sampled the event at 1,000,000 and then at 1,500,000. Then you program the event with a period of 1,000,000 first, on overflow the counter interrupts and you get a signal. Then, you reprogram the event for a new period of 500,000. During recording and replay the event is limited to ring 3 (user level). Am I understanding this right?