Contrary to the statement in this article,
kthread_stop() doesn't send a signal to the kernel thread. It just causes
kthread_should_stop() to return
TRUE when it is called by the specified thread. This means that (for example) a thread which is blocked in
down_interruptible() will not be woken as it would be by a signal. A thread that is to be stopped must call
It should also be noted that calls to
kthread_stop() are serialized. This means that a thread that does not call
kthread_should_stop() frequently could cause a delay in stopping other threads. A kernel thread that could be the target of
kthread_stop() should be very cautious about calling
kthread_stop(), as there is a potential for deadlock.
Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds