Re: possible issue in: Block: use a freezable workqueue for disk-event polling (62d3c5439c534b0e6c653fc63e6d8c67be3a57b1)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 16 Mar 2012, Tejun Heo wrote:

> On Fri, Mar 16, 2012 at 05:10:48PM -0400, Alan Stern wrote:
> > I don't understand.  How would we miss a change of medium if we cancel 
> > the existing work item and resubmit in on a non-freezable workqueue?
> > 
> > If the work item wasn't queued to begin with, cancelling it won't 
> > change anything.  If the work item has already started running, 
> > cancelling it won't do anything.
> > 
> > If the work item is queued but hasn't started running yet (perhaps 
> > because the workqueue is already frozen), the cancel call will succeed 
> > and then the work item will run on the non-freezable workqueue.  In 
> > turn, the freezer will wait until disk_clear_events() finishes, which 
> > means it will wait until the work item finishes.
> > 
> > Either way, the medium change will be detected.  The one danger is that 
> > after the work item is cancelled, some other thread might resubmit it 
> > to the freezable workqueue before it can be put on the non-freezable 
> > workqueue.
> 
> Why not just lock out freezing across that issue / flush section?

Currently there is no way to lock out freezing.  Besides, it may 
already have started.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux