RE: kernel_thread vs. zombie

From: Benjamin Herrenschmidt (benh@kernel.crashing.org)
Date: Thu Mar 22 2001 - 10:07:52 EST


>Have a look at:
>http://www.scs.ch/~frey/linux/kernelthreads.html
>I have an example there that starts and stops kernel threads
>from init_module and never produced a zombie.
>I use the same code also to start threads from ioctl and it
>works for me. I tested it on UP and SMP, Intel and Alpha,
>2.2.18 and 2.4.2.

Thanks !

Could you explain me a bit why you need the lock_kernel ? My probe
thread is already protected by some atomic ops, but I'm considering
changing them to semaphores. Is there any need for the bkl to be taken
when calling daemonize or is this just for your own syncronisation needs ?

I don't think you do more than what I currently do to prevent the
zombie (except for the daemonize call, I don't see you changing anything
about the parent thread or whatever).

At first I though daemonize() would do the trick, but I still see
zombies on my tests. I'm running UP now so I don't since my lack
of lock_kernel() could explain it.

Ben.

-
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/



This archive was generated by hypermail 2b29 : Fri Mar 23 2001 - 21:00:17 EST