Skip site navigation (1)Skip section navigation (2)
Date:      04 Jun 2003 12:09:00 +0100
From:      Doug Rabson <dfr@nlsystems.com>
To:        Paul Richards <paul@freebsd-services.com>
Cc:        "M. Warner Losh" <imp@bsdimp.com>
Subject:   Re: VFS: C99 sparse format for struct vfsops
Message-ID:  <1054724940.32568.6.camel@builder02.qubesoft.com>
In-Reply-To: <1054584260.85972.26.camel@cf.freebsd-services.com>
References:  <20030603134717.GD35187@survey.codeburst.net> <20030603.085659.13314075.imp@bsdimp.com> <20030603155157.GH35187@survey.codeburst.net> <20030603.111956.46316212.imp@bsdimp.com> <1054584260.85972.26.camel@cf.freebsd-services.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 2003-06-02 at 21:04, Paul Richards wrote:
> On Tue, 2003-06-03 at 18:19, M. Warner Losh wrote:
> > 
> > Notice how thread 1's _m gets set based on the results of the kobj
> > lookup, and we have a race, even if thread1 and thread2 took out their
> > driver instance locks.
> 
> That means we have to lock the dispatch table before every method is
> looked up and hold it until the method returns (the alternative would be
> to free it inside the method once it had been called but that'd be a
> right mess).

Don't even think about trying to put a mutex into the kobj dispatch
sequence. That would make the call several thousand times slower. We
might as well write the kernel in Visual Basic. I've been thinking about
this problem for a long time and I'm certain there is a way to make this
safe without sacrificing performance.

I have an idea I'm working on right now which should work (at least I
haven't managed to disprove it so far) and which would have
approximately the same performance profile as the current mechanism.




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