Re: Stopping Kernel Threads at module unload time

From: Aritz Bastida
Date: Wed Nov 09 2005 - 11:56:28 EST


Hello,

> This is how the kernel thread is stopped.
>
> if(info->pid)
> {
> (void)kill_proc(info->pid, SIGTERM, 1);
> wait_for_completion(&info->quit);
> }
>

I actually would prefer to do it with the new kernel thread API.
So, to create the thread: kthread_create
bind it to a cpu: kthread_bind
stop it: kthread_stop

Now, if I call kthread_stop() in module unload time, does that code
run in user process context just like system calls do? That is
important, because if it cannot sleep, it would deadlock.
-
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/