Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 07 Dec 2000 06:03:54 -0800
From:      Julian Elischer <julian@elischer.org>
To:        Brian Somers <brian@Awfulhak.org>
Cc:        smp@FreeBSD.org, archie@FreeBSD.org
Subject:   Re: Netgraph and SMP
Message-ID:  <3A2F98CA.B3FD1B40@elischer.org>
References:  <200012070201.eB721Yt44116@hak.lan.Awfulhak.org>

next in thread | previous in thread | raw e-mail | index | archive | help
Brian Somers wrote:
> 
> > >
> > >   Inside it's own lock (preventing any other dependent modules from
> > >   appearing), it asks the module if it's ok to unload.
> > >
> > > This is obviously more tricky than it sounds.  We've got to ensure
> > > that if any character device entry points have been created
> > > (make_dev() etc), we block the relevant entry points so that we can
> > > ENODEV if the MOD_UNLOAD works.
> >
> > but what if the process has already entered the driver?
> 
> Then it should hold a lock that fails in the kldload syscall when it
> does a mutex_trylock() on it.  Again, this is somewhere that a read/
> write mutex would be handy.  kldunload ends up trying for the write
> lock while driver entry points try for the read lock.

what happens in the gap between 'looking up the driver'
and getting the lock for the driver?
What if the driver is unloaded in that gap.
This means that every operation via the devsw table needs to gain 
a spinlock or something to keep them apart.

> 
> 
-- 
      __--_|\  Julian Elischer
     /       \ julian@elischer.org
    (   OZ    ) World tour 2000
---> X_.---._/  presently in:  Budapest
            v




To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-smp" in the body of the message




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