[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1515445614.2909.18.camel@wdc.com>
Date: Mon, 8 Jan 2018 21:06:55 +0000
From: Bart Van Assche <Bart.VanAssche@....com>
To: "jbacik@...com" <jbacik@...com>, "tj@...nel.org" <tj@...nel.org>,
"jack@...e.cz" <jack@...e.cz>, "clm@...com" <clm@...com>,
"axboe@...nel.dk" <axboe@...nel.dk>
CC: "kernel-team@...com" <kernel-team@...com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"peterz@...radead.org" <peterz@...radead.org>,
"linux-btrfs@...r.kernel.org" <linux-btrfs@...r.kernel.org>,
"linux-block@...r.kernel.org" <linux-block@...r.kernel.org>,
"jianchao.w.wang@...cle.com" <jianchao.w.wang@...cle.com>,
"hch@....de" <hch@....de>
Subject: Re: [PATCH 3/8] blk-mq: replace timeout synchronization with a RCU
and generation based scheme
On Mon, 2018-01-08 at 11:15 -0800, Tejun Heo wrote:
> +static void blk_mq_rq_update_aborted_gstate(struct request *rq, u64 gstate)
> +{
> + unsigned long flags;
> +
> + local_irq_save(flags);
> + u64_stats_update_begin(&rq->aborted_gstate_sync);
> + rq->aborted_gstate = gstate;
> + u64_stats_update_end(&rq->aborted_gstate_sync);
> + local_irq_restore(flags);
> +}
Please add a comment that explains the purpose of local_irq_save() and
local_irq_restore(). Please also explain why you chose to disable interrupts
instead of disabling preemption. I think that disabling preemption should be
sufficient since this is the only code that updates rq->aborted_gstate and
since this function is always called from thread context.
> @@ -801,6 +840,12 @@ void blk_mq_rq_timed_out(struct request *req, bool reserved)
> __blk_mq_complete_request(req);
> break;
> case BLK_EH_RESET_TIMER:
> + /*
> + * As nothing prevents from completion happening while
> + * ->aborted_gstate is set, this may lead to ignored
> + * completions and further spurious timeouts.
> + */
> + blk_mq_rq_update_aborted_gstate(req, 0);
> blk_add_timer(req);
> blk_clear_rq_complete(req);
> break;
Is the race that the comment refers to addressed by one of the later patches?
Thanks,
Bart.
Powered by blists - more mailing lists