Messages in this thread | | | Date | Mon, 13 Nov 2000 10:33:47 -0500 | From | Jeff Garzik <> | Subject | Re: [PATCH] pcmcia event thread. (fwd) |
| |
David Woodhouse wrote: > jgarzik@mandrakesoft.com said: > > In any case, we -really- need a wait_for_kernel_thread_to_die() > > function. > > up_and_exit() would do it. Or preferably passing the address of the > semaphore as an extra argument to kernel_thread() in the first place.
Any solution which involves a function being called from a kernel thread, and/or passing another arg to a kernel thread, is a non-starter ... See the discussion about timer_exit() a while ago. This sort of thing should be done at a higher level. Not only does that eliminate any possibility of a race between thread function calling MOD_DEC_USE_COUNT/up_and_exit and module unload, but it also allows us to more easily implement wait_for_kernel_thread_to_die() without having to do silly stuff like pass extra args to threads (...modifying the thread API in the process).
IMHO it is possible to solve this in a generic way without having to change the code for every single kernel thread.
Thanks for all the explanation, I think I now understand all the stuff your kernel thread is doing. Your solution sounds like a decent solution for the problem described. I have not looked at the socket driver code observe parse_events() usage, so I cannot say whether your problem description is accurate however :)
Jeff
-- Jeff Garzik | Building 1024 | The chief enemy of creativity is "good" sense MandrakeSoft | -- Picasso - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org Please read the FAQ at http://www.tux.org/lkml/
| |