Skip to contentSkip to conversation

nvme: skip noiob for zoned devices

PATCH Superseded Keith Busch 3 participants 6 messages Aug 7, 2020 – Aug 14, 2020 NVMe

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Keith Busch

author maintainer
#0 lore raw

PATCH v2 1/1 nvme: skip noiob for zoned devices

Zoned block devices reuse the chunk_sectors queue limit to define zone boundaries. If a such a device happens to also report an optimal boundary, do not use that to define the chunk_sectors as that may intermittently interfere with io splitting and zone size queries.

---
v1->v2: Fixed the if condition to check for *not* zoned.

 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index 88cff309d8e4..4e0225d85e70 100644
@@ -2075,7 +2075,7 @@ static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
 		}
 	}
 
-	if (iob)
+	if (iob && !blk_queue_is_zoned(ns->queue))
 		blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(iob));
 	nvme_update_disk_info(disk, ns, id);
 #ifdef CONFIG_NVME_MULTIPATH
Signature · 7 lines
2.24.1


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
#2 lore raw
In reply to Keith Busch
Quoted 4 lines · Keith Busch

Zoned block devices reuse the chunk_sectors queue limit to define zone boundaries. If a such a device happens to also report an optimal boundary, do not use that to define the chunk_sectors as that may intermittently interfere with io splitting and zone size queries.

Instead of skipping shouldn't we use the max of noiob and the zone size, even if that is mostly theoretical?

Quoted 23 lines

---
v1->v2: Fixed the if condition to check for *not* zoned.

 drivers/nvme/host/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/core.c +1 -1
index 88cff309d8e4..4e0225d85e70 100644
@@ -2075,7 +2075,7 @@ static int __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
 		}
 	}
 
-	if (iob)
+	if (iob && !blk_queue_is_zoned(ns->queue))
 		blk_queue_chunk_sectors(ns->queue, rounddown_pow_of_two(iob));
 	nvme_update_disk_info(disk, ns, id);
 #ifdef CONFIG_NVME_MULTIPATH
Signature · 1 line
2.24.1

---end quoted text---

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

author maintainer
#3 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · Keith Busch

Zoned block devices reuse the chunk_sectors queue limit to define zone boundaries. If a such a device happens to also report an optimal boundary, do not use that to define the chunk_sectors as that may intermittently interfere with io splitting and zone size queries.

Instead of skipping shouldn't we use the max of noiob and the zone size, even if that is mostly theoretical?

No, I don't think so. If noiob is larger, we'll return the wrong value for blk_queue_zone_sectors() and blkdev_nr_zones(), which will have undesirable consequences.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

#4 lore raw
Quoted 7 lines · Keith Busch
Quoted 6 lines · Christoph Hellwig
Quoted 4 lines · Keith Busch

Zoned block devices reuse the chunk_sectors queue limit to define zone boundaries. If a such a device happens to also report an optimal boundary, do not use that to define the chunk_sectors as that may intermittently interfere with io splitting and zone size queries.

Quoted 6 lines
Quoted 2 lines

Instead of skipping shouldn't we use the max of noiob and the zone size, even if that is mostly theoretical?

No, I don't think so. If noiob is larger, we'll return the wrong value for blk_queue_zone_sectors() and blkdev_nr_zones(), which will have undesirable consequences.

Then we at least need to warn about a larger noiob. And add a comment that we are ignoring it deliberately.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme

maintainer
#5 lore raw
Quoted 10 lines
Quoted 10 lines
Quoted 9 lines · Keith Busch
Quoted 4 lines

Zoned block devices reuse the chunk_sectors queue limit to define zone boundaries. If a such a device happens to also report an optimal boundary, do not use that to define the chunk_sectors as that may intermittently interfere with io splitting and zone size queries.

Instead of skipping shouldn't we use the max of noiob and the zone size, even if that is mostly theoretical?

Quoted 6 lines
Quoted 3 lines

No, I don't think so. If noiob is larger, we'll return the wrong value for blk_queue_zone_sectors() and blkdev_nr_zones(), which will have undesirable consequences.

Then we at least need to warn about a larger noiob. And add a comment that we are ignoring it deliberately.

I'm fine with that, Keith if you agree you can send a patch and I'll fold it into the original one.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme