Skip to contentSkip to conversation

nvme: inherit stable pages constraint in the mpath stack device

PATCH Superseded Sagi Grimberg 2 participants 6 messages Apr 1, 2020 – Apr 2, 2020

Subsystems (2)
lore
Share & tools
lore

Sagi Grimberg

author maintainer
#0 lore raw

PATCH v2 1/1 nvme: inherit stable pages constraint in the mpath stack device

If the backing device require stable pages, we need to set it on the target as well. This applies to rdma/fc transports when doing data integrity and tcp transport calculating digests.

---
This time it even compiles :)

 drivers/nvme/host/core.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/nvme/host/core.c +7 -0
index 222925dfe364..8b3827370874 100644
@@ -1907,6 +1907,13 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
 	if (ns->head->disk) {
 		nvme_update_disk_info(ns->head->disk, ns, id);
 		blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
+		if (bdi_cap_stable_pages_required(ns->queue->backing_dev_info)) {
+			struct backing_dev_info *info =
+				ns->head->disk->queue->backing_dev_info;
+
+                        info->capabilities |= BDI_CAP_STABLE_WRITES;
+		}
+
 		revalidate_disk(ns->head->disk);
 	}
 #endif
Signature · 7 lines
2.20.1


_______________________________________________
linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
author maintainer
#2 lore raw
Quoted 6 lines
Quoted 4 lines

If the backing device require stable pages, we need to set it on the target as well. This applies to rdma/fc transports when doing data integrity and tcp transport calculating digests.

target?? Seems like this propagates it to the multipath node.

typo..

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

#3 lore raw
In reply to Sagi Grimberg

drivers/nvme/host/core.c static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) · line 1915

Quoted 10 lines · Sagi Grimberg
drivers/nvme/host/core.c +6 -0
@@ -1907,6 +1907,13 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
 	if (ns->head->disk) {
 		nvme_update_disk_info(ns->head->disk, ns, id);
 		blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
+		if (bdi_cap_stable_pages_required(ns->queue->backing_dev_info)) {
+			struct backing_dev_info *info =
+				ns->head->disk->queue->backing_dev_info;
+
+                        info->capabilities |= BDI_CAP_STABLE_WRITES;
+		}

I think this needs to go into blk_queue_stack_limits instead, otherwise we have the same problem with other stacking drivers.

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

author maintainer
#4 lore raw
Quoted 14 lines

drivers/nvme/host/core.c static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id) · line 1915

Quoted 11 lines
drivers/nvme/host/core.c +6 -0
@@ -1907,6 +1907,13 @@ static void __nvme_revalidate_disk(struct gendisk *disk, struct nvme_id_ns *id)
  	if (ns->head->disk) {
  		nvme_update_disk_info(ns->head->disk, ns, id);
  		blk_queue_stack_limits(ns->head->disk->queue, ns->queue);
+		if (bdi_cap_stable_pages_required(ns->queue->backing_dev_info)) {
+			struct backing_dev_info *info =
+				ns->head->disk->queue->backing_dev_info;
+
+                        info->capabilities |= BDI_CAP_STABLE_WRITES;
+		}

I think this needs to go into blk_queue_stack_limits instead, otherwise we have the same problem with other stacking drivers.

I thought about this, but the stack_limits has different variants (blk_stack_limits, bdev_stack_limits) but only the first takes a request_queue...

I see that dm-table does roughly the same thing, drbd ignores it. In general, dm is doing a whole bunch of stacking limits/capabilities related stuff that are not involved in blk_stack_limits...

I could theoretically add a flag to queue_limits to mirror this, is that what you are suggesting?

#5 lore raw
Quoted 7 lines · Sagi Grimberg
Quoted 2 lines

I think this needs to go into blk_queue_stack_limits instead, otherwise we have the same problem with other stacking drivers.

I thought about this, but the stack_limits has different variants (blk_stack_limits, bdev_stack_limits) but only the first takes a request_queue...

Quoted 6 lines

I see that dm-table does roughly the same thing, drbd ignores it. In general, dm is doing a whole bunch of stacking limits/capabilities related stuff that are not involved in blk_stack_limits...

I could theoretically add a flag to queue_limits to mirror this, is that what you are suggesting?

I guess we'll just go with your v4 patch for now and I'll see if I can refactor this mess later..