public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Markus Trippelsdorf <markus@trippelsdorf.de>
To: Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Alexander Shishkin <alexander.shishkin@linux.intel.com>
Subject: Re: "perf: interrupt took too long" messages even with perf_cpu_time_max_percent==0
Date: Sat, 2 Apr 2016 13:17:26 +0200	[thread overview]
Message-ID: <20160402111726.GB305@x4> (raw)
In-Reply-To: <20160402110017.GP3448@twins.programming.kicks-ass.net>

On 2016.04.02 at 13:00 +0200, Peter Zijlstra wrote:
> On Sat, Apr 02, 2016 at 11:32:39AM +0200, Markus Trippelsdorf wrote:
> > Current git kernel sometimes shows:
> >
> >  perf: interrupt took too long (71 > 52), lowering kernel.perf_event_max_sample_rate to 300
> >  perf: interrupt took too long (103 > 88), lowering kernel.perf_event_max_sample_rate to 300
> >  perf: interrupt took too long (130 > 128), lowering kernel.perf_event_max_sample_rate to 300
> >  perf: interrupt took too long (175 > 162), lowering kernel.perf_event_max_sample_rate to 300
> >  perf: interrupt took too long (219 > 218), lowering kernel.perf_event_max_sample_rate to 300
> > ...
> >
> > when running e.g. "perf top" even when
> > /proc/sys/kernel/perf_cpu_time_max_percent is set to 0.
>
>
> Ah, was 0 also meant to disable it?

Yes. From Documentation/sysctl/kernel.txt:

 perf_cpu_time_max_percent:
 
 Hints to the kernel how much CPU time it should be allowed to
 use to handle perf sampling events.  If the perf subsystem
 is informed that its samples are exceeding this limit, it
 will drop its sampling frequency to attempt to reduce its CPU
 usage.
 
 Some perf sampling happens in NMIs.  If these samples
 unexpectedly take too long to execute, the NMIs can become
 stacked up next to each other so much that nothing else is
 allowed to execute.
 
 0: disable the mechanism.  Do not monitor or correct perf's
    sampling rate no matter how CPU time it takes.
 
 1-100: attempt to throttle perf's sample rate to this
    percentage of CPU.  Note: the kernel calculates an
    "expected" length of each sample event.  100 here means
    100% of that expected length.  Even if this is set to
    100, you may still see sample throttling if this
    length is exceeded.  Set to 0 if you truly do not care
    how much CPU is consumed.

> Does the below help?

Thanks. I will test it later. But 91a612eea9a3 makes the assumption that only
sysctl_perf_cpu_time_max_percent==100 disables the feature also in
kernel/events/core.c.

--
Markus

  reply	other threads:[~2016-04-02 11:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-02  9:32 "perf: interrupt took too long" messages even with perf_cpu_time_max_percent==0 Markus Trippelsdorf
2016-04-02 11:00 ` Peter Zijlstra
2016-04-02 11:17   ` Markus Trippelsdorf [this message]
2016-04-02 11:23     ` Markus Trippelsdorf
2016-04-02 16:33     ` Peter Zijlstra
2016-04-13 10:03   ` Markus Trippelsdorf

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=20160402111726.GB305@x4 \
    --to=markus@trippelsdorf.de \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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