From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Subject: Re: [PATCH 1/2] block: export __blk_complete_request To: Ming Lei Cc: Jens Axboe , Christoph Hellwig , James Bottomley , "Martin K. Petersen" , linux-block , Linux SCSI List , Linux Kernel Mailing List References: <1529027847-29085-1-git-send-email-jianchao.w.wang@oracle.com> <3dd3f82a-5b68-f039-3a8a-7c5fe4e24c3e@oracle.com> From: "jianchao.wang" Message-ID: <3970fdc7-52d9-d05b-4118-059d48bf4f2d@oracle.com> Date: Fri, 15 Jun 2018 11:04:02 +0800 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 List-ID: Hi Ming Thanks for your kindly response. On 06/15/2018 10:56 AM, Ming Lei wrote: >>> IMO, ref-counter is just to fix the blk-mq req life recycle issue. >>> It cannot replace the blk_mark_rq_complete which could avoid the race between >>> timeout and io completion path. >> The .timeout return BLK_EH_DONE doesn't always mean the request has been completed. >> Such as scsi-mid layer, its .timeout callback return BLK_EH_DONE but the timed out >> request is still in abort or eh process. What if a completion irq come during that ? > For blk-mq, it is avoided by the atomic state change in > __blk_mq_complete_request(), > that is why I mentioned the question in my last reply. > but blk_mq_check_expired doesn't do that. do I miss anything ? > But what if the timed-out request has been freed by EH? Then seems > req's ref_counter Thanks Jianchao