From owner-freebsd-scsi@FreeBSD.ORG Wed Mar 3 21:56:27 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 0531A1065675 for ; Wed, 3 Mar 2010 21:56:27 +0000 (UTC) (envelope-from emaste@freebsd.org) Received: from mail2.sandvine.com (Mail1.sandvine.com [64.7.137.134]) by mx1.freebsd.org (Postfix) with ESMTP id C23F58FC14 for ; Wed, 3 Mar 2010 21:56:26 +0000 (UTC) Received: from labgw2.phaedrus.sandvine.com ([192.168.3.11]) by mail2.sandvine.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 3 Mar 2010 16:44:17 -0500 Received: by labgw2.phaedrus.sandvine.com (Postfix, from userid 10332) id 557D311653; Wed, 3 Mar 2010 16:44:24 -0500 (EST) Date: Wed, 3 Mar 2010 16:44:24 -0500 From: Ed Maste To: Attilio Rao Message-ID: <20100303214424.GA53790@sandvine.com> References: <3bbf2fe11002281655i61a5f0a0if3f381ad0c4a1ef8@mail.gmail.com> <3bbf2fe11003020724m14bebf74y9fa3906418b7cf11@mail.gmail.com> <4B8D3016.2070301@feral.com> <3bbf2fe11003031334g4591c1a3lc52dfb898f728ee2@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3bbf2fe11003031334g4591c1a3lc52dfb898f728ee2@mail.gmail.com> User-Agent: Mutt/1.4.2.1i X-OriginalArrivalTime: 03 Mar 2010 21:44:17.0850 (UTC) FILETIME=[ACF101A0:01CABB1A] 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:56:27 -0000 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) Regards, Ed