linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] lightnvm: invalidate addresses on multipage fail
@ 2016-02-01 13:10 Javier González
  2016-02-03  8:10 ` Matias Bjørling
  0 siblings, 1 reply; 3+ messages in thread
From: Javier González @ 2016-02-01 13:10 UTC (permalink / raw)
  To: mb; +Cc: linux-kernel, linux-block, 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.

Signed-off-by: Javier González <javier@cnexlabs.com>
---
 drivers/lightnvm/rrpc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index c4d0b04..29befe9 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -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;
-- 
2.1.4

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

* Re: [PATCH] lightnvm: invalidate addresses on multipage fail
  2016-02-01 13:10 [PATCH] lightnvm: invalidate addresses on multipage fail Javier González
@ 2016-02-03  8:10 ` Matias Bjørling
  2016-02-03  8:15   ` Javier González
  0 siblings, 1 reply; 3+ messages in thread
From: Matias Bjørling @ 2016-02-03  8:10 UTC (permalink / raw)
  To: Javier González; +Cc: linux-kernel, linux-block, Javier González

On 02/01/2016 02:10 PM, Javier González wrote:
> 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.
> 
> Signed-off-by: Javier González <javier@cnexlabs.com>
> ---
>  drivers/lightnvm/rrpc.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
> index c4d0b04..29befe9 100644
> --- a/drivers/lightnvm/rrpc.c
> +++ b/drivers/lightnvm/rrpc.c
> @@ -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?

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

* Re: [PATCH] lightnvm: invalidate addresses on multipage fail
  2016-02-03  8:10 ` Matias Bjørling
@ 2016-02-03  8:15   ` Javier González
  0 siblings, 0 replies; 3+ messages in thread
From: Javier González @ 2016-02-03  8:15 UTC (permalink / raw)
  To: Matias Bjørling; +Cc: linux-kernel, linux-block

[-- Attachment #1: Type: text/plain, Size: 1424 bytes --]

> 
> On 03 Feb 2016, at 09:10, Matias Bjørling <mb@lightnvm.io> wrote:
> 
> On 02/01/2016 02:10 PM, Javier González wrote:
>> 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.
>> 
>> Signed-off-by: Javier González <javier@cnexlabs.com>
>> ---
>> drivers/lightnvm/rrpc.c | 1 +
>> 1 file changed, 1 insertion(+)
>> 
>> diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
>> index c4d0b04..29befe9 100644
>> --- a/drivers/lightnvm/rrpc.c
>> +++ b/drivers/lightnvm/rrpc.c
>> @@ -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

[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 842 bytes --]

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

end of thread, other threads:[~2016-02-03  8:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-01 13:10 [PATCH] lightnvm: invalidate addresses on multipage fail Javier González
2016-02-03  8:10 ` Matias Bjørling
2016-02-03  8:15   ` Javier González

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).