Re: [PATCH] firewire: sbp2: parallelize login/inquiry, reconnect,and shutdown

From: Tejun Heo
Date: Tue Oct 12 2010 - 09:50:52 EST


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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/