From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753304AbcEBIWw (ORCPT ); Mon, 2 May 2016 04:22:52 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:35012 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752806AbcEBIWo (ORCPT ); Mon, 2 May 2016 04:22:44 -0400 Subject: Re: [PATCH] lightnvm: do not assume sequential lun alloc. To: =?UTF-8?Q?Javier_Gonz=c3=a1lez?= References: <1461941209-6657-1-git-send-email-javier@cnexlabs.com> Cc: linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, =?UTF-8?Q?Javier_Gonz=c3=a1lez?= From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <57270E51.1060809@lightnvm.io> Date: Mon, 2 May 2016 10:22:41 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1461941209-6657-1-git-send-email-javier@cnexlabs.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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.