All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Ken Chen <kenchen@google.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Steven Rostedt <rostedt@goodmis.org>
Subject: Re: [patch] sched: fix single-depth wchan output
Date: Thu, 6 Nov 2008 07:11:25 +0100	[thread overview]
Message-ID: <20081106061125.GA6384@elte.hu> (raw)
In-Reply-To: <b040c32a0811052158r4f6662dega3503a0c7ec72620@mail.gmail.com>


* Ken Chen <kenchen@google.com> wrote:

> To get a meaningful /proc/<pid>/wchan, one is required to turn on 
> full frame pointer when compile kernel/sched.c on x86 arch.  The 
> enabling of frame pointer applies to entire kernel/sched.c and 
> affects lots of other core scheduler functions that aren't related 
> to wchan's call stack unwind.  This causes unnecessary expansion of 
> stack pointer push and pop on the stack for scheduler functions.  To 
> cut down the cost of frame pointer push/pop, one can use compile 
> time config option 'single-depth wchan'.  However, the 
> 'single-depth' option is broken on x86 due to lack of stack frame 
> marker and simple stack unwind doesn't work, i.e., wchan always 
> produces '0'.
> 
> This patch adds call site location explicitly in thread_struct for 
> schedule() function so that get_wchan() can reliably get the data 
> and at the same time not to overly burden the entire kernel/sched.c 
> with frame pointer generation.  The remove of frame pointer 
> dependency allows compiler to generate better and faster core 
> scheduler code on x86_64.

hm, this adds overhead - and the thing is that WCHAN is rather 
uninformative to begin with (because it's a single dimension), so we 
should phase it out, not expand it.

How about adding a /proc/<PID>/stacktrace file that gives us the stack 
trace of any task in the system? That would be useful for a number of 
other purposes as well, and about 100 times more useful than wchan. 
(often it would be more useful than sysrq-t dumps)

Hm?

	Ingo

  reply	other threads:[~2008-11-06  6:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-06  5:58 [patch] sched: fix single-depth wchan output Ken Chen
2008-11-06  6:11 ` Ingo Molnar [this message]
2008-11-06  6:16   ` Ken Chen
2008-11-06  6:30     ` Ingo Molnar
2008-11-06  6:42       ` Ken Chen
2008-11-06  6:59         ` Ingo Molnar
2008-11-06  7:28           ` Ken Chen
2008-11-06  7:44             ` Ingo Molnar
2008-11-06 22:33       ` Andi Kleen
2008-11-06 21:56   ` Matt Mackall
2008-11-06 22:30     ` Chris Friesen

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=20081106061125.GA6384@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=kenchen@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.