Subject: Re: MP and device drivers
To: None <>
From: YAMAMOTO Takashi <>
List: tech-smp
Date: 09/20/2006 20:01:20
> On Thu, Sep 07, 2006 at 09:51:25PM +0900, YAMAMOTO Takashi wrote:
> > > - Put wrappers around the devsw entry points (e.g. bdev_strategy(dev, bp)).
> > >   In the MP case these would check d_flag and maybe grab the kernel_lock.
> > >   We'd need to assert that no other locks are already held.
> > 
> > do you have a plan how to make callers mp-safe?
> That's the difficult part and something that I don't have the knowledge or
> time to tackle yet, specifically VFS. My intent with this one change is to
> make it easier to work on making the core MP safe.
> The approach I started with was to one-by-one lock access to the members of
> "struct proc" and "struct lwp", but decided that there was no point
> proceeding without newlock. I'll check in what limited changes I have in
> that area over the next few days.

a concern is that, unless you never enter the driver with biglock held
or you make all higher level interrupt handlers mp-safe beforehand,
what the driver can do will be very limited due to the locking order
constraint with biglock.

> I also think it would be a good idea to have a policy that no new code gets
> committed to (for example) kern/* unless it's MP safe, or the task becomes
> more difficult.

i agree that mp-safeness should be considered when writing new code.