mutex quandry

M. Warner Losh imp at bsdimp.com
Tue Nov 25 09:22:09 PST 2008


In message: <200811251707.mAPH7JRg090619 at antediluvian.glarp.com>
            Brad Huntting <huntting at glarp.com> writes:
: 
: >: The combination of checking sc_running and incrementing sc_inuse
: >: needs to be atomic (hence a mutex around them) but at some point
: >: detach() has to destroy the mutex but my code may still need to use
: >: it.
: >
: >Your solution to this is to make sure that never happens.  Anything
: >else is really racy.  If you are destroying your mutex and allowing
: >detach to return, the entire sc is freed, so you're dead from that
: >anyway...
: 
: Fair enough.  I guess I was just too focused on my small part of
: the larger system.
: 
: But that brings up another issue.  How do my (kernel level) users
: know if my module is loaded or not?  I cant find any section 9 docs
: on kernal loadable modules.  Am I looking in the wrong place?  Or
: do I just need to read the source.

It should be documented in section 9.  Use level users can do a
kldstat to find this information.  I think kern_kldload will load the
module, but I'm not sure how to get status.  I've cc'd drivers@ to see
if someone there knows.

Warner


More information about the freebsd-drivers mailing list