Received: by 10.223.176.5 with SMTP id f5csp774588wra; Tue, 6 Feb 2018 07:10:47 -0800 (PST) X-Google-Smtp-Source: AH8x225VgzANb2YBH0MPNvbtUipG5jkE7KzKPGw7F2yC/WFsRulJk5oMzHBpg2+AuuLM/1HO/cBC X-Received: by 10.98.34.27 with SMTP id i27mr2734900pfi.43.1517929847591; Tue, 06 Feb 2018 07:10:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517929847; cv=none; d=google.com; s=arc-20160816; b=N7vuJ6P4N//8ReJwnhrseLnY/9DDB/vSoCjM2RsnkRxk0oOfDTY1ftQ2F1te/Qdo6R sA7qmLUzEavno8DdbtUaTulJjhBn8nZzi4GNHzhW7KRenzxLXy0vEJzLJZBjRPILT52P cJQmaU7rIB00LiSrzhmADM1mm0nzjszPEjEgSsiEtdWxKPDjir8cm8+Ea/imLkyKauDI lcZxEHnj6G4OfBtS4ZKwlyPa//ILPPRLnR5hE3BsEMDIDkDykzND9QuiM2ARofWE6ZP2 nUCiqv+VasZ2vZn/C/49LM0Yo9djfm+7eOx8N8AK3xZV4xrEzjtOvyE0bniH14PKEFTl N2Nw== 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=XGULOYgCkf/13GdxSai5Co0k0hDFNvH9nL6F7u/4AfQ=; b=mC0xfpjXuRV9HUl4S3cnpAE2gD9IKa4ZwGJCLrguf7bzBCHneX/1/TZ2yHtXPXiunx 85R+ZLth/LhajuNqOBQ5jGU9Xf+jfYWalyjBmjwp4K+a0nuQ2fYn3xVRL3FCp+7aYTVv LxKzV7hRhh0yrm3wkn+7Zo44vpNswtHjp3rTCmYtH6wCY59G22jPNiQYeEignmoPVNiO XLmg/Pi4G/WblDK6En9PEFnLWy38SswFxUTFBtWx8t7+hNQljXtHxiGOHT6ahJZMpFxE GXUkaUodwzTLHJtgZxmeIxXSjy2Mtb70QK5y6E0I3U89ZgnKcLrDpGje476X3XMIJ6+e qZQg== 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 3-v6si1366616pla.607.2018.02.06.07.10.33; Tue, 06 Feb 2018 07:10:47 -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 S1752517AbeBFPJp (ORCPT + 99 others); Tue, 6 Feb 2018 10:09:45 -0500 Received: from mga12.intel.com ([192.55.52.136]:50493 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752181AbeBFPJk (ORCPT ); Tue, 6 Feb 2018 10:09:40 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Feb 2018 07:09:39 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,469,1511856000"; d="scan'208";a="201800370" Received: from unknown (HELO localhost.localdomain) ([10.232.112.44]) by fmsmga006.fm.intel.com with ESMTP; 06 Feb 2018 07:09:38 -0800 Date: Tue, 6 Feb 2018 08:13:35 -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: <20180206151335.GE31110@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> 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 Tue, Feb 06, 2018 at 09:46:36AM +0800, jianchao.wang wrote: > Hi Keith > > Thanks for your kindly response. > > On 02/05/2018 11:13 PM, Keith Busch wrote: > > but how many requests are you letting enter to their demise by > > freezing on the wrong side of the reset? > > There are only two difference with this patch from the original one. > 1. Don't freeze the queue for the reset case. At the moment, the outstanding requests will be requeued back to blk-mq queues. > The new entered requests during reset will also stay in blk-mq queues. All this requests will not enter into nvme driver layer > due to quiescent request_queues. And they will be issued after the reset is completed successfully. > 2. Drain the request queue before nvme_dev_disable. This is nearly same with the previous rule which will also unquiesce the queue > and let the requests be able to be drained. The only difference is this patch will invoke wait_freeze in nvme_dev_disable instead > of nvme_reset_work. > > We don't sacrifice any request. This patch do the same thing with the previous one and make things clearer. No, what you're proposing is quite different. By "enter", I'm referring to blk_queue_enter. Once a request enters into an hctx, it can not be backed out to re-enter a new hctx if the original one is invalidated. Prior to a reset, all requests that have entered the queue are committed to that hctx, and we can't do anything about that. The only thing we can do is prevent new requests from entering until we're sure that hctx is valid on the other side of the reset.