From owner-p4-projects@FreeBSD.ORG Thu Apr 27 22:11:30 2006 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 6AD2916A405; Thu, 27 Apr 2006 22:11:30 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4699316A400; Thu, 27 Apr 2006 22:11:30 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id BDE0643D49; Thu, 27 Apr 2006 22:11:29 +0000 (GMT) (envelope-from jhb@freebsd.org) Received: from localhost (john@localhost [127.0.0.1]) by server.baldwin.cx (8.13.4/8.13.4) with ESMTP id k3RMBS3a085855; Thu, 27 Apr 2006 18:11:28 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: John Birrell Date: Thu, 27 Apr 2006 17:43:11 -0400 User-Agent: KMail/1.9.1 References: <200604260428.k3Q4S00P033222@repoman.freebsd.org> In-Reply-To: <200604260428.k3Q4S00P033222@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200604271743.12787.jhb@freebsd.org> X-Virus-Scanned: ClamAV 0.87.1/1428/Thu Apr 27 14:39:31 2006 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.1 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.0 X-Spam-Checker-Version: SpamAssassin 3.1.0 (2005-09-13) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 96128 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 27 Apr 2006 22:11:30 -0000 On Wednesday 26 April 2006 00:28, John Birrell wrote: > http://perforce.freebsd.org/chv.cgi?CH=96128 > > Change 96128 by jb@jb_freebsd2 on 2006/04/26 04:27:13 > > Update my hacks. > > *HELP* > > This is an area that I will definitely need help with. The function > being executed here needs to be called with pre-emption disabled. > This is being used in the simple case of "dtrace -n BEGIN" (which is > the simplest DTrace you can do), to swap buffers without being > interrupted when it is time to gather up a buffer full and return it > via an ioctl. The buffer change can't be interrupted because that > might allow another probe to add to the buffer that is being uploaded, > causing it to get mis-reported. I think you can use critical_enter/critical_exit in place of kpreempt_disable/enable. They do not block interrupts, but they do defer context switches (even to interrupt threads) so only INTR_FAST interrupt handlers will run inside a critical section. -- John Baldwin <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org