This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [PATCH] kprobe-booster: boosting multi-probe
- From: Masami Hiramatsu <hiramatu at sdl dot hitachi dot co dot jp>
- To: "bibo,mao" <bibo dot mao at intel dot com>
- Cc: prasanna at in dot ibm dot com, systemtap at sources dot redhat dot com, Ananth N Mavinakayanahalli <ananth at in dot ibm dot com>, "Keshavamurthy, Anil S" <anil dot s dot keshavamurthy at intel dot com>, Jim Keniston <jkenisto at us dot ibm dot com>, Satoshi Oshima <soshima at redhat dot com>, Yumiko Sugita <sugita at sdl dot hitachi dot co dot jp>, Hideo Aoki <haoki at redhat dot com>, Maneesh Soni <maneesh at in dot ibm dot com>
- Date: Mon, 13 Mar 2006 22:50:55 +0900
- Subject: Re: [PATCH] kprobe-booster: boosting multi-probe
- References: <43F5C22C.5050702@sdl.hitachi.co.jp> <44151136.7020101@intel.com>
Hi, bibo
bibo,mao wrote:
> Hi Marami,
> I refresh kprobe boost patch as follows, in this patch post_handler is
> seperated from break_handler.
The part of the patch against kernel/kprobes.c seems good to me.
But I found a bug.
> @@ -537,6 +539,18 @@ valid_p:
> }
> arch_remove_kprobe(p);
> }
> + else{
> + mutex_lock(&kprobe_mutex);
> + if (p->break_handler)
> + old_p->break_handler = NULL;
> + if (p->post_handler){
> + list_for_each_entry_rcu(list_p, &old_p->list, list){
> + if (list_p->post_handler) break;
> + old_p->post_handler = NULL;
^^^^^^^^^^^^^^^^^^^^^^^^^^^
When the head of the list does not have a post_handler, this code
always clear the aggr_kprobe's post_handler.
> + }
> + }
> + mutex_unlock(&kprobe_mutex);
> + }
> }
And the next part is not comfortable to me.
> And I think booster can be enabled even
> when preempt is disabled.
I think your patch enables booster even when preemption is
enabled, and it may be dangerous. Some running processes can
be preempted by another process when it is executing the codes in
the instruction buffer. When the boosted-probe is deregistered, that
instruction buffer is removed. Then, those preempted processes
can't continue to run, because they can't back to the preempted address.
So, I think, for the safety, the booster should NOT be enabled when
preemption is enabled.
Please fix it.
--
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: hiramatu@sdl.hitachi.co.jp