Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1391200 > unrolled thread

[PATCH] lightnvm: do not assume sequential lun alloc.

Started by"Javier González" <jg@lightnvm.io>
First post2016-04-29 16:50 +0200
Last post2016-05-02 10:30 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] lightnvm: do not assume sequential lun alloc. "Javier González" <jg@lightnvm.io> - 2016-04-29 16:50 +0200
    Re: [PATCH] lightnvm: do not assume sequential lun alloc. Matias Bjørling <mb@lightnvm.io> - 2016-05-02 10:30 +0200

#1391200 — [PATCH] lightnvm: do not assume sequential lun alloc.

From"Javier González" <jg@lightnvm.io>
Date2016-04-29 16:50 +0200
Subject[PATCH] lightnvm: do not assume sequential lun alloc.
Message-ID<rthTZ-7HC-23@gated-at.bofh.it>
When doing GC, rrpc calculates the physical LUN to which the rrpc block
belongs too. This calculation is based on the assumption that LUNs are
assigned sequentially to the LUN list. Use the reference to the LUN
instead. This saves us the calculation and allows us to align LUNs in a
different manner to, for example, take advantage of devide parallelism.

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

diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index ffcfee6..48862ead 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -405,9 +405,8 @@ static void rrpc_block_gc(struct work_struct *work)
 									ws_gc);
 	struct rrpc *rrpc = gcb->rrpc;
 	struct rrpc_block *rblk = gcb->rblk;
+	struct rrpc_lun *rlun = rblk->rlun;
 	struct nvm_dev *dev = rrpc->dev;
-	struct nvm_lun *lun = rblk->parent->lun;
-	struct rrpc_lun *rlun = &rrpc->luns[lun->id - rrpc->lun_offset];
 
 	mempool_free(gcb, rrpc->gcb_pool);
 	pr_debug("nvm: block '%lu' being reclaimed\n", rblk->parent->id);
@@ -508,9 +507,9 @@ static void rrpc_gc_queue(struct work_struct *work)
 									ws_gc);
 	struct rrpc *rrpc = gcb->rrpc;
 	struct rrpc_block *rblk = gcb->rblk;
+	struct rrpc_lun *rlun = rblk->rlun;
 	struct nvm_lun *lun = rblk->parent->lun;
 	struct nvm_block *blk = rblk->parent;
-	struct rrpc_lun *rlun = &rrpc->luns[lun->id - rrpc->lun_offset];
 
 	spin_lock(&rlun->lock);
 	list_add_tail(&rblk->prio, &rlun->prio_list);
-- 
2.5.0

[toc] | [next] | [standalone]


#1392059

FromMatias Bjørling <mb@lightnvm.io>
Date2016-05-02 10:30 +0200
Message-ID<ruhoS-8sl-19@gated-at.bofh.it>
In reply to#1391200
On 04/29/2016 04:46 PM, Javier González wrote:
> When doing GC, rrpc calculates the physical LUN to which the rrpc block
> belongs too. This calculation is based on the assumption that LUNs are
> assigned sequentially to the LUN list. Use the reference to the LUN
> instead. This saves us the calculation and allows us to align LUNs in a
> different manner to, for example, take advantage of devide parallelism.
>
> Signed-off-by: Javier González <javier@cnexlabs.com>
> ---
>   drivers/lightnvm/rrpc.c | 5 ++---
>   1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
> index ffcfee6..48862ead 100644
> --- a/drivers/lightnvm/rrpc.c
> +++ b/drivers/lightnvm/rrpc.c
> @@ -405,9 +405,8 @@ static void rrpc_block_gc(struct work_struct *work)
>   									ws_gc);
>   	struct rrpc *rrpc = gcb->rrpc;
>   	struct rrpc_block *rblk = gcb->rblk;
> +	struct rrpc_lun *rlun = rblk->rlun;
>   	struct nvm_dev *dev = rrpc->dev;
> -	struct nvm_lun *lun = rblk->parent->lun;
> -	struct rrpc_lun *rlun = &rrpc->luns[lun->id - rrpc->lun_offset];
>
>   	mempool_free(gcb, rrpc->gcb_pool);
>   	pr_debug("nvm: block '%lu' being reclaimed\n", rblk->parent->id);
> @@ -508,9 +507,9 @@ static void rrpc_gc_queue(struct work_struct *work)
>   									ws_gc);
>   	struct rrpc *rrpc = gcb->rrpc;
>   	struct rrpc_block *rblk = gcb->rblk;
> +	struct rrpc_lun *rlun = rblk->rlun;
>   	struct nvm_lun *lun = rblk->parent->lun;
>   	struct nvm_block *blk = rblk->parent;
> -	struct rrpc_lun *rlun = &rrpc->luns[lun->id - rrpc->lun_offset];
>
>   	spin_lock(&rlun->lock);
>   	list_add_tail(&rblk->prio, &rlun->prio_list);
>

Thanks Javier. Applied for 4.7.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web