Messages in this thread | | | Date | Tue, 12 Oct 2010 15:50:27 +0200 | From | Tejun Heo <> | Subject | Re: [PATCH] firewire: sbp2: parallelize login/inquiry, reconnect, and shutdown |
| |
Hello,
On 10/11/2010 11:27 PM, Stefan Richter wrote: >> Hmmm... from glancing the code, there doesn't seem to anything which >> can guarantee sbp2_release_target/reconnect() are finished before >> sbp2_cleanup() returns, so the code section might go away with code >> still running. It seems like the right thing to do here would be >> using alloc_workqueue(KBUILD_MODNAME, WQ_NON_REENTRANT, 0). Am I >> missing something? > > There are indeed situations where the last module reference was already > put down before the work is run for the last time. Thanks for the hint. > > What is preferable, an own workqueue instance whose destroy_workqueue() > lets sbp2_cleanup wait for unfinished work, or module ref-counting like > below?
The best would be flushing the specific works but that isn't possible when works are used to do the final put. I would go for using a separate workqueue. With cmwq, each workqueue is much cheaper than before anyway.
Thanks.
-- tejun
| |