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

Sure your original question was about how to properly stopa kernel thread prior to module removal. This, I showed you.Now you say you "prefer" to do it some other way. Good luck.Unless your code runs exactly like the prototype that thenew macros were written for, you may have fix the macros.

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

Not relevent. You have apparently made up your mind that youneed to do it "your" way. Fine.

Cheers,Dick JohnsonPenguin : Linux version 2.6.13.4 on an i686 machine (5589.55 BogoMips).Warning : 98.36% of all statistics are fiction..

****************************************************************The information transmitted in this message is confidential and may be privileged. Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited. If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.Thank you.-To unsubscribe from this list: send the line "unsubscribe linux-kernel" inthe body of a message to majordomo@vger.kernel.orgMore majordomo info at http://vger.kernel.org/majordomo-info.htmlPlease read the FAQ at http://www.tux.org/lkml/