Re: [PATCH] loop: add WQ_MEM_RECLAIM flag to per device workqueue

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

 



Hello,

On Fri, Mar 18, 2022 at 09:05:42PM +0900, Tetsuo Handa wrote:
> But since include/linux/workqueue.h only says
> 
> 	__WQ_LEGACY		= 1 << 18, /* internal: create*_workqueue() */
> 
> , I can't tell when not to specify __WQ_LEGACY and WQ_MEM_RECLAIM together...
> 
> Tejun, what is the intent of this warning? Can the description of __WQ_LEGACY flag
> be updated? I think that the loop module had better reserve one "struct task_struct"
> for each loop device.
> 
> I guess that, in general, waiting for a work in !WQ_MEM_RECLAIM WQ from a
> WQ_MEM_RECLAIM WQ is dangerous because that work may not be able to find
> "struct task_struct" for processing that work. Then, what we should do is to
> create mp->m_sync_workqueue with WQ_MEM_RECLAIM flag added instead of creating
> lo->workqueue with __WQ_LEGACY + WQ_MEM_RECLAIM flags added...
> 
> Is __WQ_LEGACY + WQ_MEM_RECLAIM combination a hack for silencing this warning
> without fixing various WQs used by xfs and other filesystems?

So, create_workqueue() is the deprecated interface and always imples
MEM_RECLAIM because back when the interface was added each wq had a
dedicated worker and there's no way to tell one way or the other. The
warning is telling you to convert the workqueue to the alloc_workqueue()
interface and explicitly use WQ_MEM_RECLAIM flag if the workqueue is gonna
participate in MEM_RECLAIM chain.

Thanks.

-- 
tejun



[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