* [PATCH] trivial, update the comment in kthread_stop()
@ 2009-06-19 0:51 Oleg Nesterov
2009-06-23 3:51 ` Rusty Russell
0 siblings, 1 reply; 2+ messages in thread
From: Oleg Nesterov @ 2009-06-19 0:51 UTC (permalink / raw)
To: Andrew Morton; +Cc: Rusty Russell, linux-kernel
"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.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
--- a/kernel/kthread.c
+++ b/kernel/kthread.c
@@ -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.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] trivial, update the comment in kthread_stop()
2009-06-19 0:51 [PATCH] trivial, update the comment in kthread_stop() Oleg Nesterov
@ 2009-06-23 3:51 ` Rusty Russell
0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2009-06-23 3:51 UTC (permalink / raw)
To: Oleg Nesterov; +Cc: Andrew Morton, linux-kernel
On Fri, 19 Jun 2009 10:21:13 am Oleg Nesterov wrote:
> "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.
>
> Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Thanks, I've dropped this in my queue with other misc bits, but I really
consider you to own kthread these days.
Thanks!
Rusty.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-06-23 3:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-06-19 0:51 [PATCH] trivial, update the comment in kthread_stop() Oleg Nesterov
2009-06-23 3:51 ` Rusty Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox