linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Mark Barnett <mark.barnett@arm.com>
Cc: peterz@infradead.org, mingo@redhat.com, acme@kernel.org,
	namhyung@kernel.org, irogers@google.com, ben.gainey@arm.com,
	deepak.surti@arm.com, ak@linux.intel.com, will@kernel.org,
	james.clark@arm.com, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	adrian.hunter@intel.com, linux-perf-users@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v4 0/5] A mechanism for efficient support for per-function metrics
Date: Sat, 12 Apr 2025 22:38:46 +0200	[thread overview]
Message-ID: <Z_rPVq2Emx697SIA@gmail.com> (raw)
In-Reply-To: <2fa741d8-13c7-49c0-a6c5-540a7c2cf3a7@arm.com>


* Mark Barnett <mark.barnett@arm.com> wrote:

> Tool Integration
> ==================
> 
> We've been using a python script to process the data into a report. We can
> look at implementing this directly in perf report, if that is required.
> However, I'm nervous about making the new feature the default behaviour for
> the tool.

That's OK - but it should be very simple to activate for perf 
record/top. A single option or so to get some sane default behavior, 
without having to micro-manage the period values?

In particular perf defaults to 4000 Hz auto-freq samples (at least on 
my x86 devel box), and it would be nice to make this new feature work 
well with the freq representation too, without complicating it too 
much.

> This feature has been integrated into our tools [1] for the last 12 
> months, and has received a lot of testing on Arm Neoverse hardware. 
> Other platforms have received less rigorous testing. In my opinion, 
> more work would be needed to validate the PMU hardware & software 
> characteristics of other architectures before this can be made the 
> default.

Sure. As long as the switch is simple, I think it will be a popular 
change once the kernel feature goes upstream.

In other words: please add a simple, idiot-proof switch to perf 
top/record for maintainers with chronically short attention spans who 
want to try out your kernel feature. ;)

Please Cc: the perf tooling people to those changes, in general they 
are very open to such features.

> Burst Sampling
> ================
> 
> I like the burst sampling idea. Increased I-Cache pressure is an inherent
> weakness of this sampling method, and this would help to alleviate that
> somewhat. I'll add this in the next spin.

Great, thanks!

> Period Jitter
> ===============
> 
> Yes, we can apply this to both periods. I will make that change.
> 
> I'm not sure I've fully understood your suggestion here. In its 
> current state, the 4-bit jitter field acts as a base-2 exponent. This 
> gives us a random jitter value of up to 2**15. Is the suggestion to 
> change this to a fixed, absolute value that can be applied to both 
> long & short periods?

Oh, I missed the base-2 exponent aspect, I assumed it was a flat period 
in the small integers range, a kind of micro-jitter to counter 
resonance with the finest CPU microarchitectural base-frequencies.

What is the typical useful jitter range in your experience? base-2 
exponents sound a bit too limiting - although the prandom32() indeed 
smears it between [0..2^param). I'd guess that jitter would rarely want 
to be larger than the long-period? (Although that might not always be 
the case.)

I'd generally err on the side of being a bit too generic & generous in 
the design of ABI parameters, because we never know what people will 
use it for ... Within reason that is.

Thanks,

	Ingo


  parent reply	other threads:[~2025-04-12 20:54 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-08 17:15 [PATCH v4 0/5] A mechanism for efficient support for per-function metrics mark.barnett
2025-04-08 17:15 ` [PATCH v4 1/5] perf: Record sample last_period before updating mark.barnett
2025-04-09 11:39   ` Ingo Molnar
2025-04-08 17:15 ` [PATCH v4 2/5] perf: Allow periodic events to alternate between two sample periods mark.barnett
2025-04-08 17:15 ` [PATCH v4 3/5] perf: Allow adding fixed random jitter to the sampling period mark.barnett
2025-04-09 10:54   ` Ingo Molnar
2025-04-09 14:24   ` Peter Zijlstra
2025-04-08 17:15 ` [PATCH v4 4/5] tools/perf: Modify event parser to support hf-period term mark.barnett
2025-04-08 17:15 ` [PATCH v4 5/5] tools/perf: Modify event parser to support hf-rand term mark.barnett
2025-04-09 11:38 ` [PATCH v4 0/5] A mechanism for efficient support for per-function metrics Ingo Molnar
2025-04-11 11:07   ` Mark Barnett
2025-04-11 17:34     ` Ian Rogers
2025-04-12 20:42       ` Ingo Molnar
2025-04-12 20:38     ` Ingo Molnar [this message]
2025-04-09 14:29 ` Peter Zijlstra
2025-04-11  9:44   ` Mark Barnett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Z_rPVq2Emx697SIA@gmail.com \
    --to=mingo@kernel.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ben.gainey@arm.com \
    --cc=deepak.surti@arm.com \
    --cc=irogers@google.com \
    --cc=james.clark@arm.com \
    --cc=jolsa@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mark.barnett@arm.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).