update the comment in kthread_stop()

Commit 63706172f332fd3f6e7458ebfb35fa6de9c21dc5 ("kthreads: rework
kthread_stop()") removed the limitation that the thread function mysr
not call do_exit() itself, but forgot to update the comment.

Since that commit it is OK to use kthread_stop() even if kthread can
exit itself.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Oleg Nesterov and committed by
Linus Torvalds
9ae26027 6560dc16

+6 -4
+6 -4
kernel/kthread.c
··· 180 180 * @k: thread created by kthread_create(). 181 181 * 182 182 * Sets kthread_should_stop() for @k to return true, wakes it, and 183 - * waits for it to exit. Your threadfn() must not call do_exit() 184 - * itself if you use this function! This can also be called after 185 - * kthread_create() instead of calling wake_up_process(): the thread 186 - * will exit without calling threadfn(). 183 + * waits for it to exit. This can also be called after kthread_create() 184 + * instead of calling wake_up_process(): the thread will exit without 185 + * calling threadfn(). 186 + * 187 + * If threadfn() may call do_exit() itself, the caller must ensure 188 + * task_struct can't go away. 187 189 * 188 190 * Returns the result of threadfn(), or %-EINTR if wake_up_process() 189 191 * was never called.