Skip to contentSkip to conversation

lightnvm: invalidate addresses on multipage fail

PATCH In review Javier González 2 participants 3 messages Feb 1, 2016 – Feb 3, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lightnvm: invalidate addresses on multipage fail

If a page mapping fails when mapping several pages in a single write bio request, make sure that already mapped pages are invalidated. Since other legit mappings coming from a different bio request might have occurred, rolling back the failed bio is a difficult, unnecessary overhead; in part because when a mapping fails something bad has happened already. Still, invalidating pages in the failed bio will help GC.

---
 drivers/lightnvm/rrpc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/lightnvm/rrpc.c +1 -0
index c4d0b04..29befe9 100644
@@ -730,6 +730,7 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio,
 		} else {
 			BUG_ON(is_gc);
 			rrpc_unlock_laddr(rrpc, r);
+			rrpc_invalidate_range(rrpc, laddr, i + 1);
 			nvm_dev_dma_free(rrpc->dev, rqd->ppa_list,
 							rqd->dma_ppa_list);
 			return NVM_IO_DONE;
Signature · 1 line
2.1.4
#1 lore raw
Quoted 19 lines · Javier González

If a page mapping fails when mapping several pages in a single write bio request, make sure that already mapped pages are invalidated. Since other legit mappings coming from a different bio request might have occurred, rolling back the failed bio is a difficult, unnecessary overhead; in part because when a mapping fails something bad has happened already. Still, invalidating pages in the failed bio will help GC.

---
 drivers/lightnvm/rrpc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/lightnvm/rrpc.c +0 -0
index c4d0b04..29befe9 100644

drivers/lightnvm/rrpc.c static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio, · line 736

Quoted 7 lines
drivers/lightnvm/rrpc.c +1 -0
@@ -730,6 +730,7 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio,
 		} else {
 			BUG_ON(is_gc);
 			rrpc_unlock_laddr(rrpc, r);
+			rrpc_invalidate_range(rrpc, laddr, i + 1);
 			nvm_dev_dma_free(rrpc->dev, rqd->ppa_list,
 							rqd->dma_ppa_list);
 			return NVM_IO_DONE;

I'm not sure I understand this. This is in the read path, why would it need to invalidate pages if a page is not mapped?

#2 lore raw
Quoted 17 lines · Matias Bjørling
Quoted 13 lines · Javier González

If a page mapping fails when mapping several pages in a single write bio request, make sure that already mapped pages are invalidated. Since other legit mappings coming from a different bio request might have occurred, rolling back the failed bio is a difficult, unnecessary overhead; in part because when a mapping fails something bad has happened already. Still, invalidating pages in the failed bio will help GC.

---
drivers/lightnvm/rrpc.c | 1 +

1 file changed, 1 insertion(+)
Quoted 15 lines

drivers/lightnvm/rrpc.c static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio, · line 736

Quoted 12 lines
drivers/lightnvm/rrpc.c +1 -0
index c4d0b04..29befe9 100644
@@ -730,6 +730,7 @@ static int rrpc_read_ppalist_rq(struct rrpc *rrpc, struct bio *bio,
 		} else {
 			BUG_ON(is_gc);
 			rrpc_unlock_laddr(rrpc, r);
+			rrpc_invalidate_range(rrpc, laddr, i + 1);
 			nvm_dev_dma_free(rrpc->dev, rqd->ppa_list,
 							rqd->dma_ppa_list);
 			return NVM_IO_DONE;

I'm not sure I understand this. This is in the read path, why would it need to invalidate pages if a page is not mapped?

You are right. I sent the wrong patch. I’ll send the right one now.

Javier