[PATCH 0/6 v4] staging: brcm80211: remove kernel_thread()

Nohee Ko noheek at broadcom.com
Tue Oct 12 19:35:01 UTC 2010


First of all, thank you very much for your work.  This patch definitely can address rmmod hang issue. However it still has some flaw in our logic. That is because the way kthread delivers the event is wake_up_process(), and by nature this wake_up_process() cannot guarantee accurate number of events to deliver to target thread.  Good example is that an event gets fired when the target thread is already in STATUS_RUNNING. Then since there is no way this event can get queued up, the event simply can get ignored in some corner cases. On the other hands, looking at the behavior of down_interruptible(), the advantage of this api is it can perfectly guarantee same number of events can propagate the target thread. That is why we opted for kernel_thread ( along with down_interruptible()) rather than kthread at first place.
But since the kernel_thread can be deprecated sooner or later, anyway moving to kthread seems to be inevitable.  

I made a patch to allow to use both of kthread & down_interruptible() and I think it can fulfill the both needs.
I will send the patch in next email.

Thanks
Nohee 

-----Original Message-----
From: jason [mailto:jason at lakedaemon.net] 
Sent: Tuesday, October 12, 2010 7:33 AM
To: Greg KH
Cc: Nohee Ko; Henry Ptasinski; joe at perches.com; jirislaby at gmail.com; devel at linuxdriverproject.org; Brett Rudley; Venkat Rao; Grant Grundler
Subject: Re: [PATCH 0/6 v4] staging: brcm80211: remove kernel_thread()

Greg KH wrote:
> On Mon, Oct 11, 2010 at 06:24:15PM -0700, Nohee Ko wrote:
>> I just found this change has fatal problem. Due to this change
>> there is no way to kill the process which is waiting for the
>> SIGTERM event with down_interruptible().
>> 
>> If you have no objection, I will revert it to kernel_thread and
>> send the patch. Please let me know.
> 
> How about fixing the problem and not going back to kernel_thread, as 
> that is a depreciated interface and could go away any release now.
> 

How does the attached patch look (RFC only)?

thx,

Jason.




More information about the devel mailing list