Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B612EEB64D9 for ; Thu, 15 Jun 2023 15:44:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=F60AvhA0FMiJNRtBO0yYLpZvFzJjensEGvAZvskekGI=; b=42i+7z9cbSiXIoI6hc0thX2gdT AG96yg5Nn5/4T/Tp5KlREyUXqb6i7HCs35Wfld8ydikkZA4pPH8Y22a6CA8foH7WcfaPRzwiCYYgP 2PJMyYmKpd0SRzrnzBTYceuH2pOtNWMU2FpkWChr4LSmOwI8W5xQSBgMUFI5prQYtNwOFSq9QC4og kmXwpnX/4gitgHGnIcDEkD7yBAH46DDck2W3/JXvSUXC0DSh2kIhbDSO27oW3u5iads9mUQR8q6Kr Rtnyt+wedPVC+uOm3eSMwGFObsY2qBZbsgljGspM+imDva8onTvQFBGE1QhrLSDTFd3YcTKVGCvIf z8UvjgVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q9p98-00FKNs-00; Thu, 15 Jun 2023 15:44:26 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q9p94-00FKNJ-13 for linux-nvme@lists.infradead.org; Thu, 15 Jun 2023 15:44:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686843860; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=F60AvhA0FMiJNRtBO0yYLpZvFzJjensEGvAZvskekGI=; b=ZtlQBg2cJKBZWCYb3vAAjIF7z6nI47sQe9Kp6xyuqePmYa6Km04xx0GlBSvs+dtz6Cc3Nc YwYiLzqo5Muqk+dUOfVCEHKcpOXHMoZecy53wZUT+aQjPIF8wkGkNb4nPraZKmdfGQIKZH 34r1NQolOLEbyIpdKZeJBRB5ObBln0k= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-452-HHAVvWZwMkKt4IOOcyr_Iw-1; Thu, 15 Jun 2023 11:44:15 -0400 X-MC-Unique: HHAVvWZwMkKt4IOOcyr_Iw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC0EE2999B53; Thu, 15 Jun 2023 15:44:01 +0000 (UTC) Received: from ovpn-8-16.pek2.redhat.com (ovpn-8-17.pek2.redhat.com [10.72.8.17]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0C2C71C558; Thu, 15 Jun 2023 15:43:56 +0000 (UTC) Date: Thu, 15 Jun 2023 23:43:51 +0800 From: Ming Lei To: Keith Busch Cc: Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, Yi Zhang , linux-block@vger.kernel.org, Chunguang Xu Subject: Re: [PATCH 1/4] blk-mq: add API of blk_mq_unfreeze_queue_force Message-ID: References: <20230615143236.297456-1-ming.lei@redhat.com> <20230615143236.297456-2-ming.lei@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230615_084422_797518_B50D76C0 X-CRM114-Status: GOOD ( 14.97 ) X-BeenThere: linux-nvme@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-nvme" Errors-To: linux-nvme-bounces+linux-nvme=archiver.kernel.org@lists.infradead.org On Thu, Jun 15, 2023 at 09:16:27AM -0600, Keith Busch wrote: > On Thu, Jun 15, 2023 at 10:32:33PM +0800, Ming Lei wrote: > > NVMe calls freeze/unfreeze in different contexts, and controller removal > > may break in-progress error recovery, then leave queues in frozen state. > > So cause IO hang in del_gendisk() because pending writeback IOs are > > still waited in bio_queue_enter(). > > Shouldn't those writebacks be unblocked by the existing check in > bio_queue_enter, test_bit(GD_DEAD, &disk->state))? Or are we missing a > disk state update or wakeup on this condition? GD_DEAD is only set if the device is really dead, then all pending IO will be failed. We need to try to handle these IOs first if device isn't set as dead by calling blk_mark_disk_dead(). Thanks, Ming