Re: kernel_thread() & thread starting

Philipp Rumpf (prumpf@mandrakesoft.com)
Mon, 19 Feb 2001 07:50:54 -0600 (CST)


On Mon, 19 Feb 2001, Andrew Morton wrote:
> David Woodhouse wrote:
> > prumpf@mandrakesoft.com said:
> > > Why bother ? It looks like a leftover debugging message which
> > > doesn't make a lot of sense once the code is stable (what might make
> > > sense is checking keventd is still around, but that's not what the
> > > code is doing).
>
> keventd *must* still be around.

So put in the reliable check for it:

in start_context_thread:
while (!keventd_task)
schedule();

in need_keventd:
for_each_task(tsk) {
if (tsk == keventd_task) {
if (tsk->mm == NULL && strcmp(tsk->comm, "keventd") == 0)
return 1;
}
}

printk("eek.");

return 0;

> And the code obviously isn't completely stable, and this debug
> message has found something rather unpleasant.

So removing the debug code completely (which is what your patch does)
doesn't sound like the right thing.

> I don't think we should run the init tasks when keventd may, or
> may not be running. Sure, the current code does, by happenstance,
> all work correctly when keventd hasn't yet started running, and
> when it's starting up. But it's safer, saner and surer just
> to crank the damn thing up before proceeding.

Agreed. The code snippet above should do that, no ?

> I believe the right thing to do here is the RMK approach.

That still won't catch keventd oopsing though - which I think might happen
quite easily in real life.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/