From owner-freebsd-arch Sun Sep 24 20:31: 0 2000 Delivered-To: freebsd-arch@freebsd.org Received: from smtp02.primenet.com (smtp02.primenet.com [206.165.6.132]) by hub.freebsd.org (Postfix) with ESMTP id 0207937B424; Sun, 24 Sep 2000 20:30:57 -0700 (PDT) Received: (from daemon@localhost) by smtp02.primenet.com (8.9.3/8.9.3) id UAA16383; Sun, 24 Sep 2000 20:27:46 -0700 (MST) Received: from usr05.primenet.com(206.165.6.205) via SMTP by smtp02.primenet.com, id smtpdAAA.TaGOF; Sun Sep 24 20:27:31 2000 Received: (from tlambert@localhost) by usr05.primenet.com (8.8.5/8.8.5) id UAA05163; Sun, 24 Sep 2000 20:30:08 -0700 (MST) From: Terry Lambert Message-Id: <200009250330.UAA05163@usr05.primenet.com> Subject: Re: Mutexes and semaphores (was: cvs commit: src/sys/conf files To: mjacob@feral.com Date: Mon, 25 Sep 2000 03:30:08 +0000 (GMT) Cc: brian@Awfulhak.org (Brian Somers), grog@wantadilla.lemis.com (Greg Lehey), cp@bsdi.com (Chuck Paterson), archie@whistle.com (Archie Cobbs), joerg@cs.waikato.ac.nz (Joerg Micheel), frank@exit.com (Frank Mayhar), jhb@pike.osd.bsdi.com (John Baldwin), markm@FreeBSD.ORG (Mark Murray), FreeBSD-arch@FreeBSD.ORG In-Reply-To: from "Matthew Jacob" at Sep 24, 2000 05:44:17 PM X-Mailer: ELM [version 2.5 PL2] MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > Sure. And when we the network stack and CAM and the VFS layer are re-thought > out to know how to deal with reentrancy, then I'll be happy to have > non-recursive locks. This is easy: mark them non-reentrant. You can either acquire a mutex on descent into them and release it on exit/sleep, or (and this is better), have a per-module mutex that's acquired on the descent/wakeup and released on the ascent, if the flag is present. This will let the modules be corrected on a per FS and per CAM driver basis, while maintaining legacy compatability. We do not need another ethnic clensing of the drivers, such as what we went through when CAM went in, or when the X.25 and ISODE stuff was murdered. > You're missing the point. If you're on Solaris, you are making a mistake in > your coding if you're recursing. If you're on FreeBSD, then too many things > have still to be redesigned to make that claim. I think he understands that, I just think he's unwilling to live with a kludge, which will have no incentive to be de-kludged, as it wouldn't actually not work. It's much better to be able to _know_ what code is OK and what code isn't, instead of pretending that it's all OK, when it's not. Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message