Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4461970ybp; Mon, 7 Oct 2019 08:47:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqyh/kQ+hTMxBIhBrIW+1Ba65QpiRK/dotos3eOE/oOPGoQ0QDGuqrgUPCIJy0G8WS/1oAQ2 X-Received: by 2002:aa7:c40c:: with SMTP id j12mr30139362edq.284.1570463251365; Mon, 07 Oct 2019 08:47:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570463251; cv=none; d=google.com; s=arc-20160816; b=e6HvfSRslm6Tu4fmdUzAF3uiUNO2gjoN+NwR65/Z+gXIlCj2gZaGNPZ2A75f00HaZQ kLCGcQuWdiAX/dO/jKKEbEUgtl9bVXblYTmYHT3sirsIlL5QqV1kETjs5vPj2oY23Q5o UIdr8Oc4oKxZYqNUg19nRBEKqMnVTJDSAJPzRIxHCgs4mzU5HABFZXv3PwJmF/Y66Blx qiy6JYhAvEUN0qP0WCMyCn/E4VftimXEKxORVUf3DCVDyGPjwHLqg50QAMETVBIurqWh hNFJN81Lz4UfpbR1p1KvQgXBmncCUevufWC8D1sz8UrdmopVBC1Fa1zRybGHh4x7T8aF lLuQ== 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=9VOkrvssLKRrggQ1WMIAQScbi4KxSWUl8yz/QdEAPLw=; b=F7RRbTBH4CDAL2OnX9jWNPl9HoIRP3UoiYCRzrcbcsnJYH7NvlxhZv9ni7ql1YF0jW adHvKzyXDFdasMEbIq8TkQJL973B0kCl8eTUT2EAVHfz6Zm/41nBTOLUQM0ZUL6rY5Hl MWJtEZtcUYuhyIGyOzT6LZg/7DPsg1kXi9dP/oVxvKjvuuk3LJ9PBGgQ/nitfW7vaLvN e5l85e8LXFd65h5IcDM4JSheHqRWLoMyis83w5hmcaPi5QBuhCoPnvfK/3TC4Y+QGRWi QNczpQWqb23XLt6gw4e7iXEKwTZKjnF95zfLH3rKvebgitFeswie1YWuf2LWLEc3/sUN tU+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iJsQV7x6; 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 pv13si7014132ejb.79.2019.10.07.08.47.06; Mon, 07 Oct 2019 08:47:31 -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=iJsQV7x6; 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 S1728553AbfJGPou (ORCPT + 99 others); Mon, 7 Oct 2019 11:44:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:50934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727791AbfJGPou (ORCPT ); Mon, 7 Oct 2019 11:44:50 -0400 Received: from C02WT3WMHTD6 (unknown [8.36.226.102]) (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 7E70020640; Mon, 7 Oct 2019 15:44:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570463089; bh=7AVcHfK0bWVvjbPHEPoXKNBy22PlFsfUrhaMLwuWDd4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iJsQV7x6ZBiPD5VZEcxKK9/wKGyBDjS3LqOw8dRYjFTV6E10xSlpPPswFT6XLffWr IAf2UukUH0CW3fWCT+BmXqqFdB5SYdrXYnDEAder6sy44MLnZMMXPfdXEnvg5iwL8J Ndikus1/w88Ex9MyuVIw4tNMX3ti/O40TZuXrdNg= Date: Mon, 7 Oct 2019 09:44:48 -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] nvme-pci: Shutdown when removing dead controller Message-ID: <20191007154448.GA3818@C02WT3WMHTD6> References: <20191003191354.GA4481@Serenity> <20191006192109.GA9983@keith-busch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 11:13:12AM -0400, Tyler Ramer wrote: > > Setting the shutdown to true is > > usually just to get the queues flushed, but the nvme_kill_queues() that > > we call accomplishes the same thing. > > The intention of this patch was to clean up another location where > nvme_dev_disable() > is called with shutdown == false, but the device is being removed due > to a failure > condition, so it should be shutdown. > > Perhaps though, given nvme_kill_queues() provides a subset of the > functionality of > nvme_dev_disable() with shutdown == true, we can just use > nvme_dev_disable() and > remove nvme_kill_queues()? > > This will make nvme_remove_dead_ctrl() more in line with nvme_remove(), > nvme_shutdown(), etc. It's fine to use the shutdown == true in this path as well, but I just wanted to understand what problem it was fixing. It doesn't sound like your scenario is going to end up setting CC.SHN, so the only thing the shutdown should accomplish is flushing pending IO, but we already call kill_queues() right after the nvme_dev_disable(), so that part should be okay.