lkml.org 
[lkml]   [2018]   [May]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: INFO: task hung in blk_queue_enter
From
Date
Bart Van Assche wrote:
> On Wed, 2018-05-16 at 17:16 +0200, Dmitry Vyukov wrote:
> > On Wed, May 16, 2018 at 4:56 PM, Bart Van Assche <Bart.VanAssche@wdc.com> wrote:
> > > On Wed, 2018-05-16 at 22:05 +0900, Tetsuo Handa wrote:
> > > > diff --git a/block/blk-core.c b/block/blk-core.c
> > > > index 85909b4..59e2496 100644
> > > > --- a/block/blk-core.c
> > > > +++ b/block/blk-core.c
> > > > @@ -951,10 +951,10 @@ int blk_queue_enter(struct request_queue *q, blk_mq_req_flags_t flags)
> > > > smp_rmb();
> > > >
> > > > wait_event(q->mq_freeze_wq,
> > > > - (atomic_read(&q->mq_freeze_depth) == 0 &&
> > > > - (preempt || !blk_queue_preempt_only(q))) ||
> > > > + atomic_read(&q->mq_freeze_depth) ||
> > > > + (preempt || !blk_queue_preempt_only(q)) ||
> > > > blk_queue_dying(q));
> > > > - if (blk_queue_dying(q))
> > > > + if (atomic_read(&q->mq_freeze_depth) || blk_queue_dying(q))
> > > > return -ENODEV;
> > > > }
> > > > }
> > >
> > > That change looks wrong to me.
> >
> > Hi Bart,
> >
> > Why does it look wrong to you?
>
> Because that change conflicts with the purpose of queue freezing and also because
> that change would inject I/O errors in code paths that shouldn't inject I/O errors.

But waiting there until atomic_read(&q->mq_freeze_depth) becomes 0 is causing deadlock.
wait_event() never returns is a bug. I think we should not wait for q->mq_freeze_depth.

\
 
 \ /
  Last update: 2018-05-21 23:54    [W:0.117 / U:2.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site