Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp436577img; Mon, 18 Mar 2019 06:34:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqxvDv7TZJ0m1LL8muCfz5M4OmOY/xqrRFPoBjCykoNUxQtjcWQJOakCrprWcBM8oXIumGoR X-Received: by 2002:a65:4147:: with SMTP id x7mr17809663pgp.54.1552916040100; Mon, 18 Mar 2019 06:34:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552916040; cv=none; d=google.com; s=arc-20160816; b=jZBqQ93Ymf6staoYzhtzZmx868wZ+qgrziPtSL63GhI3Pyzh9vsztehCFPszLliX/+ wfBnX4TJZnvwZJvBddYI4Tn4i+7w4YflFQkQ//DZRK4pvwlooqos9CzlG7cIMJWPzCZ8 a9abtYiRhZfZBSgoabioRSyf8x8dznpmpFc3UZoFk9LnMZ5/VO8ed3hJfDpxyKODq+/o nvvXVxiUltwRLkvHQCaiCW8uEnE4dgXHytXHHQDVKNPtRwvCpkqecTaQ/wHtjYOYsKuU +LPhvUlvRyqvDUtzGKrT7OrkDaZbCXfkBjlZJ4NHAlfkvLjFzh1JWRaS9OG+maq7mGEn 13RA== 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; bh=1LBuimlZT73t+yk+YJsDqonkQN8yRKdtX8xAu6lsfoM=; b=sK+W0iLvwndrz5qHJIji1x2kqxvZ5R9DGLHksqwMI8ILR+7n8Fiy1zpQW8GdZt0eln 0NEa5ACP/HG+Fk6afhYmy8X3y9mQmMTs4PsoxGJxf7wV032SrkQ1wW6l7ftpSt/bpoTm WC9M6QdPprVE7QUptvGPCfI8YeYUjVSx59/Y45KSQTesPUNERLaXpAs3eso/RhNCcoMX tVRDIVjqaG4/HnnIRQQPbAEXuzkWX0M8hUAhG/eesVKAjvhbGXy74bbbJ0fPJzfPnsoy zEsRm0NQA4WLCPI1xd6SO/3e7JiNC726UjOVevzx8OG60F/GYTc5vP3S3RCktWAuFwnt 1N/g== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 24si5470500pfp.261.2019.03.18.06.33.44; Mon, 18 Mar 2019 06:34:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726926AbfCRNcr (ORCPT + 99 others); Mon, 18 Mar 2019 09:32:47 -0400 Received: from mga18.intel.com ([134.134.136.126]:14016 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726202AbfCRNcr (ORCPT ); Mon, 18 Mar 2019 09:32:47 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Mar 2019 06:32:46 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,494,1544515200"; d="scan'208";a="329640905" Received: from mdziegie-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.237.142.141]) by fmsmga005.fm.intel.com with ESMTP; 18 Mar 2019 06:32:43 -0700 Subject: Re: [PATCH] nvme: lightnvm: expose OC devices as zero size to OS To: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Cc: igor.j.konopko@intel.com, Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org References: <1552570910-11706-1-git-send-email-marcin.dziegielewski@intel.com> <4e43d40a-b253-1493-da38-70a8c062749e@lightnvm.io> From: Marcin Dziegielewski Message-ID: <16807f7f-075b-aa27-72c3-a905772ac36d@intel.com> Date: Mon, 18 Mar 2019 14:32:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.0 MIME-Version: 1.0 In-Reply-To: <4e43d40a-b253-1493-da38-70a8c062749e@lightnvm.io> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/14/19 2:56 PM, Matias Bjørling wrote: > On 3/14/19 6:41 AM, Marcin Dziegielewski wrote: >> Open channel devices are not able to handle traditional >> IO requests addressed by LBA, so following current >> approach to exposing special nvme devices as zero size >> (e.g. with namespace formatted to use metadata) also >> open channel devices should be exposed as zero size >> to OS. >> >> Signed-off-by: Marcin Dziegielewski >> --- >>   drivers/nvme/host/core.c | 3 ++- >>   1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c >> index 07bf2bf..52cd5c8 100644 >> --- a/drivers/nvme/host/core.c >> +++ b/drivers/nvme/host/core.c >> @@ -1606,7 +1606,8 @@ static void nvme_update_disk_info(struct gendisk >> *disk, >>       if (ns->ms && !ns->ext && >>           (ns->ctrl->ops->flags & NVME_F_METADATA_SUPPORTED)) >>           nvme_init_integrity(disk, ns->ms, ns->pi_type); >> -    if (ns->ms && !nvme_ns_has_pi(ns) && !blk_get_integrity(disk)) >> +    if ((ns->ms && !nvme_ns_has_pi(ns) && !blk_get_integrity(disk)) || >> +        ns->ndev) >>           capacity = 0; >>       set_capacity(disk, capacity); >> > > Marcin, > > The read/write as traditional I/Os feature is supported in OCSSD 2.0. > For example, one can hook support up through the zone device support in > the kernel. There is a patch here that enables it here: > > https://github.com/OpenChannelSSD/linux/commit/e79e747601a315784e505d51a9265e82a3e7613c > > > With that, an OCSSD device can be used as a traditional zoned block > device, and use the existing infrastructure. Which is really neat. > > It is not upstream, since it depends on some features that we introduce > with zoned namespaces, but in general, tools can read/write from a block > device as any other, just honoring the special write rules that are for > OCSSD/zoned block devices. > > -Matias Matias, If zone related changes will be in upstream soon, I agree that this patch is not needed. But, I can not agree that tools can use OCSSD device as normal block device - for example in current implementation I don't see way to send erase request and of course without it we can not send write. Because of that, it was my intention to block normal IO to OCSSD device by default. Marcin