Re: [PATCH 1/2] loop: use a global workqueue

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

 



On Thu, Dec 23, 2021 at 11:37:21PM +0900, Tetsuo Handa wrote:
> > @@ -1115,7 +1107,6 @@ static void __loop_clr_fd(struct loop_device *lo)
> >  	/* freeze request queue during the transition */
> >  	blk_mq_freeze_queue(lo->lo_queue);
> >  
> > -	destroy_workqueue(lo->workqueue);
> 
> is it safe to remove destroy_workqueue() call here?
> 
> >  	spin_lock_irq(&lo->lo_work_lock);
> >  	list_for_each_entry_safe(worker, pos, &lo->idle_worker_list,
> >  				idle_list) {
> 
> destroy_workqueue() implies flush_workqueue() which is creating the lock
> ordering problem. And I think that flush_workqueue() is required for making
> sure that there is no more work to process (i.e. loop_process_work() is
> no longer running) before start deleting idle workers.
> 
> My understanding is that the problem is not the use of a per-device workqueue
> but the need to call flush_workqueue() in order to make sure that all pending
> works are completed.

All the work items are for requests, and the blk_mq_freeze_queue should
take care of flushing them all out.



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux