From owner-freebsd-current Fri Sep 27 12:57: 2 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A01AF37B401 for ; Fri, 27 Sep 2002 12:57:00 -0700 (PDT) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id E086343E6A for ; Fri, 27 Sep 2002 12:56:59 -0700 (PDT) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id g8RJuh0U018850 for ; Fri, 27 Sep 2002 21:56:43 +0200 (CEST) (envelope-from phk@critter.freebsd.dk) To: current@freebsd.org Subject: Freedom from Giant for (most^H^H^H^Hsome) driver writers! Date: Fri, 27 Sep 2002 21:56:43 +0200 Message-ID: <18849.1033156603@critter.freebsd.dk> From: Poul-Henning Kamp Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Various people have bugged me for when they could make their drivers Giant-free and this is an attempt to give them a chance to try that. There are *MANY* things to be aware of trying to do this, I'll just list some of them here: 1. Your driver has to be re-entrant on all the cdevsw->d_* functions. I think this is the way we want it to be in the future, but I am not sure. Put a mutex in your softc or something. 2. D_NOGIANT does totally not work out for the d_strategy() call, mainly due to the fact that all sorts of code calls directly through the BUF_STRATGY()/BIO_STRATEGY(), and I dare not DROP_GIANT() in most of those contexts. 3. The interupt calling is not affected by this, consult newbus. 4. It may not even work at all in the first place. We havn't done the VFS locking yet, so dropping giant in specfs may open a pathway to the dungeon-dimensions (this is a bad thing). Poul-Henning ------- Forwarded Message Message-Id: <200209271947.g8RJlxAV019176@freefall.freebsd.org> From: Poul-Henning Kamp Date: Fri, 27 Sep 2002 12:47:59 -0700 (PDT) To: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/sys conf.h src/sys/fs/specfs spec_vnops.c phk 2002/09/27 12:47:59 PDT Modified files: sys/sys conf.h sys/fs/specfs spec_vnops.c Log: Add a D_NOGIANT flag which can be set in a struct cdevsw to indicate that a particular device driver is not Giant-challenged. SPECFS will DROP_GIANT() ... PICKUP_GIANT() around calls to the driver in question. Notice that the interrupt path is not affected by this! This does _NOT_ work for drivers accessed through cdevsw->d_strategy() ie drivers for disk(-like), some tapes, maybe others. Revision Changes Path 1.179 +76 -13 src/sys/fs/specfs/spec_vnops.c 1.149 +1 -0 src/sys/sys/conf.h ------- End of Forwarded Message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message