Date: Thu, 27 Apr 2006 17:43:11 -0400 From: John Baldwin <jhb@freebsd.org> To: John Birrell <jb@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 96128 for review Message-ID: <200604271743.12787.jhb@freebsd.org> In-Reply-To: <200604260428.k3Q4S00P033222@repoman.freebsd.org> References: <200604260428.k3Q4S00P033222@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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 <jhb@FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/ "Power Users Use the Power to Serve" = http://www.FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604271743.12787.jhb>