Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp3780781img; Mon, 25 Mar 2019 18:19:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzpA86zRAe+sUS9d6LApx7az5AfSs7D+nsV5Nl6jNpV6I3hiGk+jO6SWZnSpkAA8eZ2JERU X-Received: by 2002:a65:6109:: with SMTP id z9mr730116pgu.419.1553563148951; Mon, 25 Mar 2019 18:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553563148; cv=none; d=google.com; s=arc-20160816; b=B8G0RnCTZEqbGMu9YUcRM3yg/YsnF5LISo6/tanrl8n6NGKkZE0L6jpXyg6U8+J4SK S64/+h/eFCtkGcy0YxoZ7CbIMdmptSBmmC98KFZO83EDxIbYOW4cu8apWvrd0yFR2dVN hjSHxkL2mkUa0458M7HkNR6j/WdVij9NxSsRcM1RHNFVY3wrFpgxekgFopAlUicJPcKI qxHh1DgcQ+z8Riwt1fDu2QbY1HDP9aRCckF/xCpfAvaP0e0rT/zoWMqbtf8bLPH3z2ix 9Rf35gqHq7tKQbDaqSlwZ4vkDtKOJebzatHo5wGRUcSpbpJIP+hM6Y143a60N8N2zxQO Nilg== 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; bh=/Kl0K4H2oLqA9ZCxH7NCR8HsssQuahLQEpvi0trC9h8=; b=jHQxRB/QUPWpn7mdgUAGgs7fTPgvNAZXjBW+YVwDGxIjiGB8EaCQ+NO/iN8h/zl01B gHts4UQkiOOrB/x6ss2HKaV/IapphqbJ0pWLFA9gjjEIofC0ZzY7QTbN15gAXGBynumM 6LIrIbj9nxchCG1r7gYjMhOkwASzJUcQD+83UVgU+vOQXe+onf9qejJOGFBY3ehqcRrh jtvaMAfHYZbLpkMWboR/i5R+kKEvxT2Vy+DJ696Z042pchTaFgwMfjaf8SDpQXhcqyvm rr9fdl9cy6UTFXLWPQANrn1ce9yWL20QRs1DwUYpbU2u//Poi/9WmKBS6oAkQikXu9ix 39sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b="A2+sc/nz"; 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 z3si15279450pgr.90.2019.03.25.18.18.53; Mon, 25 Mar 2019 18:19:08 -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=@oracle.com header.s=corp-2018-07-02 header.b="A2+sc/nz"; 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 S1730426AbfCZBSG (ORCPT + 99 others); Mon, 25 Mar 2019 21:18:06 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:50632 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726553AbfCZBSF (ORCPT ); Mon, 25 Mar 2019 21:18:05 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x2Q1FvgT022959; Tue, 26 Mar 2019 01:17:31 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-2018-07-02; bh=/Kl0K4H2oLqA9ZCxH7NCR8HsssQuahLQEpvi0trC9h8=; b=A2+sc/nzx/vW4i55Lyyr6ggK/XnrmAe+8sjda7zqYwQ5sr5MXYdqLX0EN1bPoacnn/mq f7+0mE9BTh3TdW5TOdXBYTalXlRapkUm9roIf/LGkI/TKLkQb79ySlwmDrKJ4tO2IT1K Hqd1cPk3mHkqYmp9jJ5MxJct8RmMDEwjo6esTLMJsS6d+2WxuqpoGEROqrwuBDVE3bSb roQLVlvgdSJu+iHF16m6xhOD5YGxpgFtL8P9r7ThYneZRzzhk20/KGTxiW0q/KMUdNFS SspYMvT1hfXeaxAcJ9alFCNeaKO/W4sRKwD/S5sp7P3eJZleiT/WwJCVG6mphhyMydN7 ag== Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp2130.oracle.com with ESMTP id 2re6g0qeas-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Mar 2019 01:17:31 +0000 Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id x2Q1HTh8000458 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 26 Mar 2019 01:17:30 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0121.oracle.com (8.14.4/8.13.8) with ESMTP id x2Q1HOFl021687; Tue, 26 Mar 2019 01:17:25 GMT Received: from [10.182.69.118] (/10.182.69.118) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 25 Mar 2019 18:17:24 -0700 Subject: Re: [PATCH V2 7/8] nvme: use blk_mq_queue_tag_inflight_iter To: Keith Busch Cc: axboe@kernel.dk, linux-block@vger.kernel.org, jsmart2021@gmail.com, bvanassche@acm.org, josef@toxicpanda.com, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org, keith.busch@intel.com, hare@suse.de, jthumshirn@suse.de, hch@lst.de, sagi@grimberg.me References: <1553492318-1810-1-git-send-email-jianchao.w.wang@oracle.com> <1553492318-1810-8-git-send-email-jianchao.w.wang@oracle.com> <20190325134917.GA4328@localhost.localdomain> From: "jianchao.wang" Message-ID: <70e14e12-2ffc-37db-dd8f-229bc580546e@oracle.com> Date: Tue, 26 Mar 2019 09:17:24 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190325134917.GA4328@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=9206 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903260007 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Keith On 3/25/19 9:49 PM, Keith Busch wrote: > On Mon, Mar 25, 2019 at 01:38:37PM +0800, Jianchao Wang wrote: >> blk_mq_tagset_inflight_iter is not safe that it could get stale request >> in tags->rqs[]. Use blk_mq_queue_tag_inflight_iter here. A new helper >> interface nvme_iterate_inflight_rqs is introduced to iterate >> all of the ns under a ctrl. > > Nak, NVMe only iterates tags when new requests can't enter, allocated > requests can't dispatch, and dispatched commands can't complete. So > it is perfectly safe to iterate if the driver takes reasonable steps > beforehand. nvme_dev_disable just quiesce and freeze the request_queue, but not drain the enters. So there still could be someone escapes the queue freeze checking and tries to allocate request. > Further, for M tags and N namespaces, we complete teardown > in O(M) time, but this makes in O(M*N) without gaining anything. > Yes, it is indeed inefficient. Thanks Jianchao