Received: by 10.223.176.5 with SMTP id f5csp831274wra; Wed, 7 Feb 2018 08:12:29 -0800 (PST) X-Google-Smtp-Source: AH8x226hbH8RsqKl4mxR+T/Pc3GL5RvH0kyUmNfjEtrZRcBsiTDoqlWXc87UtLNl0nStH493QuYC X-Received: by 10.98.107.71 with SMTP id g68mr6428835pfc.96.1518019949395; Wed, 07 Feb 2018 08:12:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518019949; cv=none; d=google.com; s=arc-20160816; b=nZkkJsV1NBPG3q5y8Zey7Cn1ZQucXdasU30p2URrJ0kmZCgGt1JwVGMPkvrZpRavzL aPcmA6i6ZQ350DdQvtosVucRSd0WRoG81Mpx5VYNM1yOmllpz6ErhAIm43OPJ5wbkx4j GyOxP40zHWfmtlfejE/Uf1o0G43z+ME/wsYIySDOQkNxAB9UHCsI/dkNySchi3t7Jw7C ZXv7TmR4ZdXn2EfUN2J6HRU2GbJ8GMzgSkfwaTwrpryLORat1gg7OcAvGCfiiohB2Pgc GuW8fa/ria8L1eoQYKOWpqCAhAPBJHAoX86AKfjBHjj+nZ4MhEkLM+kXyV7MjXoPcgzN gCdA== 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=59JrookSPPv2UR8lTtjY3PvdOav12fIBaWG4NjcqnGI=; b=oCGSs/pWiH5E8RxcJCZTDsG32Y+VgDVApa8cHO6KSeUSrGp3X13Xo2O4/7h8/W2iZT feXw/AX5DH1OYvWLr+0lE+2NvVJHT0VO1ttbTc2Evx5FqSNSHEBDrqH5i92DDlpZJSMH bCcTOyBVNm9tOf0OomfaX4xDDhP0lVQTDdYlQrPiBuj1827EYuXuujPhvqMByzhU61x3 mC0D21bhijZJK3gGYwtGF+r4aEShpiLz4PbiErL7cukndtWqcvePTCADulxQyPn2dXTg Ujr/+B/KH26rKTVUyLdr2nxOZ5ZxWAjv3kQr1WDz4Pp+WKNjW75hRhcn9DvNHAquO8do xJZg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h68si1307502pfa.238.2018.02.07.08.12.15; Wed, 07 Feb 2018 08:12:29 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754718AbeBGQJt (ORCPT + 99 others); Wed, 7 Feb 2018 11:09:49 -0500 Received: from mga17.intel.com ([192.55.52.151]:7523 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754646AbeBGQJs (ORCPT ); Wed, 7 Feb 2018 11:09:48 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2018 08:09:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,473,1511856000"; d="scan'208";a="172458368" Received: from unknown (HELO localhost.localdomain) ([10.232.112.44]) by orsmga004.jf.intel.com with ESMTP; 07 Feb 2018 08:09:46 -0800 Date: Wed, 7 Feb 2018 09:13:45 -0700 From: Keith Busch To: "jianchao.wang" Cc: axboe@fb.com, linux-kernel@vger.kernel.org, hch@lst.de, linux-nvme@lists.infradead.org, sagi@grimberg.me Subject: Re: [PATCH 2/6] nvme-pci: fix the freeze and quiesce for shutdown and reset case Message-ID: <20180207161345.GB1337@localhost.localdomain> References: <1517554849-7802-1-git-send-email-jianchao.w.wang@oracle.com> <1517554849-7802-3-git-send-email-jianchao.w.wang@oracle.com> <20180202182413.GH24417@localhost.localdomain> <20180205151314.GP24417@localhost.localdomain> <20180206151335.GE31110@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.1 (2017-09-22) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 07, 2018 at 10:13:51AM +0800, jianchao.wang wrote: > What's the difference ? Can you please point out. > I have shared my understanding below. > But actually, I don't get the point what's the difference you said. It sounds like you have all the pieces. Just keep this in mind: we don't want to fail IO if we can prevent it. A request is allocated from an hctx pool of tags. Once the request is allocated, it is permently tied to that hctx because that's where its tag came from. If that hctx becomes invalid, the request has to be ended with an error, and we can't do anything about that[*]. Prior to a reset, we currently halt new requests from being allocated by freezing the request queues. We unfreeze the queues after the new state of the hctx's is established. This way all IO requests that were gating on the unfreeze are guaranteed to enter into a valid context. You are proposing to skip freeze on a reset. New requests will then be allocated before we've established the hctx map. Any request allocated will have to be terminated in failure if the hctx is no longer valid once the reset completes. Yes, it's entirely possible today a request allocated prior to the reset may need to be terminated after the reset. There's nothing we can do about those except end them in failure, but we can prevent new ones from sharing the same fate. You are removing that prevention, and that's what I am complaining about. * Future consideration: we recently obtained a way to "steal" bios that looks like it may be used to back out certain types of requests and let the bio create a new one.