From owner-freebsd-scsi@FreeBSD.ORG Wed Mar 3 21:48:39 2010 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4CEE106564A; Wed, 3 Mar 2010 21:48:39 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-qy0-f183.google.com (mail-qy0-f183.google.com [209.85.221.183]) by mx1.freebsd.org (Postfix) with ESMTP id 4F4208FC2A; Wed, 3 Mar 2010 21:48:39 +0000 (UTC) Received: by qyk14 with SMTP id 14so1870799qyk.9 for ; Wed, 03 Mar 2010 13:48:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=QCQQMmj/k+jZSCQQGN/hdgfMO1mGAW0iROpDYcqTAdk=; b=d7sV6QF6BddPUl7h4l+5/MxSoGv1pxvZnBV//AtBdi6DbLyIWhbNh89sIoBVeDUbxJ LS/WkKGqlljvIaFSroOMSxn2D1+dWsnY2tmPYOHZQ7E427hQhhP5FThWfZrXRf9dVnYq 8fY/x9+Y44SYbU7Tv2hfG1jhcFkXThstnt4ho= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=BVFw4EeILMt3hvejn5d8aP4F/DHqbuzaVw4YGQefP6vXF9B2NC6vhCtT0qQY4d7HEM /HEojIlAzxYbC++PgjAjfSqU1aHEJQsfypf9lxCP9duMzAx2ddOQTj29Q+iddv5k23MH Hl0QPwK+WRsm/w9JFJ3TrHVXulVenxqdbj+PI= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.224.43.136 with SMTP id w8mr1560265qae.209.1267652911375; Wed, 03 Mar 2010 13:48:31 -0800 (PST) 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> Date: Wed, 3 Mar 2010 22:48:31 +0100 X-Google-Sender-Auth: 392640e6d5408892 Message-ID: <3bbf2fe11003031348q4c1fcccfxd19da32875b43f56@mail.gmail.com> From: Attilio Rao To: Ed Maste Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-scsi@freebsd.org, Matthew Jacob Subject: Re: How is supposed to be protected the units list? X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 03 Mar 2010 21:48:39 -0000 2010/3/3 Ed Maste : > 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