Skip to contentSkip to conversation

trivial, update the comment in kthread_stop()

PATCH In review Oleg Nesterov 2 participants 2 messages Jun 19, 2009 – Jun 23, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trivial, update the comment in kthread_stop()

"kthreads: rework kthread_stop()"
commit 63706172f332fd3f6e7458ebfb35fa6de9c21dc5 removed the limitation, but forgot to update the comment.

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

kernel/kthread.c +6 -4
@@ -180,10 +180,12 @@ EXPORT_SYMBOL(kthread_bind);
  * @k: thread created by kthread_create().
  *
  * Sets kthread_should_stop() for @k to return true, wakes it, and
- * waits for it to exit.  Your threadfn() must not call do_exit()
- * itself if you use this function!  This can also be called after
- * kthread_create() instead of calling wake_up_process(): the thread
- * will exit without calling threadfn().
+ * waits for it to exit. This can also be called after kthread_create()
+ * instead of calling wake_up_process(): the thread will exit without
+ * calling threadfn().
+ *
+ * If threadfn() may call do_exit() itself, the caller must ensure
+ * task_struct can't go away.
  *
  * Returns the result of threadfn(), or %-EINTR if wake_up_process()
  * was never called.
#1 lore raw
Quoted 8 lines · Oleg Nesterov

"kthreads: rework kthread_stop()"
commit 63706172f332fd3f6e7458ebfb35fa6de9c21dc5 removed the limitation, but forgot to update the comment.

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

Thanks, I've dropped this in my queue with other misc bits, but I really consider you to own kthread these days.

Thanks!
Rusty.