Re: 2.6.0-test7-mm1

From: Ben Collins
Date: Wed Oct 15 2003 - 21:27:29 EST


On Wed, Oct 15, 2003 at 10:53:59AM -0700, Andrew Morton wrote:
> Ben Collins <bcollins@xxxxxxxxxx> wrote:
> >
> > > highlevel_add_host() does read_lock() and then proceeds to do things like
> > > starting kernel threads under that lock. The locking is pretty broken
> > > in there :(
> >
> > No, highlevel_add_host() itself doesn't start any threads. But it does
> > pass around data that needs to be locked from changes, and one of the
> > handlers happens to start a thread, and other things allocate memory
> > (such as this case).
> >
> > It's ugly, and I've been trying to clean it up. This case can be fixed
> > quickly with a simple check in hpsb_create_hostinfo() to pass GFP_ATOMIC
> > to kmalloc.
>
> nodemgr_add_host() looks like the hard one. Maybe make hl_drivers_lock a
> sleeping lock?

Problem is, things like bus resets happen in interrupt, and while I can
push off some things to occur in the nodemgr thread, a lot of other
stuff has to happen in the interrupt, and they require the same lock.

It's all a matter of just tossing out my todo list for a good week and
redoing all of this logic from the ground up. I have high hopes this
will happen in the next few weeks, but I'm not signing any contracts to
hold me to it :)

> > My problem right now, is I don't use any architectures that support
> > preempt, so I don't see a lot of these problems, like I catch with
> > CONFIG_SMP.
>
> Anton had a ppc64 patch which implemented the preempt_count beancounting
> without actually implementing premption. So might_sleep() does the right
> thing.

I might have to dig that out and try to make use of it. Thanks for the
pointer.

--
Debian - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
WatchGuard - http://www.watchguard.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/