Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp1360267ybj; Thu, 7 May 2020 22:45:41 -0700 (PDT) X-Google-Smtp-Source: APiQypLtZKEqGVHL9kLQx0236ISoOV6lE0aJ9r5isK4fPw0x/RbcLxEx8VusXQtejuvzYIPpj9B7 X-Received: by 2002:a17:906:8286:: with SMTP id h6mr497804ejx.28.1588916740952; Thu, 07 May 2020 22:45:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588916740; cv=none; d=google.com; s=arc-20160816; b=JoCKOEjJ5OLOAa7klpADJEzdx9RZf91GheRRoDv+0zNCtHrQP3mL2gTv0KE6ozhPSB Nlug7TE7uoa5KSqhxLOZLBKVTo0KY3rXWQEaU55+N2Ug9wPvQ3kmic/lAleLFAJ8jYPo nGEPEr4hXTynFULpvBhOGHuUOXICZd+6+2PWXzKfrSq29WhPO9qB8F0qgkWeMSSrBCMQ 6FkYAZnoZfSJnydgfwJuLHBvmPbvJXI8eYQ8jFItTURUFSOKWZ1wS2JG8T1WIHiX5QLl 0khaW76pJ3t4DCtrYne/dGoumtFutcB1+2oNzY8Rvn9ahJQjm8IzWuKAHc2sqGdUTlJP 9+xw== 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=BiVT8x4Fc5dyq46n+Hw+xDF4oIkQkHtFR1b/SJCs0I4=; b=hEtE9RVNN7txK6cyfM52Cn2+O9Wnwl0srgvHXm7VE4O+k3Mka4zGstReZgmkKZcZt8 vBjeU0wZ1xEqAS2ZCghqnYyU/+NzW194pLlVJtDGTluduknOEiUhqJ9VJB/vzwUZclGC axpkONHjJNeyaCfVKA3GHzCmUPwBnT/iDG+wXlwt9Dh3qUObImURPqO35brWgenu07dx x1jisX25pgNH1eq5lMSkIwHk6IAsuDAnsCggqxlgikvvFCYomMNMrZf9R1eZb4onJhPD Old0ckdKLFMeB9CwIteUHYp5X6VvjtjGbgnFyYwloDyV8FGxgL+su6wpUJS8QZRbR8cq nDRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=phq+qYMe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id q24si377301edr.166.2020.05.07.22.45.15; Thu, 07 May 2020 22:45:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=phq+qYMe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726048AbgEHFn4 (ORCPT + 99 others); Fri, 8 May 2020 01:43:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725891AbgEHFnz (ORCPT ); Fri, 8 May 2020 01:43:55 -0400 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3F4BC05BD09 for ; Thu, 7 May 2020 22:43:55 -0700 (PDT) Received: by mail-yb1-xb43.google.com with SMTP id c2so330196ybi.7 for ; Thu, 07 May 2020 22:43:55 -0700 (PDT) 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=BiVT8x4Fc5dyq46n+Hw+xDF4oIkQkHtFR1b/SJCs0I4=; b=phq+qYMe/tmA1caYZbha2uS86UrX+JoR3gK3zeZIeQazLEaSE9RApfQAi/p7y5hJ57 V5XX0C8acA7Mq1AoSeRo860sfn3QU/+8eYAXZjttoaOuscvEiEwVLqEzYEo3IiKh7zTZ 4BrKn8RPhEDBbuXhM3Cr0V5Xdm4nnf6/DEb3su888Yt1ZpxPNs6PXDVOwQCzJ3qqYOfJ 4EMGNgyAUD9WadFwdw9wdcslT5yR0AlGXEPPJQIgXYFpbObM6A+WAcHyS8O0IWZTliJ6 80tXa6KrLND9zVldwxZuqUsW3zrLDzsbT3P+sbdP5mtvr7xn3zsso/kjiNDQfycEYyRW VCyQ== 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=BiVT8x4Fc5dyq46n+Hw+xDF4oIkQkHtFR1b/SJCs0I4=; b=jgc6+fH21dBIH4EIblYcQOrx24VQABJSWCMYpOuqeDeFvFTRAP++IgEuAjB70Oz+7Z Py9FxeLIG5fQ4yDaGpEhgO2A6ME0VMfuCu+BgjnMGGSoIk5Rk14YNmRuwTG9NES4f5XY 2P5DJre5IYsOkA+JbKrggjUhPHMHptVEDYTaaSKsa9nENQJv9xqLTAGcQ/5BvAqJM/eH h2gZBN+/XmybhUcnZfJw0TXcEIbMi1rk8YYZAkXlF4HT5nt53uRATENgFhD+emiirFq8 +oZw5jF7N+1aj7C3cu0pexyaGjIQxIcAk4zSZpl3V6wo8r0sYqwz1s+Dcm+nIODu+h9L b5Ww== X-Gm-Message-State: AGi0PubrfcI3r+v0HABAhfyZbTF5q5/3j0BPtE5+f+xFerNJxSWlBQLb Gy/f5Z/quweTuNvHi/JN4BZk8a2qi1/AcRGosG889w== X-Received: by 2002:a25:7cc1:: with SMTP id x184mr2015977ybc.403.1588916634370; Thu, 07 May 2020 22:43:54 -0700 (PDT) MIME-Version: 1.0 References: <20200507081436.49071-1-irogers@google.com> <20200507174835.GB3538@tassilo.jf.intel.com> <20200507214652.GC3538@tassilo.jf.intel.com> In-Reply-To: <20200507214652.GC3538@tassilo.jf.intel.com> From: Ian Rogers Date: Thu, 7 May 2020 22:43:43 -0700 Message-ID: Subject: Re: [RFC PATCH 0/7] Share events between metrics To: Andi Kleen Cc: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , Andrii Nakryiko , John Fastabend , KP Singh , Kajol Jain , John Garry , Jin Yao , Kan Liang , Cong Wang , Kim Phillips , LKML , Networking , bpf , linux-perf-users , Stephane Eranian 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 Thu, May 7, 2020 at 2:47 PM Andi Kleen wrote: > > > > - without this change events within a metric may get scheduled > > > together, after they may appear as part of a larger group and be > > > multiplexed at different times, lowering accuracy - however, less > > > multiplexing may compensate for this. > > > > I agree the heuristic in this patch set is naive and would welcome to > > improve it from your toplev experience. I think this change is > > progress on TopDownL1 - would you agree? > > TopdownL1 in non SMT mode should always fit. Inside a group > deduping always makes sense. > > The problem is SMT mode where it doesn't fit. toplev tries > to group each node and each level together. Thanks Andi, I've provided some examples of TopDownL3_SMT in the cover letter of the v3 patch set: https://lore.kernel.org/lkml/20200508053629.210324-1-irogers@google.com/ I tested sandybridge and cascadelake and the results look similar to the non-SMT version. Let me know if there's a different variant to test. > > > > I'm wondering if what is needed are flags to control behavior. For > > example, avoiding the use of groups altogether. For TopDownL1 I see. > > Yes the current situation isn't great. > > For Topdown your patch clearly is an improvement, I'm not sure > it's for everything though. > > Probably the advanced heuristics are only useful for a few > formulas, most are very simple. So maybe it's ok. I guess > would need some testing over the existing formulas. Agreed, do you have a pointer on a metric group where things would obviously be worse? I started off with a cache miss and hit rate metric and similar to topdown this approach is a benefit. In v3 I've added a --metric-no-merge option to retain existing grouping behavior, I've also added a --metric-no-group that avoids groups for all metrics. This may be useful if the NMI watchdog can't be disabled. Thanks for the input! Ian > -Andi