From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16525 invoked by alias); 13 Mar 2006 13:51:08 -0000 Received: (qmail 16518 invoked by uid 22791); 13 Mar 2006 13:51:07 -0000 X-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00,UNPARSEABLE_RELAY X-Spam-Check-By: sourceware.org Received: from mail8.hitachi.co.jp (HELO mail8.hitachi.co.jp) (133.145.228.43) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 13 Mar 2006 13:51:04 +0000 Received: from mlsv7.hitachi.co.jp (unknown [133.145.228.16]) by mail8.hitachi.co.jp (Postfix) with ESMTP id DAC7237C84 for ; Mon, 13 Mar 2006 22:51:01 +0900 (JST) Received: from mfilter-s5.hitachi.co.jp by mlsv7.hitachi.co.jp (8.12.11/8.12.11) id k2DDp1lQ031068; Mon, 13 Mar 2006 22:51:01 +0900 Received: from vshuts1.hitachi.co.jp (unverified) by mfilter-s5.hitachi.co.jp (Content Technologies SMTPRS 4.3.17) with SMTP id ; Mon, 13 Mar 2006 22:51:01 +0900 Received: from hsdlgw92.sdl.hitachi.co.jp ([133.144.7.20]) by vshuts1.hitachi.co.jp with SMTP id M2006031322510029934 ; Mon, 13 Mar 2006 22:51:00 +0900 Received: from vgate2.sdl.hitachi.co.jp by hsdlgw92.sdl.hitachi.co.jp (8.9.3/3.7W01100113) id WAA22869; Mon, 13 Mar 2006 22:51:00 +0900 Received: from maila.sdl.hitachi.co.jp ([133.144.14.196]) by vgate2.sdl.hitachi.co.jp (SAVSMTP 3.1.1.32) with SMTP id M2006031322510001782 ; Mon, 13 Mar 2006 22:51:00 +0900 Received: from [192.168.16.226] ([192.168.16.226]) by maila.sdl.hitachi.co.jp (8.13.1/3.7W04031011) with ESMTP id k2DDp0EU015170; Mon, 13 Mar 2006 22:51:00 +0900 Message-ID: <441578BF.6090001@sdl.hitachi.co.jp> Date: Mon, 13 Mar 2006 13:51:00 -0000 From: Masami Hiramatsu User-Agent: Thunderbird 1.5 (Windows/20051201) MIME-Version: 1.0 To: "bibo,mao" Cc: prasanna@in.ibm.com, systemtap@sources.redhat.com, Ananth N Mavinakayanahalli , "Keshavamurthy, Anil S" , Jim Keniston , Satoshi Oshima , Yumiko Sugita , Hideo Aoki , Maneesh Soni Subject: Re: [PATCH] kprobe-booster: boosting multi-probe References: <43F5C22C.5050702@sdl.hitachi.co.jp> <44151136.7020101@intel.com> In-Reply-To: <44151136.7020101@intel.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2006-q1/txt/msg00772.txt.bz2 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