[lkml]   [2011]   [Jun]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH RESEND] scsi: don't use execute_in_process_context()
On Sat, Apr 30, 2011 at 04:56:02PM +0200, Tejun Heo wrote:
> SCSI is the only subsystem which uses execute_in_process_context() and
> its use is racy against module unload. ie. the reap work is not
> properly flushed and could still be running after the scsi module is
> unloaded.
> Although execute_in_process_context() can be more efficient when the
> caller already has a context, in this case, the call paths are quite
> cold and the difference is practically meaningless. With commit
> c8efcc25 (workqueue: allow chained queueing during destruction), the
> race condition can easily be fixed by using a dedicated workqueue and
> destroying it on module unload.
> Create and use scsi_wq instead of execute_in_process_context().
> * scsi_device->ew is replaced with release_work. scsi_target->ew is
> replaced with reap_work.
> * Both works are initialized with the respective release/reap function
> during device/target init. scsi_target_reap_usercontext() is moved
> upwards to avoid needing forward declaration.
> * scsi_alloc_target() now explicitly flushes the reap_work of the
> found dying target before putting it instead of depending on
> flush_scheduled_work().
> For more info on the issues, please read the following threads.
> Signed-off-by: Tejun Heo <>
> Cc: Steven Whitehouse <>

James, ping?


 \ /
  Last update: 2011-06-15 12:21    [W:0.044 / U:3.784 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site