public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
From: Martin Hunt <hunt@redhat.com>
To: Jim Keniston <jkenisto@us.ibm.com>
Cc: prasanna@in.ibm.com, Richard J Moore <richardj_moore@uk.ibm.com>,
	        suparna@in.ibm.com,
	        "systemtap@sources.redhat.com"
	<systemtap@sources.redhat.com>
Subject: Re: kprobe fault handling
Date: Thu, 09 Feb 2006 22:06:00 -0000	[thread overview]
Message-ID: <1139522818.4127.15.camel@monkey2> (raw)
In-Reply-To: <1139520938.2779.171.camel@dyn9047018079.beaverton.ibm.com>

On Thu, 2006-02-09 at 13:35 -0800, Jim Keniston wrote:

> > +		/*
> > +		 * In case the user-specified fault handler returned zero,
> > +		 * try to fix up.
> > +		 */
> > +
> > +		if (fixup_exception(regs))
> > +			return 1;
> 
> I think it's OK to call fixup_exceptions() here, but I believe it's
> redundant.  I understood Suparna to say
> (http://sourceware.org/ml/systemtap/2006-q1/msg00423.html) that if we
> return 0, do_page_fault() will call fixup_exceptions() instead of trying
> to bring in the missing page (since it's a kernel instruction -- in a
> handler -- that faulted).  Her explanation made sense to me.

But experimentally things don't work the way they should.
I see lots of these

Feb  2 23:15:53 monkey2 kernel: Debug: sleeping function called from
invalid context at mm/page_alloc.c:618
Feb  2 23:15:53 monkey2 kernel: in_atomic():0[expected: 0],
irqs_disabled():1
Feb  2 23:15:53 monkey2 kernel:  [<c011df50>] __might_sleep+0x7d/0x89
Feb  2 23:15:53 monkey2 kernel:  [<c014b802>] __alloc_pages+0x3a/0x2f7
Feb  2 23:15:53 monkey2 kernel:  [<c0157a48>] do_no_page+0x55/0x3bf
Feb  2 23:15:53 monkey2 kernel:  [<c011a19e>] pte_alloc_one+0x18/0x49
Feb  2 23:15:53 monkey2 kernel:  [<c015553d>] pte_alloc_map+0x66/0x12d
Feb  2 23:15:53 monkey2 kernel:  [<c0157f6d>] handle_mm_fault+0xb0/0x1fd
Feb  2 23:15:53 monkey2 kernel:  [<c011a8ed>] do_page_fault+0x1ac/0x4dc
Feb  2 23:15:53 monkey2 kernel:  [<c02ab2c1>] sock_aio_write+0x106/0x113
Feb  2 23:15:53 monkey2 kernel:  [<c0119263>] kprobe_exceptions_notify
+0xc6/0x123
Feb  2 23:15:53 monkey2 kernel:  [<c011a741>] do_page_fault+0x0/0x4dc
Feb  2 23:15:53 monkey2 kernel:  [<c030fa4f>] error_code+0x2f/0x38
Feb  2 23:15:53 monkey2 kernel:  [<c01e6028>] __copy_from_user_ll
+0x30/0x48
Feb  2 23:15:53 monkey2 kernel:  [<e0b9dac7>] _stp_copy_from_user
+0x2d/0x4f [copy]
Feb  2 23:15:53 monkey2 kernel:  [<c0168211>] sys_read+0x0/0x62
Feb  2 23:15:53 monkey2 kernel:  [<e0b9dc40>] inst_sys_read+0x15/0x45
[copy]
Feb  2 23:15:53 monkey2 kernel:  [<c0119020>] kprobe_handler+0x1f0/0x230
Feb  2 23:15:53 monkey2 kernel:  [<c01191ce>] kprobe_exceptions_notify
+0x31/0x123
Feb  2 23:15:53 monkey2 kernel:  [<c0130c59>] notifier_call_chain
+0x17/0x2e
Feb  2 23:15:53 monkey2 kernel:  [<c01076f7>] do_int3+0x3d/0xcf
Feb  2 23:15:53 monkey2 kernel:  [<c0143260>] audit_syscall_entry
+0x124/0x13d
Feb  2 23:15:53 monkey2 kernel:  [<c030fbaf>] int3+0x1f/0x30
Feb  2 23:15:53 monkey2 kernel:  [<c0168212>] sys_read+0x1/0x62
Feb  2 23:15:53 monkey2 kernel:  [<c030f8cb>] syscall_call+0x7/0xb
Feb  2 23:15:53 monkey2 kernel:  [<c030007b>] xfrm_policy_gc_kill
+0x39/0x68

The above only happens on non-smp machines.  On SMP, I usually get
crashes.  Putting the fixup_exception() call in got rid of the messages
and crashes for me.

That's as far as I have investigated. 

  reply	other threads:[~2006-02-09 22:06 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-06 19:49 Martin Hunt
2006-02-07  0:51 ` Jim Keniston
2006-02-07 17:31   ` Jim Keniston
2006-02-07 17:50     ` Martin Hunt
2006-02-07 19:49       ` Jim Keniston
2006-02-08  4:38         ` Suparna Bhattacharya
2006-02-08 11:32           ` Richard J Moore
2006-02-09  7:23             ` Prasanna S Panchamukhi
2006-02-09 16:33               ` Keshavamurthy Anil S
2006-02-09 21:35               ` Jim Keniston
2006-02-09 22:06                 ` Martin Hunt [this message]
2006-02-10  5:39                   ` Martin Hunt
2006-02-10 21:46                     ` Frank Ch. Eigler
2006-02-10 21:55                       ` Martin Hunt
2006-02-10 22:12                         ` Frank Ch. Eigler
2006-02-10 22:17                           ` Martin Hunt
2006-02-10 22:20                             ` Frank Ch. Eigler
2006-02-10 22:41                               ` Martin Hunt
2006-02-10 22:47                                 ` Frank Ch. Eigler
2006-02-10 23:36                                   ` Martin Hunt
2006-02-11  0:49                                     ` Frank Ch. Eigler
2006-02-12  1:26                                       ` Martin Hunt
2006-02-13 13:39                                         ` Frank Ch. Eigler
  -- strict thread matches above, loose matches on Subject: below --
2006-02-09  8:55 Mao, Bibo
2006-02-09 10:22 ` Richard J Moore
2006-02-07 22:19 Keshavamurthy, Anil S
2006-02-07 20:36 Keshavamurthy, Anil S
2006-02-07 20:48 ` Martin Hunt
2005-09-06 12:56 Prasanna S Panchamukhi
2005-09-06 15:09 ` Frank Ch. Eigler
2005-09-08 11:52   ` Prasanna S Panchamukhi
2005-09-08 17:42     ` Frank Ch. Eigler
2005-09-06  1:06 Frank Ch. Eigler

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=1139522818.4127.15.camel@monkey2 \
    --to=hunt@redhat.com \
    --cc=jkenisto@us.ibm.com \
    --cc=prasanna@in.ibm.com \
    --cc=richardj_moore@uk.ibm.com \
    --cc=suparna@in.ibm.com \
    --cc=systemtap@sources.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).