How is supposed to be protected the units list?

Attilio Rao attilio at freebsd.org
Wed Mar 3 21:48:39 UTC 2010


2010/3/3 Ed Maste <emaste at freebsd.org>:
> On Wed, Mar 03, 2010 at 10:34:36PM +0100, Attilio Rao wrote:
>
>> So I stress-tested the patch for several hours (6-7) with a
>> stress-test that could reproduce the bug for us, on a debugging
>> kernel, and it didn't panic'ed or showed LORs, deadlock, etc.
>>
>> If someone could offer time for reviews or futher examinations it
>> would be very much appreciated.
>
> I reviewed the patch and am happy with it.  My only comment is to
> consider using macros for the lock/unlock; it seems to be a pretty
> common idiom.
>
> #define FOO_LOCK_INIT()          \
>    mtx_init(&foo_mtx, "foo lock", NULL, MTX_DEF)
> #define FOO_LOCK_ASSERT()       mtx_assert(&foo_mtx, MA_OWNED)
> #define FOO_LOCK()              mtx_lock(&foo_mtx)
> #define FOO_UNLOCK()            mtx_unlock(&foo_mtx)

Well, using functions will allow us to not exort the "foo_mtx" symbol,
something I want to avoid.
Such idiot is mostly better when the mutex is part of the ABI.

Attilio


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


More information about the freebsd-scsi mailing list