Re: [PATCH 2/2] blk-mq: Fix request handover from timeout path to normal execution

From: Bart Van Assche
Date: Mon Apr 02 2018 - 17:56:52 EST


On Mon, 2018-04-02 at 14:10 -0700, Tejun Heo wrote:
> On Mon, Apr 02, 2018 at 02:08:37PM -0700, Bart Van Assche wrote:
> > On 04/02/18 12:01, Tejun Heo 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);
> >
> > Hello Tejun,
> >
> > Since this patch fixes one race but introduces another race, is this
> > patch really an improvement?
>
> Oh, that's not a new race. That's the same non-critical race which
> always existed. It's just being documented.

This patch increases the time during which .aborted_gstate == .gstate if the
timeout is reset. Does that increase the chance that a completion will be missed
if the request timeout is reset?

Thanks,

Bart.