From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752295AbdLLR0f (ORCPT ); Tue, 12 Dec 2017 12:26:35 -0500 Received: from mail-qt0-f175.google.com ([209.85.216.175]:36786 "EHLO mail-qt0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750853AbdLLR0d (ORCPT ); Tue, 12 Dec 2017 12:26:33 -0500 X-Google-Smtp-Source: ACJfBotQy/rI7/kRgWZLDvk2w6BDNe2PJPTwT24yB2mwbKm3HLcLbU5kd6JiVUmWrZwLvtBmZKZ5pQ== Date: Tue, 12 Dec 2017 09:26:29 -0800 From: Tejun Heo To: "jianchao.wang" Cc: axboe@kernel.dk, linux-kernel@vger.kernel.org, oleg@redhat.com, peterz@infradead.org, kernel-team@fb.com, osandov@fb.com Subject: Re: [PATCH 6/6] blk-mq: remove REQ_ATOM_STARTED Message-ID: <20171212172629.GF3919388@devbig577.frc2.facebook.com> References: <20171209192525.982030-1-tj@kernel.org> <20171209192525.982030-7-tj@kernel.org> <8c52269a-d5a9-d13c-bdb6-8f47cdaed982@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8c52269a-d5a9-d13c-bdb6-8f47cdaed982@oracle.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, again. Sorry, I missed part of your comment in the previous reply. On Tue, Dec 12, 2017 at 06:09:32PM +0800, jianchao.wang wrote: > > static void __blk_mq_requeue_request(struct request *rq) > > { > > @@ -679,7 +672,7 @@ static void __blk_mq_requeue_request(struct request *rq) > > wbt_requeue(q->rq_wb, &rq->issue_stat); > > blk_mq_sched_requeue_request(rq); > > > > - if (test_and_clear_bit(REQ_ATOM_STARTED, &rq->atomic_flags)) { > > + if (blk_mq_rq_state(rq) != MQ_RQ_IDLE) { > > blk_mq_rq_update_state(rq, MQ_RQ_IDLE); > > The MQ_RQ_IDLE looks confused here. It is not freed , but idled. > And when the requeued request is started again, the generation > number will be increased. But it is not a recycle instance of the > request. Maybe another state needed here ? I don't quite follow it. At this point, the request can't be in-flight on the device side and is scheduled for re-submission. I'm not sure the distinction from IDLE is necessary. Am I missing something? Thanks. -- tejun