Search Linux Wireless

Re: [PATCH v2] mac80211_hwsim: don't use WQ_MEM_RECLAIM

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

 



Hello,

On Thu, Jan 25, 2018 at 10:01:26PM +0100, Johannes Berg wrote:
> I guess we should just ask Tejun :-)
> 
> Tejun, the problem was a report that a WQ_MEM_RECLAIM workqueue is
> flushing another that isn't, and it turns out that lots of wireless
> drivers are using WQ_MEM_RECLAIM for some reason.

Yeah, that came up a couple years ago.  IIRC, there wasn't a definite
answer but the sentiment seemed that things like nfs over wireless
should probably considered.  No idea how serious that concern is.

> Arend said:
> > >  > > Maybe a hint in the documentation, that a work item on a WQ_MEM_RECLAIM
> > >  > > queue must not call flush of an !WQ_MEM_RECLAIM queue would be nice.
> > >  > > Maybe it's kind of obvious, but there is also a reminder not to forget
> > >  > > that flag, if a queue may have work items that reclaim memory
> > >  >
> > >  > Yeah, honestly, I'm not really sure either. Clearly we can't set it,
> > >  > but other drivers also set it...

So, anything which can sit in memory reclaim path needs to have that
flag set and having that flag set automatically means that it can't
depend on anything which isn't protected the same way as that'd break
that protection.

> > > That triggered something in my memory. So indeed we use it in brcmfmac
> > > as well. We used create_singlethread_workqueue(), but I wanted to avoid
> > > snprintf and specify the name format so switched to using
> > > alloc_ordered_workqueue() keeping WQ_MEM_RECLAIM as per the macro
> > > definition.
> > 
> > #define create_singlethread_workqueue(name)				\
> > 	alloc_ordered_workqueue("%s", __WQ_LEGACY | WQ_MEM_RECLAIM, name)
> > 
> > > Don't recall why I dropped the __WQ_LEGACY flag though.

The only thing that flag does is disabling the flush dependency check
which is necessary because in the old implementation, all workqueues
were basically WQ_MEM_RECLAIM workqueues leading to spurious
triggering of the warnings.

Thanks.

-- 
tejun



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Wireless Regulations]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux