From owner-freebsd-scsi@FreeBSD.ORG Tue Mar 2 15:34:41 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 D76C8106564A for ; Tue, 2 Mar 2010 15:34:41 +0000 (UTC) (envelope-from mj@feral.com) Received: from ns1.feral.com (ns1.feral.com [192.67.166.1]) by mx1.freebsd.org (Postfix) with ESMTP id B28458FC14 for ; Tue, 2 Mar 2010 15:34:41 +0000 (UTC) Received: from [192.168.0.101] (m206-63.dsl.tsoft.com [198.144.206.63]) by ns1.feral.com (8.14.3/8.14.3) with ESMTP id o22FYf30009394 for ; Tue, 2 Mar 2010 07:34:41 -0800 (PST) (envelope-from mj@feral.com) Message-ID: <4B8D3016.2070301@feral.com> Date: Tue, 02 Mar 2010 07:34:46 -0800 From: Matthew Jacob User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.8) Gecko/20100216 Thunderbird/3.0.2 MIME-Version: 1.0 To: freebsd-scsi@freebsd.org References: <3bbf2fe11002281655i61a5f0a0if3f381ad0c4a1ef8@mail.gmail.com> <3bbf2fe11003020724m14bebf74y9fa3906418b7cf11@mail.gmail.com> In-Reply-To: <3bbf2fe11003020724m14bebf74y9fa3906418b7cf11@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Greylist: Default is to whitelist mail, not delayed by milter-greylist-4.2.3 (ns1.feral.com [192.67.166.1]); Tue, 02 Mar 2010 07:34:41 -0800 (PST) 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: Tue, 02 Mar 2010 15:34:41 -0000 I will admit to not looking at this stuff closely. But I'll also test with this today and give back an opinion. I would really like to hear Scott, Ken, Alexander or Justin express an opinion on this. > 2010/3/1 Attilio Rao: > >> Hello, >> I have a question that I've been unable to reply reading the code. >> Someone could point me to documentation explaining how the unit tailq >> (within a struct periph_driver) is supposed to be locked? >> I'm not sure how it is assured consistency of accesses to the list and >> more important how is ensured that the periphs composing it doesn't go >> away as I don't see any reference bump for objects inserted there. >> > I don't think the lists are protected at all so I made this simple > patch taking advantage by a global lock: > http://www.freebsd.org/~attilio/Sandvine/pdrv/pdrv_lock.diff > > The patch is simple enough but I just test-compiled it (will need some > time to run in a debugging kernel, hope to do tonight) and maybe you > can already give your opinions here. > > Thanks, > Attilio > > >