From: Peter Zijlstra <a.p.zijlstra@chello.nl>
To: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>,
"Mark W. Krentel" <krentel@cs.rice.edu>,
linux-kernel@vger.kernel.org,
Corey Ashford <cjashfor@linux.vnet.ibm.com>
Subject: Re: [PATCH] perf_event: Adjust frequency and unthrottle for non-group-leader events
Date: Wed, 14 Oct 2009 12:54:12 +0200 [thread overview]
Message-ID: <1255517652.8392.378.camel@twins> (raw)
In-Reply-To: <19157.26731.855609.165622@cargo.ozlabs.ibm.com>
On Wed, 2009-10-14 at 16:58 +1100, Paul Mackerras wrote:
> The loop in perf_ctx_adjust_freq checks the frequency of sampling
> event counters, and adjusts the event interval and unthrottles the
> event if required, and resets the interrupt count for the event.
> However, at present it only looks at group leaders.
>
> This means that a sampling event that is not a group leader will
> eventually get throttled, once its interrupt count reaches
> sysctl_perf_event_sample_rate/HZ --- and that is guaranteed to
> happen, if the event is active for long enough, since the interrupt
> count never gets reset. Once it is throttled it never gets
> unthrottled, so it basically just stops working at that point.
>
> This fixes it by making perf_ctx_adjust_freq use ctx->event_list
> rather than ctx->group_list. The existing spin_lock/spin_unlock
> around the loop makes it unnecessary to put rcu_read_lock/
> rcu_read_unlock around the list_for_each_entry_rcu().
>
> Reported-by: Mark W. Krentel <krentel@cs.rice.edu>
> Signed-off-by: Paul Mackerras <paulus@samba.org>
Looks good, thanks Paul!
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
> ---
> Apparently this bug was only seen on powerpc, and not on x86. I have
> no idea why.
Weird, should work the same way on both of them.
prev parent reply other threads:[~2009-10-14 10:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 5:58 Paul Mackerras
2009-10-14 6:59 ` [tip:perf/urgent] " tip-bot for Paul Mackerras
2009-10-14 10:54 ` Peter Zijlstra [this message]
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=1255517652.8392.378.camel@twins \
--to=a.p.zijlstra@chello.nl \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=krentel@cs.rice.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.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
Powered by JetHome