linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: David Ahern <dsahern@gmail.com>
Cc: Anton Blanchard <anton@samba.org>,
	linux-perf-users@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: perf PPC: kernel panic with callchains and context switch events
Date: Mon, 25 Jul 2011 09:27:21 +1000	[thread overview]
Message-ID: <20110724232721.GA19839@bloggs.ozlabs.ibm.com> (raw)
In-Reply-To: <4E274F5F.7000604@gmail.com>

On Wed, Jul 20, 2011 at 03:57:51PM -0600, David Ahern wrote:
> I am hoping someone familiar with PPC can help understand a panic that
> is generated when capturing callchains with context switch events.
> 
> Call trace is below. The short of it is that walking the callchain
> generates a page fault. To handle the page fault the mmap_sem is needed,
> but it is currently held by setup_arg_pages. setup_arg_pages calls
> shift_arg_pages with the mmap_sem held. shift_arg_pages then calls
> move_page_tables which has a cond_resched at the top of its for loop. If
> the cond_resched() is removed from move_page_tables everything works
> beautifully - no panics.
> 
> So, the question: is it normal for walking the stack to trigger a page
> fault on PPC? The panic is not seen on x86 based systems.

Walking the user stack can certainly generate a page fault; walking
the kernel stack should never generate a page fault.  If any page
fault is generated reading the user stack frame, we're supposed to
detect that and fall back to walking the page tables manually (see
read_user_stack_64() in arch/powerpc/kernel/perf_callchain.c).  I
think I need to check our __get_user_inatomic() implementation.

I don't think removing the cond_resched() from move_page_tables is the
right answer.

Paul.

      parent reply	other threads:[~2011-07-25  0:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20 21:57 perf PPC: kernel panic with callchains and context switch events David Ahern
2011-07-24 17:18 ` David Ahern
2011-07-25  0:05   ` [PATCH] perf: powerpc: Disable pagefaults during callchain stack read Anton Blanchard
2011-07-25  1:55   ` perf PPC: kernel panic with callchains and context switch events Benjamin Herrenschmidt
2011-07-25 15:38     ` David Ahern
2011-07-24 23:27 ` Paul Mackerras [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=20110724232721.GA19839@bloggs.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=anton@samba.org \
    --cc=dsahern@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).