From owner-freebsd-net Sat Sep 23 16:40:12 2000 Delivered-To: freebsd-net@freebsd.org Received: from pike.osd.bsdi.com (pike.osd.bsdi.com [204.216.28.222]) by hub.freebsd.org (Postfix) with ESMTP id 59E7837B43E; Sat, 23 Sep 2000 16:39:45 -0700 (PDT) Received: from foo.osd.bsdi.com (root@foo.osd.bsdi.com [204.216.28.137]) by pike.osd.bsdi.com (8.11.0/8.9.3) with ESMTP id e8NNdMi98638; Sat, 23 Sep 2000 16:39:26 -0700 (PDT) (envelope-from jhb@foo.osd.bsdi.com) Received: (from jhb@localhost) by foo.osd.bsdi.com (8.11.0/8.11.0) id e8NNbqS18868; Sat, 23 Sep 2000 16:37:52 -0700 (PDT) (envelope-from jhb) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <200009232243.QAA19490@berserker.bsdi.com> Date: Sat, 23 Sep 2000 16:37:51 -0700 (PDT) Organization: BSD, Inc. From: John Baldwin To: Chuck Paterson Subject: Re: mbuf system and SMPng Cc: freebsd-arch@FreeBSD.ORG, freebsd-net@FreeBSD.ORG, Bosko Milekic Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org On 23-Sep-00 Chuck Paterson wrote: > > Date: Sat, 23 Sep 2000 14:46:44 -0400 > From: Bosko Milekic > To: Chuck Paterson > Subject: Re: mbuf system and SMPng > cc: freebsd-net@FreeBSD.ORG, freebsd-arch@FreeBSD.ORG > > Bosko Milekic wrote on: Sat, 23 Sep 2000 14:46:44 EDT > > } Indeed, the lock being released before the asleep() being called in > } m_mballoc_wait() is somewhat of a race. I was planning to get rid of the > } asleep/await combo anyway (noted in my journal). In fact, MGET() can be > } called even with the mutex held, it will just result in recursive > } grabbing of the mutex, but it's better to just re-arrange the macro with > } a lower-level one, as you say (I noticed BSD/OS does something like > } this). > } > > One thing to remember about the recursive stuff is that > passing a recursively held mutex to msleep() will not get the > mutex released, it will only release it one time. This means > that you likely won't be able to get a wakeup. This could > be changed, but ->>in general<<- something has gone very wrong > if the mutex passed in to msleep() is recursively held. There > is likely a layer of code that is expecting that its data is protected, > and is not expecting some other process to be able to get at it. Hmm, do we want to add a KASSERT() to msleep() then to verify that the mutex isn't recursed when we release it? > Chuck -- John Baldwin -- http://www.FreeBSD.org/~jhb/ PGP Key: http://www.cslab.vt.edu/~jobaldwi/pgpkey.asc "Power Users Use the Power to Serve!" - http://www.FreeBSD.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message