Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 24 Sep 2007 11:37:31 +0200
From:      "Attilio Rao" <attilio@freebsd.org>
To:        "Jung-uk Kim" <jkim@freebsd.org>
Cc:        freebsd-acpi@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: [PATCH] OsdSynch.c modernization
Message-ID:  <3bbf2fe10709240237u790de351wddb81b0c511d7435@mail.gmail.com>
In-Reply-To: <200709211827.29763.jkim@FreeBSD.org>
References:  <200709181516.11207.jkim@FreeBSD.org> <200709211715.17940.jhb@freebsd.org> <200709211827.29763.jkim@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
2007/9/22, Jung-uk Kim <jkim@freebsd.org>:
> I thought exactly the same when I started rewriting it (almost half
> year ago!).  I have tried all of the above, spent numerous sleepless
> nights, and miserably failed. :-(
>
> Spin mutex is too restrictive (e.g., it cannot be used with other
> locks gracefully).  critical_enter() causes:
>
> panic: blockable sleep lock (sleep mutex) 32 @
> /usr/src/sys/vm/uma_core.c:1830 cpuid = 0
> KDB: enter: panic
> [thread pid 21 tid 100013 ]
> Stopped at      kdb_enter+0x32: leave

UMA uses its own internal locking scheme which includes blocking
mutexes so you cannot maintain a spinlock over its functions.
You can however use a blocking mutex instead than a sx lock, that with
the help of adaptive spinning emulates a lot better spinlocks
behaviour.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3bbf2fe10709240237u790de351wddb81b0c511d7435>