Received: by 10.223.176.5 with SMTP id f5csp112065wra; Thu, 8 Feb 2018 17:44:09 -0800 (PST) X-Google-Smtp-Source: AH8x226udDeX3DPLIJkD5bScjMV0AER3GRyWwrMswyWz9G1vYXpH9pNvbXCNJHMH1g2HysZHOrxY X-Received: by 10.98.248.3 with SMTP id d3mr757725pfh.163.1518140649359; Thu, 08 Feb 2018 17:44:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518140649; cv=none; d=google.com; s=arc-20160816; b=xClZwH1KZ6chUUvXusEx085clBJxOuLXA4gg4eg0Grc3zpJ4QjBOLZeWT3v4iqpagY a17gQbGPa9b9HsIcf+v1bWiT1IcaJWYEhBuvA8M4xDtkvOXWl0bE2VbyNaO6EzHK5VPo OfPaYgC55GvkQmdh3BzLNLT5uiRg6crAyLhbZw2J4QvRWwtrw/R0aDVYr6Xk/TlOd80L RNKEAC3/wKeKnpYPqgc0L0mECH5Z1JkrBe0jeyk8lXXrAPsXICym38NCi6tD/3e6n/oL vMX8CMRJrLj/3OGlpchBcCzBPPamCiqwxTCpjC8tc34pzBtgMnSYgGHOBTr9UdBz5FW8 swOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=OBZfJtK9hjLbOA3m9uEkPKJkyCkRUpVaW9xnhgvog4w=; b=fy3sN9HTVSuBEd6Wdxke9wq7ihs9Fej8KTpx03EbCOpPXIslXD+4I39YyJYgbMjOtY 6ky/eDPUy/XacOtB29e/zaxMBh6LuRvwBxgVqcdXPPvmCKQc4B2njNpm2iSqO2Ed6f7L dGGSU2Yqit8gC3Onrq5uwPHpHCeVHQxI9x/B3fJEdSMwCpZogC1ZcWnSMxt9x6g1gpWj or5OznYe93zx2sRK1WFOhcWM6ZBnM86RNEgLWORIACsb71zggcBUzJABijaXSu7bqsr8 OEKBsJnF51lTZleNsWDen+VLCOsJf5Tq72ut/7T9+TjJSQ5ExCWfBseaOg5Os36mXqyM xZEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=scjWCPAC; 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=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t13si705824pgs.613.2018.02.08.17.43.55; Thu, 08 Feb 2018 17:44:09 -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; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=scjWCPAC; 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=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752324AbeBIBnP (ORCPT + 99 others); Thu, 8 Feb 2018 20:43:15 -0500 Received: from aserp2130.oracle.com ([141.146.126.79]:52050 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbeBIBnN (ORCPT ); Thu, 8 Feb 2018 20:43:13 -0500 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w191g44O163946; Fri, 9 Feb 2018 01:42:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=OBZfJtK9hjLbOA3m9uEkPKJkyCkRUpVaW9xnhgvog4w=; b=scjWCPACajHRGGxW/SFSr7Ysk1WLZQDBP2Vb8icmiVLWk7n5PJwA/DR8AObv5B8T781N FuCe2MPysc8Rtkv1tJ+9DBcEiDthP/QhQOZjn693YqlbGZ8YBYDvtdAt9vDpmSt3tVFC yTUKDRd1IhZcxEvzBGqZvhmPePApNSaFiEwf11cQOgsQflKri8jGooWteyGT6rSdjR2g xbmH7iVjJMEvjzpwi0Te941LUdoDjZeWRH2e1yLyAqKeSoMoL0OyrXA3XmtsEz6X674+ BuAJM90RXt9I6H4kueJ02rP/8mcD+qt8aaOrhxBijAKm6xpN5dgEOW2aIm+U7M/u7tBE 0w== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2130.oracle.com with ESMTP id 2g126p003d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 09 Feb 2018 01:42:15 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w191gDNH004634 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 9 Feb 2018 01:42:13 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w191gCqP025497; Fri, 9 Feb 2018 01:42:12 GMT Received: from [10.182.69.179] (/10.182.69.179) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 08 Feb 2018 17:42:11 -0800 Subject: Re: [PATCH 2/6] nvme-pci: fix the freeze and quiesce for shutdown and reset case To: Keith Busch Cc: axboe@fb.com, sagi@grimberg.me, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, hch@lst.de References: <20180202182413.GH24417@localhost.localdomain> <20180205151314.GP24417@localhost.localdomain> <20180206151335.GE31110@localhost.localdomain> <20180207161345.GB1337@localhost.localdomain> <1826ebc1-d419-23da-12d4-dd7b1b3fe598@oracle.com> <958cae59-1a01-d60f-822b-cf81cfa31b8f@oracle.com> <20180208151508.GA4797@localhost.localdomain> From: "jianchao.wang" Message-ID: Date: Fri, 9 Feb 2018 09:41:59 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180208151508.GA4797@localhost.localdomain> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8799 signatures=668665 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802090018 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Keith Thanks for your precious time and kindly response. On 02/08/2018 11:15 PM, Keith Busch wrote: > On Thu, Feb 08, 2018 at 10:17:00PM +0800, jianchao.wang wrote: >> There is a dangerous scenario which caused by nvme_wait_freeze in nvme_reset_work. >> please consider it. >> >> nvme_reset_work >> -> nvme_start_queues >> -> nvme_wait_freeze >> >> if the controller no response, we have to rely on the timeout path. >> there are issues below: >> nvme_dev_disable need to be invoked. >> nvme_dev_disable will quiesce queues, cancel and requeue and outstanding requests. >> nvme_reset_work will hang at nvme_wait_freeze > > We used to not requeue timed out commands, so that wasn't a problem > before. Oh well, I'll take a look. > Yes, we indeed don't requeue the timed out commands, but nvme_dev_disable will requeue the other outstanding requests and quiesce the request queues, this will block the nvme_reset_work->nvme_wati_freeze to move forward. As I shared in last email, can we use(or abuse?) blk_set_preempt_only to gate the new bios on generic_make_request ? Freezing queues is good, but wait_freeze in reset_work is a devil. Many thanks Jianchao