/dev/soiund/pcm/dsp.c: uma_zalloc with non-sleepable lock held

Ed Schouten ed at 80386.nl
Mon May 26 13:42:24 UTC 2008


* Kostik Belousov <kostikbel at gmail.com> wrote:
> Not quite. You cannot hold a mutex over the destroy_dev(), because
> the destroy_dev() may sleep. It was not very common situation, because
> it requires another thread still in the driver methods to trigger the
> problem. Now, because the malloc() is called unconditionally in the
> destroy_dev() since rev. 1.212, the problem gets hit regularly.

I was looking around, but I couldn't find it. Isn't there some kind of
macro that does something like this:

| void
| myfunction(void)
| {
| 	THREAD_CANNOT_HOLD_ANY_NONSLEEPABLE_LOCKS_HERE;
| 
| 	...
| }

I know we have THREAD_NO_SLEEPING(), but that just does the opposite. I
think we could greatly improve our warnings if we could add these
macro's throughout the source code.

-- 
 Ed Schouten <ed at 80386.nl>
 WWW: http://80386.nl/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20080526/a34b0909/attachment.pgp


More information about the freebsd-current mailing list