Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1426279

Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace

From xinhui <xinhui.pan@linux.vnet.ibm.com>
Newsgroups linux.kernel
Subject Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace
Date 2016-06-20 09:30 +0200
Message-ID <rM1OF-5eM-23@gated-at.bofh.it> (permalink)
References <rLZMR-42g-3@gated-at.bofh.it> <rLZMS-42g-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016年06月20日 12:55, Byungchul Park wrote:
> Currently, x86 implementation of save_stack_trace() is walking all stack
> region word by word regardless of what the trace->max_entries is.
> However, it's unnecessary to walk after already fulfilling caller's
> requirement, say, if trace->nr_entries >= trace->max_entries is true.
>
> For example, CONFIG_LOCKDEP_CROSSRELEASE implementation calls
> save_stack_trace() with max_entries = 5 frequently. I measured its
> overhead and printed its difference of sched_clock() with my QEMU x86
> machine.
>
> The latency was improved over 70% when trace->max_entries = 5.
>
[snip]

> +static int save_stack_end(void *data)
> +{
> +	struct stack_trace *trace = data;
> +	return trace->nr_entries >= trace->max_entries;
> +}
> +
>   static const struct stacktrace_ops save_stack_ops = {
>   	.stack		= save_stack_stack,
>   	.address	= save_stack_address,
then why not check the return value of ->address(), -1 indicate there is no room to store any pointer.

>   	.walk_stack	= print_context_stack,
> +	.end_walk	= save_stack_end,
>   };
>
>   static const struct stacktrace_ops save_stack_ops_nosched = {
>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC 12/12] x86/dumpstack: Optimize save_stack_trace Byungchul Park <byungchul.park@lge.com> - 2016-06-20 07:20 +0200
  Re: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace xinhui <xinhui.pan@linux.vnet.ibm.com> - 2016-06-20 09:30 +0200
    RE: [RFC 12/12] x86/dumpstack: Optimize save_stack_trace "byungchul.park" <byungchul.park@lge.com> - 2016-06-20 10:00 +0200

csiph-web