/dev/soiund/pcm/dsp.c: uma_zalloc with non-sleepable lock held
Kostik Belousov
kostikbel at gmail.com
Mon May 26 13:49:11 UTC 2008
On Mon, May 26, 2008 at 03:41:25PM +0200, Ed Schouten wrote:
> * 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.
I believe this is spelled
WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, NULL, "Some msg");
-------------- 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/33ee9abc/attachment.pgp
More information about the freebsd-current
mailing list