PERFORCE change 96128 for review
John Baldwin
jhb at freebsd.org
Thu Apr 27 22:11:30 UTC 2006
On Wednesday 26 April 2006 00:28, John Birrell wrote:
> http://perforce.freebsd.org/chv.cgi?CH=96128
>
> Change 96128 by jb at 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 at FreeBSD.org> <>< http://www.FreeBSD.org/~jhb/
"Power Users Use the Power to Serve" = http://www.FreeBSD.org
More information about the p4-projects
mailing list