lkml.org 
[lkml]   [2018]   [Apr]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 2/2] blk-mq: Fix request handover from timeout path to normal execution
Hello,

On Mon, Apr 02, 2018 at 09:31:34PM +0000, Bart Van Assche wrote:
> > > > + * As nothing prevents from completion happening while
> > > > + * ->aborted_gstate is set, this may lead to ignored completions
> > > > + * and further spurious timeouts.
> > > > + */
> > > > + if (rq->rq_flags & RQF_MQ_TIMEOUT_RESET)
> > > > + blk_mq_rq_update_aborted_gstate(rq, 0);
...
> I think it can happen that the above code sees that (rq->rq_flags &
> RQF_MQ_TIMEOUT_RESET) != 0, that blk_mq_start_request() executes the
> following code:
>
> blk_mq_rq_update_state(rq, MQ_RQ_IN_FLIGHT);
> blk_add_timer(rq);
>
> and that subsequently blk_mq_rq_update_aborted_gstate(rq, 0) is called,
> which will cause the next completion to be lost. Is fixing one occurrence
> of a race and reintroducing it in another code path really an improvement?

I'm not following at all. How would blk_mq_start_request() get called
on the request while it's still owned by the timeout handler? That
gstate clearing is what transfers the ownership back to the
non-timeout path.

Thanks.

--
tejun

\
 
 \ /
  Last update: 2018-04-02 23:40    [W:0.061 / U:9.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site