Re: [PATCH] workqueue: warn if memory reclaim tries to flush !WQ_MEM_RECLAIM workqueue

From: Tejun Heo
Date: Fri Mar 11 2016 - 12:52:26 EST


Hello,

On Thu, Mar 10, 2016 at 05:12:54PM +0200, Adrian Hunter wrote:
> > @@ -2711,6 +2744,8 @@ static bool start_flush_work(struct work
> > pwq = worker->current_pwq;
> > }
> >
> > + check_flush_dependency(pwq->wq, work);
> > +
> > insert_wq_barrier(pwq, barr, work, worker);
> > spin_unlock_irq(&pool->lock);
>
> I am hitting the warnings when using cancel_delayed_work_sync(). I would
> have thought that forward progress would still be guaranteed in that case.
> Is it true that it is not?

I'm not sure I understand what you're trying to say. If you're trying
to do cancel_delayed_work_sync() from a memreclaim wq on a work item
which is executing on !memreclaim wq, that'd be an incorrect thing to
do as that can deadlock the memreclaim wq under memory pressure.

Thanks.

--
tejun