Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Sep 2002 21:56:43 +0200
From:      Poul-Henning Kamp <phk@critter.freebsd.dk>
To:        current@freebsd.org
Subject:   Freedom from Giant for (most^H^H^H^Hsome) driver writers!
Message-ID:  <18849.1033156603@critter.freebsd.dk>

next in thread | raw e-mail | index | archive | help

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 <phk@FreeBSD.org>
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18849.1033156603>