public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: kan.liang@linux.intel.com, mingo@redhat.com, tglx@linutronix.de,
	acme@kernel.org, mark.rutland@arm.com,
	alexander.shishkin@linux.intel.com, jolsa@kernel.org,
	irogers@google.com, adrian.hunter@intel.com,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	ravi.bangoria@amd.com, sandipan.das@amd.com,
	atrajeev@linux.vnet.ibm.com, luogengkun@huaweicloud.com,
	ak@linux.intel.com
Subject: Re: [RFC PATCH] perf: New start period for the freq mode
Date: Mon, 2 Sep 2024 12:38:38 +0200	[thread overview]
Message-ID: <20240902103838.GF4723@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <ZtFjFpg0MCcLbgnq@google.com>

On Thu, Aug 29, 2024 at 11:13:42PM -0700, Namhyung Kim wrote:
> Hi Kan,
> 
> On Thu, Aug 29, 2024 at 08:20:36AM -0700, kan.liang@linux.intel.com wrote:
> > From: Kan Liang <kan.liang@linux.intel.com>
> > 
> > The freq mode is the current default mode of Linux perf. 1 period is
> > used as a start period. The period is auto-adjusted in each tick or an
> > overflow to meet the frequency target.
> > 
> > The start period 1 is too low and may trigger some issues.
> > - Many HWs do not support period 1 well.
> >   https://lore.kernel.org/lkml/875xs2oh69.ffs@tglx/

So we already have x86_pmu::limit_period and pmu::check_period to deal
with this. Don't they already capture the 1 and increase it where
appropriate?

> > - For an event that occurs frequently, period 1 is too far away from the
> >   real period. Lots of the samples are generated at the beginning.
> >   The distribution of samples may not be even.

Which is why samples include a WEIGHT option IIRC.

> Sounds like a per-pmu callback is fine.  PMUs don't have the callback
> (including SW) can use 1 same as of now.

This, but also, be very careful to not over-estimate, because ramping up
is fast, but having to adjust down can take a while.



  parent reply	other threads:[~2024-09-02 10:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-29 15:20 [RFC PATCH] perf: New start period for the freq mode kan.liang
2024-08-30  6:13 ` Namhyung Kim
2024-08-30 14:49   ` Liang, Kan
2024-09-02 10:38   ` Peter Zijlstra [this message]
2024-09-03 15:23     ` Liang, Kan

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=20240902103838.GF4723@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=acme@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=ak@linux.intel.com \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=atrajeev@linux.vnet.ibm.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=kan.liang@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=luogengkun@huaweicloud.com \
    --cc=mark.rutland@arm.com \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=ravi.bangoria@amd.com \
    --cc=sandipan.das@amd.com \
    --cc=tglx@linutronix.de \
    /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