Date: Wed, 3 Mar 2010 22:48:31 +0100 From: Attilio Rao <attilio@freebsd.org> To: Ed Maste <emaste@freebsd.org> Cc: freebsd-scsi@freebsd.org, Matthew Jacob <mj@feral.com> Subject: Re: How is supposed to be protected the units list? Message-ID: <3bbf2fe11003031348q4c1fcccfxd19da32875b43f56@mail.gmail.com> In-Reply-To: <20100303214424.GA53790@sandvine.com> References: <3bbf2fe11002281655i61a5f0a0if3f381ad0c4a1ef8@mail.gmail.com> <3bbf2fe11003020724m14bebf74y9fa3906418b7cf11@mail.gmail.com> <4B8D3016.2070301@feral.com> <3bbf2fe11003031334g4591c1a3lc52dfb898f728ee2@mail.gmail.com> <20100303214424.GA53790@sandvine.com>
next in thread | previous in thread | raw e-mail | index | archive | help
2010/3/3 Ed Maste <emaste@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. =C2=A0My only comment is to > consider using macros for the lock/unlock; it seems to be a pretty > common idiom. > > #define FOO_LOCK_INIT() =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0\ > =C2=A0 =C2=A0mtx_init(&foo_mtx, "foo lock", NULL, MTX_DEF) > #define FOO_LOCK_ASSERT() =C2=A0 =C2=A0 =C2=A0 mtx_assert(&foo_mtx, MA_OW= NED) > #define FOO_LOCK() =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mtx_lo= ck(&foo_mtx) > #define FOO_UNLOCK() =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0mtx_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 --=20 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?3bbf2fe11003031348q4c1fcccfxd19da32875b43f56>