Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4642203ybp; Mon, 7 Oct 2019 11:29:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzRo2IKXfwooI89AV90AMux/eu9/zJuN/Jx8BywO5OvzJBLSL4YvyhqCtUb3WgX52as0h8I X-Received: by 2002:a50:aa96:: with SMTP id q22mr30152368edc.179.1570472960137; Mon, 07 Oct 2019 11:29:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570472960; cv=none; d=google.com; s=arc-20160816; b=bQCvm8qCHLS1v/yORLDgjVFf+iLUNDDd5bAdkMoiYPFLa0R5xnD762NzS/jns/5ehn uar+xfTkmrKZ3kED3azTdygF7UxZjs+03Mq5//ENq1eRnM2eI/ZDyiZswVbX3vIClILr NCrqkd11XK8eFxtGlkwQ+qo2wiifM4FpL1C4Nf++v1CAXMWckt2T4Z07Uc/LRXfIPsQN ZNa+AxaRYmPPPlos0IRpscgyrpkH+UJTdjBkDWtfSSdHbsLsG39IZVp9qpfYgFGa5UsC ZqU6/6cHTOLeRAV+087NwF3JrhqYrj5djaijiA6OFy9pFBtj/bppz7qQ0HGTsbnmSMQO Tmag== 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:dkim-signature; bh=Nk/Dzfq2JQpevtV5AuK265hBlSGOuUviyvljy4gpVkk=; b=lEXBdd/YGhrUlpn9x9KvvXtVI83bC/BJojvS3y+k41NZ5/+XgiPjVrcmrLVPHgThma JhiHhfLA9LBIMyJLQ7CYcgxzevz78l2dyZdJqcDDtc88syHML9Ii/P2fGXtzHKSZ1+vw NNNcqyDCbn4C2SwBcfvzeJ/pOkOkfGKR1JjGIhQnLXeTS/imTqf8w9xEvRJPsd2bo0O1 44KC7SVkvVWYzwnPCkT1ByMkRsRZXZeN9QFrG9S6V+H3WvkdE2nUWTJIFdKLwz4IrujY 931IdIrI3Pt+fzkO/L0EGy+X8NptC00fi+8f9dpz+F6qtufPr4O6HzCc9tmjGAJF1tX4 OFDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=bo5MCDgq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si2132275ejf.121.2019.10.07.11.28.56; Mon, 07 Oct 2019 11:29:20 -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; dkim=pass header.i=@kernel.org header.s=default header.b=bo5MCDgq; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728452AbfJGS2P (ORCPT + 99 others); Mon, 7 Oct 2019 14:28:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:59778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728081AbfJGS2P (ORCPT ); Mon, 7 Oct 2019 14:28:15 -0400 Received: from C02WT3WMHTD6 (rap-us.hgst.com [199.255.44.250]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3BD1F206BB; Mon, 7 Oct 2019 18:28:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570472894; bh=GCojsMxQn10tgSiueLPPGM61PEMejhrPHTmNDbqeo3I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bo5MCDgqgvG2usng8PEml0Sdlc4SAjEU6X+c6XUEdu/ey+U0elRbqGSAT17xNnuP5 ETyGhtnlNbZsZpOFM1qEz/kwTthmMcd3CQhSvPoEQF1tGi+vqyovP+/7WTe8X2YmQS kLuHZ3p7vjpn/U05sk+oNd7m6LTt4F+wtQklbpug= Date: Mon, 7 Oct 2019 12:28:12 -0600 From: Keith Busch To: Tyler Ramer Cc: Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] nvme-pci: Shutdown when removing dead controller Message-ID: <20191007182812.GB13149@C02WT3WMHTD6> References: <20191007154448.GA3818@C02WT3WMHTD6> <20191007175011.6753-1-tyaramer@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191007175011.6753-1-tyaramer@gmail.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 07, 2019 at 01:50:11PM -0400, Tyler Ramer wrote: > Shutdown the controller when nvme_remove_dead_controller is > reached. > > If nvme_remove_dead_controller() is called, the controller won't > be comming back online, so we should shut it down rather than just > disabling. > > Remove nvme_kill_queues() as nvme_dev_remove() will take care of > unquiescing queues. We do still need to kill the queues, though. The shutdown == true just flushes all pending requests. Killing queues does that too, but it also sets the request_queue to dying, which will terminate syncing any dirty pages. > --- > > Changes since v1: > * Clean up commit message > * Remove nvme_kill_queues() > --- > drivers/nvme/host/pci.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c > index c0808f9eb8ab..68d5fb880d80 100644 > --- a/drivers/nvme/host/pci.c > +++ b/drivers/nvme/host/pci.c > @@ -2509,8 +2509,7 @@ static void nvme_pci_free_ctrl(struct nvme_ctrl *ctrl) > static void nvme_remove_dead_ctrl(struct nvme_dev *dev) > { > nvme_get_ctrl(&dev->ctrl); > - nvme_dev_disable(dev, false); > - nvme_kill_queues(&dev->ctrl); > + nvme_dev_disable(dev, true); > if (!queue_work(nvme_wq, &dev->remove_work)) > nvme_put_ctrl(&dev->ctrl); > } > -- > 2.23.0 >