Subject: Re: MP and device drivers
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: Andrew Doran <ad@netbsd.org>
List: tech-smp
Date: 09/07/2006 14:38:11
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.

If I remember correctly, the FreeBSD guys produced a chart with a list of
things that needed to be done, who was working on it, etc. I think that's a
good idea. I'd be happy to produce a first version of that with some high
level tasks on it, maybe next week. If somebody else wants to go ahead and
do that, or discuss here that would be great too.

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.

What do you think? Do you have other ideas or suggestions?

Thanks,
Andrew