This is the mail archive of the
systemtap@sources.redhat.com
mailing list for the systemtap project.
Re: better SMP support for kprobes
- From: Martin Hunt <hunt at redhat dot com>
- To: "Frank Ch. Eigler" <fche at redhat dot com>
- Cc: systemtap at sources dot redhat dot com
- Date: Wed, 02 Feb 2005 23:52:20 -0800
- Subject: Re: better SMP support for kprobes
- Organization: Red Hat Inc.
- References: <1107387079.6053.7.camel@tiger> <20050202234526.GE4051@redhat.com>
On Wed, 2005-02-02 at 18:45 -0500, Frank Ch. Eigler wrote:
> More importantly, by reading the code, it seems like kprobes user
> functions are called from within a context where interrupts are
> blocked. Would that not make it impossible to safely invoke
> user-context might_sleep functions like copy_from_user, from any
> of the kprobes, jprobes, dprobes layers? I hope I'm missing
> something!
This is something we should probably run by a kernel expert.
We can always just have it copy if possible, otherwise fail cleanly.
That means we need to determine if a page fault would happen and avoid
it, or simply prevent it.
This is what my current runtime copy_from_user looks like:
unsigned long
dtr_copy_from_user (char *dst, const char __user *src, unsigned long
count)
{
int left;
inc_preempt_count();
left = __copy_from_user_inatomic(dst, src, count);
dec_preempt_count();
return left;
}
This should return 0 on success and should not sleep. If I understand
things correctly. At least it works in testing so far.
Martin