Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp614700yba; Thu, 18 Apr 2019 06:53:40 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzYc54UUB9Q7uNTBWmhlznmph1xZxSyiIH62bgp4JRzaZv8BEFd4nX2qlvpu93vb+eV+2l X-Received: by 2002:a17:902:26a:: with SMTP id 97mr55801077plc.263.1555595620453; Thu, 18 Apr 2019 06:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555595620; cv=none; d=google.com; s=arc-20160816; b=n04dxf3Ylc07U2COPodAV8TyUafZb+Jx3WkXiiKNCiuq2euYshCPcRokYVV5nLfLr/ OMTc1IY3+c0O1qAZIlyvEAgVUKemio8Ir+lDs/CepxIaSyfkx536EUfgI3ozNv4X3B/p /UxjVrBJYSoP9pB6qvJqby8pnct2sb1IGGa+l+8U0JuQbBjnuhtMqWoTUdcBfeA6MSCs FeT9pTWtFHNQ3Nh4app37MzimDGY3QgZqyHZTykL6ScC04Y8puAdYJCnYMuR0QOuf+Ox jAgySNfA327jHBAJeIAqsHth8H3amCqAp/ZLYhLUFF0+/7FM2UXY4oJ/5e7EpWbt8yl1 A3Pg== 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; bh=xwzbrlAXCj1MrdWKv4htoEepJMc+2cSi/XLKCpiPHcc=; b=nJ8VeufIaqGf2pYPh9oOoOT38RNftlgn+d36I0W5J9mOFijtl972H2TyrTW0LXDK3h E+lEKsMSntTJ2qMpiq/4Qc0nQnDGNr7vlbPKzqZGN9SOfMuFAHBx3iNOV0UmdVWZ75A2 wUzjAso+0H4LzCneBl5Rgjpth+M11Nf/MBhaxPwU3g3UA8MV8ubXTtLtFKPzt4iBREqX s2zGTFU/h5OMvmZ12m2UyOzg8us9qkOKX+Ey1Mw+HLivt2bDCWr/cV7P4Ug3Dfdf0c4u XWC3UJZojilDHoFlPbif2ypz8GCslkRA5nRjfT1dvORt16SYFEMHbFAzI3AJCiEKHxhQ FE7Q== 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 j11si2282655pff.216.2019.04.18.06.53.25; Thu, 18 Apr 2019 06:53:40 -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; 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 S2389170AbfDRNw2 (ORCPT + 99 others); Thu, 18 Apr 2019 09:52:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:46552 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731317AbfDRNw1 (ORCPT ); Thu, 18 Apr 2019 09:52:27 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 5E26FB6AF; Thu, 18 Apr 2019 13:52:26 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 933201E15AE; Thu, 18 Apr 2019 15:52:23 +0200 (CEST) Date: Thu, 18 Apr 2019 15:52:23 +0200 From: Jan Kara To: Kanchan Joshi Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, linux-nvme@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, prakash.v@samsung.com Subject: Re: [PATCH v4 5/7] nvme: register stream info with block layer Message-ID: <20190418135223.GK28541@quack2.suse.cz> References: <1555523406-2380-1-git-send-email-joshi.k@samsung.com> <1555523406-2380-6-git-send-email-joshi.k@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1555523406-2380-6-git-send-email-joshi.k@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 17-04-19 23:20:04, Kanchan Joshi wrote: > Make nvme driver register number of streams with block layer. Block > layer will use that for write-hint to stream-id conversion. Registration > is done for each namespace. Since NVMe spec allow all available > streams (within subsystem) to be used by all namespaces, no attempt > has been made to add reservation at namespace level. > > Signed-off-by: Kanchan Joshi > --- > drivers/nvme/host/core.c | 23 ++++++----------------- > 1 file changed, 6 insertions(+), 17 deletions(-) > > diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c > index 2c43e12..81b86fa 100644 > --- a/drivers/nvme/host/core.c > +++ b/drivers/nvme/host/core.c > @@ -464,10 +464,6 @@ static int nvme_toggle_streams(struct nvme_ctrl *ctrl, bool enable) > return nvme_submit_sync_cmd(ctrl->admin_q, &c, NULL, 0); > } > > -static int nvme_disable_streams(struct nvme_ctrl *ctrl) > -{ > - return nvme_toggle_streams(ctrl, false); > -} > > static int nvme_enable_streams(struct nvme_ctrl *ctrl) > { > @@ -510,14 +506,7 @@ static int nvme_configure_directives(struct nvme_ctrl *ctrl) > return ret; > > ctrl->nssa = le16_to_cpu(s.nssa); > - if (ctrl->nssa < BLK_MAX_WRITE_HINTS - 1) { > - dev_info(ctrl->device, "too few streams (%u) available\n", > - ctrl->nssa); > - nvme_disable_streams(ctrl); > - return 0; > - } > - > - ctrl->nr_streams = min_t(unsigned, ctrl->nssa, BLK_MAX_WRITE_HINTS - 1); > + ctrl->nr_streams = ctrl->nssa; > dev_info(ctrl->device, "Using %u streams\n", ctrl->nr_streams); > return 0; > } This changes the current behavior, doesn't it? Previously devices with less than 5 hints got streams completely disabled, now they will have streams enabled but ids beyond supported max will be mapped to 0. I'm not against this but I guess it should be spelled out explicitely in the changelog. Honza -- Jan Kara SUSE Labs, CR