Received: by 10.192.165.156 with SMTP id m28csp175461imm; Tue, 17 Apr 2018 08:19:45 -0700 (PDT) X-Google-Smtp-Source: AIpwx48rpj4F8WsQc9JV5BVzOzw6ySYhaFHCwdIbkFMdniIzkroBHlkzEfGBlBBDgDPRv0SrCkjT X-Received: by 10.99.65.6 with SMTP id o6mr2180175pga.57.1523978385881; Tue, 17 Apr 2018 08:19:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523978385; cv=none; d=google.com; s=arc-20160816; b=0GbGrNlv4gfqG0Y0J2WQjfNePz17tAPM2V2F273jmZaBxe3EjHS4eDtYymfYQW2npC J2lhxXnt035nOQ6AHDUOxyifD/eVivRAPV9ffGr1bnzJhNPfWxGyF6HO/pfR0mj6UXbi mliyJPHP25+QU1BqgTLsKgRUlt6OyqRW5/p4xYkEYVj8dn2KHUen1wHYp+++Usrv6gei IH424sT5AzyJt1VnNIoz4L+WBhk6RRfELsjG8+I6XgVh6Y36BFEs//L15s0P+vr1Rl9h b9WpA1f3698J1AwZaE3LyHTsxWdkM5+omjkM7qIz6i79CDNXA6SnGpRDFD+OElcTBhqa Ma5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=dDM1uCqbBD3aE9FfL+jpxdREPlN+CeQRQsXKeoMscJc=; b=S50akApTrzJ/uh6ll4RZqqYpZQUY8wRIEJOhh5rtYyeGO4H5BZId6aBsx9HjHfynO+ Kzjxul+8IBpJgF8rYq1ucWckvjDGrdLBrP4EjoFMhUawy46z2DDVSOQiYHZzh8M9FL/7 orK7wC2baGs21TbKLeYvyPPJSoV4b9EatK27IiizEJ3PJSVPJXJFRF9QsSIOBUtu55oH 2ChmJ+V1PHYCPtTg4eNMKhayOCLdWSk99muPudnyqMA5XLAx6lrdHBmjFhA7wsRrd/zT J4jNYJuEZ5nxxVrg0HdUEWWC3qejFxrpXpcqXgZtQ0Lw33gTb7XUpCrw+qSx8AQFoSqv qkzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az8-v6si381869plb.153.2018.04.17.08.19.32; Tue, 17 Apr 2018 08:19:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752670AbeDQPRT (ORCPT + 99 others); Tue, 17 Apr 2018 11:17:19 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:47074 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751157AbeDQPRS (ORCPT ); Tue, 17 Apr 2018 11:17:18 -0400 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 mx1.redhat.com (Postfix) with ESMTPS id D96FE7D843; Tue, 17 Apr 2018 15:17:17 +0000 (UTC) Received: from ming.t460p (ovpn-12-49.pek2.redhat.com [10.72.12.49]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 945727C33; Tue, 17 Apr 2018 15:17:06 +0000 (UTC) Date: Tue, 17 Apr 2018 23:17:02 +0800 From: Ming Lei To: Jianchao Wang Cc: keith.busch@intel.com, axboe@fb.com, hch@lst.de, sagi@grimberg.me, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Subject: Re: PATCH V4 0/5 nvme-pci: fixes on nvme_timeout and nvme_dev_disable Message-ID: <20180417151700.GC16286@ming.t460p> References: <1520489971-31174-1-git-send-email-jianchao.w.wang@oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1520489971-31174-1-git-send-email-jianchao.w.wang@oracle.com> User-Agent: Mutt/1.9.1 (2017-09-22) X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 17 Apr 2018 15:17:17 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.2]); Tue, 17 Apr 2018 15:17:17 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'ming.lei@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 08, 2018 at 02:19:26PM +0800, Jianchao Wang wrote: > Firstly, really appreciate Keith and Sagi's precious advice on previous versions. > And this is the version 4. > > Some patches of the previous patchset have been submitted and the left is this patchset > which has been refactored. Please consider it for 4.17. > > The target of this patchset is to avoid nvme_dev_disable to be invoked by nvme_timeout. > As we know, nvme_dev_disable will issue commands on adminq, if the controller no response, > it has to depend on timeout path. However, nvme_timeout will also need to invoke > nvme_dev_disable. This will introduce dangerous circular dependence. Moreover, > nvme_dev_disable is under the shutdown_lock, even when it go to sleep, this makes things > worse. > > The basic idea of this patchset is: > - When need to schedule reset_work, hand over expired requests to nvme_dev_disable. They > will be completed after the controller is disabled/shtudown. > > - When requests from nvme_dev_disable and nvme_reset_work expires, disable the controller > directly then the request could be completed to wakeup the waiter. > > The 'disable the controller directly' here means that it doesn't send commands on adminq. > A new interface is introduced for this, nvme_pci_disable_ctrl_directly. More details, > please refer to the comment of the function. > > Then nvme_timeout doesn't depends on nvme_dev_disable any more. > > Because there is big difference from previous version, and some relatively independent patches > have been submitted, so I just reserve the key part of previous version change log following. > > Change V3->V4 > - refactor the interfaces flushing in-flight requests and add them to nvme core. > - refactor the nvme_timeout to make it more clearly > > Change V2->V3: > - discard the patch which unfreeze the queue after nvme_dev_disable > > Changes V1->V2: > - disable PCI controller bus master in nvme_pci_disable_ctrl_directly > > There are 5 patches: > 1st one is to change the operations on nvme_request->flags to atomic operations, then we could introduce > another NVME_REQ_ABORTED next. > 2nd patch introduce two new interfaces to flush in-flight requests in nvme core. > 3rd patch is to avoid the nvme_dev_disable in nvme_timeout, it introduce new interface nvme_pci_disable_ctrl_directly > and refactor the nvme_timeout > 4th~5th is to fix issues introduced after 3rd patch. > > Jianchao Wang (5) > 0001-nvme-do-atomically-bit-operations-on-nvme_request.fl.patch > 0002-nvme-add-helper-interface-to-flush-in-flight-request.patch > 0003-nvme-pci-avoid-nvme_dev_disable-to-be-invoked-in-nvm.patch > 0004-nvme-pci-discard-wait-timeout-when-delete-cq-sq.patch > 0005-nvme-pci-add-the-timeout-case-for-DELETEING-state.patch > > diff stat > drivers/nvme/host/core.c | 96 +++++++++++++++++++++++++++++++++++++++++++++++ > drivers/nvme/host/nvme.h | 4 +- > drivers/nvme/host/pci.c | 224 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------- > Hi Jianchao, Looks blktest(block/011) can trigger IO hang easily on NVMe PCI device, and all are related with nvme_dev_disable(): 1) admin queue may be disabled by nvme_dev_disable() from timeout path during resetting, then reset can't move on 2) the nvme_dev_disable() called from nvme_reset_work() may cause double completion on timed-out request So could you share us what your plan is about this patchset? Thanks, Ming