linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] nvme: lightnvm: expose OC devices as zero size to OS
@ 2019-03-14 13:41 Marcin Dziegielewski
  2019-03-14 13:56 ` Matias Bjørling
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Dziegielewski @ 2019-03-14 13:41 UTC (permalink / raw)


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 <marcin.dziegielewski at intel.com>
---
 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);
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] nvme: lightnvm: expose OC devices as zero size to OS
  2019-03-14 13:41 [PATCH] nvme: lightnvm: expose OC devices as zero size to OS Marcin Dziegielewski
@ 2019-03-14 13:56 ` Matias Bjørling
  2019-03-18 13:32   ` Marcin Dziegielewski
  0 siblings, 1 reply; 4+ messages in thread
From: Matias Bjørling @ 2019-03-14 13:56 UTC (permalink / raw)


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 <marcin.dziegielewski at intel.com>
> ---
>   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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] nvme: lightnvm: expose OC devices as zero size to OS
  2019-03-14 13:56 ` Matias Bjørling
@ 2019-03-18 13:32   ` Marcin Dziegielewski
  2019-03-25 10:56     ` Matias Bjørling
  0 siblings, 1 reply; 4+ messages in thread
From: Marcin Dziegielewski @ 2019-03-18 13:32 UTC (permalink / raw)


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 <marcin.dziegielewski at intel.com>
>> ---
>> ? 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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] nvme: lightnvm: expose OC devices as zero size to OS
  2019-03-18 13:32   ` Marcin Dziegielewski
@ 2019-03-25 10:56     ` Matias Bjørling
  0 siblings, 0 replies; 4+ messages in thread
From: Matias Bjørling @ 2019-03-25 10:56 UTC (permalink / raw)


On 3/18/19 2:32 PM, Marcin Dziegielewski wrote:
> 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 <marcin.dziegielewski at intel.com>
>>> ---
>>> ? 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

It is implemented the same way as "Zone reset" is implemented in 
ZAC/ZBC. The kernel converts the trim to a vector erase and issues that 
instead.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-25 10:56 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-14 13:41 [PATCH] nvme: lightnvm: expose OC devices as zero size to OS Marcin Dziegielewski
2019-03-14 13:56 ` Matias Bjørling
2019-03-18 13:32   ` Marcin Dziegielewski
2019-03-25 10:56     ` Matias Bjørling

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).