Re: [PATCH][USBATM]: convert heavy init dances to kthread API

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Pavel Emelyanov <xemul@...>
Cc: <linux-usb@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Wednesday, February 6, 2008 - 1:20 pm

Hi,


that would be me (though since I haven't used this modem in years I would
be more than happy to hand it off to someone else).


I will try to find where I put my old modem and test your patch this weekend.


One reason the completion existed to make sure that the thread was not
sent SIGTERM before the above call to allow_signal(SIGTERM).  So I think
you have opened up a (tiny) race by deleting it.


Please don't delete this message.


Does the kthread API guarantee that the kthread is not running until you call
wake_up_process?  Because if not then what is to stop the kthread finishing before
this thread does "instance->thread = t", resulting in an attempt to send a signal
to a dead process later on in disconnect?

Otherwise it looks fine - thanks!

By the way, the right thing to do is (I think) to replace the thread with a workqueue
and have users of usbatm register a "shut_down" callback rather than using signals: the
disconnect method would call shut_down rathering than trying to kill the thread.  That
way all this mucking around with pids etc wouldn't be needed.  All users of usbatm would
need to be modified.  I managed to convince myself once that they could all be fixed up
in a fairly simple manner thanks to a few tricks and a completion or two, but I don't
recall the details...

Best wishes,

Duncan.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH][USBATM]: convert heavy init dances to kthread API, Pavel Emelyanov, (Wed Feb 6, 12:15 pm)
Re: [PATCH][USBATM]: convert heavy init dances to kthread API, Duncan Sands, (Wed Feb 6, 1:20 pm)