From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22219 invoked by alias); 20 Mar 2006 08:47:21 -0000 Received: (qmail 22211 invoked by uid 22791); 20 Mar 2006 08:47:20 -0000 X-Spam-Status: No, hits=-1.3 required=5.0 tests=AWL,BAYES_20,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mtagate1.uk.ibm.com (HELO mtagate1.uk.ibm.com) (195.212.29.134) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 20 Mar 2006 08:47:18 +0000 Received: from d06nrmr1407.portsmouth.uk.ibm.com (d06nrmr1407.portsmouth.uk.ibm.com [9.149.38.185]) by mtagate1.uk.ibm.com (8.12.10/8.12.10) with ESMTP id k2K8lFnk153460 for ; Mon, 20 Mar 2006 08:47:15 GMT Received: from d06av02.portsmouth.uk.ibm.com (d06av02.portsmouth.uk.ibm.com [9.149.37.228]) by d06nrmr1407.portsmouth.uk.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k2K8lcXR115924 for ; Mon, 20 Mar 2006 08:47:38 GMT Received: from d06av02.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av02.portsmouth.uk.ibm.com (8.12.11/8.13.3) with ESMTP id k2K8lFxh021296 for ; Mon, 20 Mar 2006 08:47:15 GMT Received: from d06ml065.portsmouth.uk.ibm.com (d06ml065.portsmouth.uk.ibm.com [9.149.38.138]) by d06av02.portsmouth.uk.ibm.com (8.12.11/8.12.11) with ESMTP id k2K8lF24021293 for ; Mon, 20 Mar 2006 08:47:15 GMT In-Reply-To: <20060319172454.GA17181@in.ibm.com> Subject: Re: thoughts about exception-handling requirements for kprobes Sensitivity: To: systemtap@sources.redhat.com X-Mailer: Lotus Notes Release 6.5.1IBM February 19, 2004 Message-ID: From: Richard J Moore Date: Mon, 20 Mar 2006 08:47:00 -0000 X-MIMETrack: Serialize by Router on D06ML065/06/M/IBM(Release 6.53HF247 | January 6, 2005) at 20/03/2006 08:47:37 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII 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/msg00829.txt.bz2 systemtap-owner@sourceware.org wrote on 19/03/2006 17:24:54: > On Fri, Mar 17, 2006 at 01:50:57PM -0800, Keshavamurthy Anil S wrote: > > On Thu, Mar 09, 2006 at 07:57:18AM -0800, Richard J Moore wrote: > > > > > > I've been thinking about the need for exception-handling and how the > > > current implementation has become a little muddled. > > > > Here is my thinking on this kprobe fault handling... > > Ideally we want the ability to recover from all > > the page faults happening from either pre-handler > > or happening from post-handler transparently in the > > same way as the normal kernel would recover from > > do_page_fault() function. In order for this to happen, > > I think we should not be calling pre-handler/post-handler > > by disabling preempt which is a major design change. > > Also in the current code if fixup_exception() fails to > > fixup the exception then falling back on the normal > > do_page_fault() is a bad thing with preempt disabled. > > > > I was thinking on this issue for the past several days > > and I believe that currently we are disabling preempt > > before calling pre/post handler, because we don;t > > want the process to get migrated to different CPU > > and we don't want another process to be scheduled > > while we are servicing kprobe as the newly scheduled > > process might trigger another probe and we don;t > > have space to save the kprobe control block(kprobe_ctlbk) > > info, because we save kprobe_ctlbk in the per cpu structure. > > > > If we move this saving kprobe_ctlbk to task struct then > > I think we will have the ability to call pre/post-handler > > without having to disable preempt and their by any faults > > happening from either pre/post handler can recover transparently > > in the same way as the normal kernel would recover. > > > > Kprobes user-specified pre/post handler are called within > the interrupt context and if we allow page faults while within Clarify what you mean by "allow" > user-specified pre/post handler, then it might sleep. Clarify what you mean by "it" Richard . . > -- > Prasanna S Panchamukhi > Linux Technology Center > India Software Labs, IBM Bangalore > Email: prasanna@in.ibm.com > Ph: 91-80-51776329