From: Peter Zijlstra <peterz@infradead.org>
To: Vince Weaver <vincent.weaver@maine.edu>
Cc: linux-kernel@vger.kernel.org, Paul Mackerras <paulus@samba.org>,
Ingo Molnar <mingo@redhat.com>
Subject: Re: perfevents: irq loop stuck!
Date: Fri, 16 May 2014 09:44:45 +0200 [thread overview]
Message-ID: <20140516074445.GJ11096@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <alpine.DEB.2.10.1405160017120.1351@vincent-weaver-1.umelst.maine.edu>
[-- Attachment #1: Type: text/plain, Size: 1559 bytes --]
On Fri, May 16, 2014 at 12:25:28AM -0400, Vince Weaver wrote:
> anyway I'm not sure if it's worth tracking this more if it's possible to
> mostly fix the case by fixing the sample_period bounds.
Right, so lets start with that, if it triggers again, we'll have another
look.
FWIW I ran with the below patch over night, and while trinity completely
shat itself going OOM -- so I'm not sure how long it ran, it didn't
trigger the stuck interrupt loop.
Will do more runs now that I'm there to hold its hand once more.
---
Subject: perf: Limit perf_event_attr::sample_period to 63 bits
From: Peter Zijlstra <peterz@infradead.org>
Date: Thu May 15 20:23:48 CEST 2014
Vince reported that using a large sample_period (one with bit 63 set)
results in wreckage since while the sample_period is fundamentally
unsigned (negative periods don't make sense) the way we implement
things very much rely on signed logic.
So limit sample_period to 63 bits to avoid tripping over this.
Reported-by: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/n/tip-p25fhunibl4y3qi0zuqmyf4b@git.kernel.org
---
kernel/events/core.c | 3 +++
1 file changed, 3 insertions(+)
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -7058,6 +7058,9 @@ SYSCALL_DEFINE5(perf_event_open,
if (attr.freq) {
if (attr.sample_freq > sysctl_perf_event_sample_rate)
return -EINVAL;
+ } else {
+ if (attr.sample_period & (1ULL << 63))
+ return -EINVAL;
}
/*
[-- Attachment #2: Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-05-16 7:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-14 3:06 Vince Weaver
2014-05-15 2:55 ` Vince Weaver
2014-05-15 18:21 ` Peter Zijlstra
2014-05-16 4:25 ` Vince Weaver
2014-05-16 7:44 ` Peter Zijlstra [this message]
2014-05-19 13:11 ` Vince Weaver
2014-05-19 13:56 ` Vince Weaver
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=20140516074445.GJ11096@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
--cc=vincent.weaver@maine.edu \
/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
Powered by JetHome