From: Peter Zijlstra <peterz@infradead.org>
To: Andrew Hunter <ahh@google.com>
Cc: linux-kernel@vger.kernel.org, eranian@google.com, mingo@redhat.com
Subject: Re: [PATCH] perf: reduce stack usage of schedule_events
Date: Fri, 31 May 2013 17:56:29 +0200 [thread overview]
Message-ID: <20130531155629.GH27176@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <1369332423-4400-1-git-send-email-ahh@google.com>
On Thu, May 23, 2013 at 11:07:03AM -0700, Andrew Hunter wrote:
> schedule_events caches event constraints on the stack during
> scheduling. Given the number of possible events, this is 512 bytes of
> stack; since it can be invoked under schedule() under god-knows-what,
> this is causing stack blowouts.
>
> Trade some space usage for stack safety: add a place to cache the
> constraint pointer to struct perf_event. For 8 bytes per event (1% of
> its size) we can save the giant stack frame.
>
> This shouldn't change any aspect of scheduling whatsoever and while in
> theory the locality's a tiny bit worse, I doubt we'll see any
> performance impact either.
>
> Tested: `perf stat whatever` does not blow up and produces
> results that aren't hugely obviously wrong. I'm not sure how to run
> particularly good tests of perf code, but this should not produce any
> functional change whatsoever.
>
> Signed-off-by: Andrew Hunter <ahh@google.com>
> Reviewed-by: Stephane Eranian <eranian@google.com>
OK nothing really strange popped out during a quick read.
Thanks!
next prev parent reply other threads:[~2013-05-31 15:56 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-23 18:07 [PATCH] perf: reduce stack usage of schedule_events Andrew Hunter
2013-05-31 14:21 ` Stephane Eranian
2013-05-31 15:48 ` Peter Zijlstra
2013-05-31 15:55 ` Stephane Eranian
2013-05-31 16:34 ` Peter Zijlstra
2013-05-31 15:56 ` Peter Zijlstra [this message]
2013-06-19 18:38 ` [tip:perf/core] perf/x86: Reduce stack usage of x86_schedule_events() tip-bot for Andrew Hunter
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=20130531155629.GH27176@twins.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=ahh@google.com \
--cc=eranian@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
/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