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

From: Ed Schouten <ed_at_80386.nl>
Date: Mon, 26 May 2008 15:41:25 +0200
* 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/

Received on Mon May 26 2008 - 11:42:24 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:39:31 UTC