On Sun, Apr 22, 2007 at 09:12:55PM -0600, Eric W. Biederman wrote:
I don't think having to parallel APIs is a good idea, people will
get utterly confused which one to use. Better always grab a reference
in kthread_create and drop it in kthread_stop. For normal thread
no change in behaviour and only slightly more code in the slowpath.
Of course it will need an audit for half-assed kthread conversion
first to avoid task_struct reference count leaks.
In addition to that kthrad_end implementation look wrong. When
the kthread has exited prematurely no one will call complete
on kthread_stop_info.done before it's been setup. Interestingly
the comment there indicates someone thought about threads exiting
early, but it became defunkt during all the rewrites of the
kthread code.
-