From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 547 invoked by alias); 31 Oct 2006 03:03:13 -0000 Received: (qmail 538 invoked by uid 22791); 31 Oct 2006 03:03:13 -0000 X-Spam-Status: No, hits=-2.6 required=5.0 tests=BAYES_00 X-Spam-Check-By: sourceware.org Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 31 Oct 2006 03:03:10 +0000 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by mga09.intel.com with ESMTP; 30 Oct 2006 19:03:08 -0800 Received: from bmao-mobl.ccr.corp.intel.com (HELO [10.239.22.151]) ([10.239.22.151]) by orsmga001.jf.intel.com with ESMTP; 30 Oct 2006 19:03:08 -0800 X-ExtLoop1: 1 X-IronPort-AV: i="4.09,372,1157353200"; d="scan'208"; a="153289902:sNHT18886189" Message-ID: <4546BCE7.9030008@linux.intel.com> Date: Tue, 31 Oct 2006 09:14:00 -0000 From: "bibo,mao" User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) MIME-Version: 1.0 To: Masami Hiramatsu CC: "bibo,mao" , "Keshavamurthy, Anil S" , Ananth N Mavinakayanahalli , Prasanna S Panchamukhi , Ingo Molnar , SystemTAP , Satoshi Oshima , Hideo Aoki , Yumiko Sugita Subject: Re: [RFC][PATCH][kprobe] enabling booster on the preemptible kernel, take 2 References: <45338593.6090207@hitachi.com> <45459D94.8060905@intel.com> <454606EC.1030807@hitachi.com> In-Reply-To: <454606EC.1030807@hitachi.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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-q4/txt/msg00289.txt.bz2 Masami Hiramatsu wrote: > Hi bibo, > > Thank you for your review! > > bibo,mao wrote: >> This patch will boost kprobe on preemptible kernel, I think >> it is deserved to waster some memory for better performance >> by deferring memory free after freeze_processes. > > I think it doesn't waste memory so much, because it tries > to reuse garbage memories before the kernel allocates an > additional page. > > [...] >>> +static int __kprobes collect_garbage_slots(void) >>> +{ >>> + struct kprobe_insn_page *kip; >>> + struct hlist_node *pos, *next; >>> + int ret = -1; >>> + >>> +#if defined(CONFIG_PREEMPT) && defined(CONFIG_PM) >>> + /* Ensure no-one is preepmted on the garbages */ >>> + if (freeze_processes() != 0) >> I do not know whether there exists non-freezeable and preemptive kernel >> thread, if there exist then this thread will not be frozen. > > In that case, freeze_processes() returns the positive value which > means how many processes are not frozen. If freeze_processes() > returns non-zero, this function aborts the garbage collection. > But from the code, return value of freeze_processes() represents how many processes can be frozen but are not frozen. I grep the kernel code, there still exists many processes which flag is PF_NOFREEZE. I think if current probed thread is PF_NOFREEZE, then kprobe_handler need skip the bootser. thanks bibo,mao