Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1338656 > unrolled thread
| Started by | Matias Bjørling <m@bjorling.me> |
|---|---|
| First post | 2016-02-20 09:00 +0100 |
| Last post | 2016-02-20 09:00 +0100 |
| Articles | 3 — 1 participant |
Back to article view | Back to linux.kernel
[PATCH 0/4] LightNVM patches for 4.5-rc Matias Bjørling <m@bjorling.me> - 2016-02-20 09:00 +0100
[PATCH 1/4] lightnvm: update closed list outside of intr context Matias Bjørling <m@bjorling.me> - 2016-02-20 09:00 +0100
[PATCH 3/4] lightnvm: remove struct nvm_dev->total_blocks Matias Bjørling <m@bjorling.me> - 2016-02-20 09:00 +0100
| From | Matias Bjørling <m@bjorling.me> |
|---|---|
| Date | 2016-02-20 09:00 +0100 |
| Subject | [PATCH 0/4] LightNVM patches for 4.5-rc |
| Message-ID | <r4aCl-1NO-3@gated-at.bofh.it> |
Hi Jens, Sorry, I was living in a fairy tail land, where patches are miraculously applied without being sent upstream. Leading me to test on top of the wrong base. I was missing three patches, which I should have sent for previous -rc round. The first patch fixes taking a normal spinlock in interrupt context. Second and third are cleanups, and at last the patch that previously did not compile. Thanks, Matias Javier González (2): lightnvm: update closed list outside of intr context lightnvm: generalize rrpc ppa calculations Matias Bjørling (2): lightnvm: rename ->nr_pages to ->nr_sects lightnvm: remove struct nvm_dev->total_blocks drivers/lightnvm/core.c | 6 +-- drivers/lightnvm/gennvm.c | 7 ++-- drivers/lightnvm/rrpc.c | 98 ++++++++++++++++++++++++++--------------------- drivers/lightnvm/rrpc.h | 15 ++++++-- include/linux/lightnvm.h | 2 +- 5 files changed, 71 insertions(+), 57 deletions(-) -- 2.5.0
[toc] | [next] | [standalone]
| From | Matias Bjørling <m@bjorling.me> |
|---|---|
| Date | 2016-02-20 09:00 +0100 |
| Subject | [PATCH 1/4] lightnvm: update closed list outside of intr context |
| Message-ID | <r4aCm-1NO-9@gated-at.bofh.it> |
| In reply to | #1338656 |
From: Javier González <javier@cnexlabs.com>
When an I/O finishes, full blocks are moved from the open to the closed
list - a lock is taken to protect the list. This happens at the moment
in the interrupt context, which is not correct.
This patch moves this logic to the block workqueue instead, avoiding
holding a spinlock without interrupt save in an interrupt context.
Signed-off-by: Javier González <javier@cnexlabs.com>
Fixes: ff0e498bfa18 ("lightnvm: manage open and closed blocks sepa...")
Signed-off-by: Matias Bjørling <m@bjorling.me>
---
drivers/lightnvm/rrpc.c | 23 ++++++++++-------------
1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c
index 307db1e..b7ddfb3 100644
--- a/drivers/lightnvm/rrpc.c
+++ b/drivers/lightnvm/rrpc.c
@@ -499,12 +499,21 @@ static void rrpc_gc_queue(struct work_struct *work)
struct rrpc *rrpc = gcb->rrpc;
struct rrpc_block *rblk = gcb->rblk;
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);
spin_unlock(&rlun->lock);
+ spin_lock(&lun->lock);
+ lun->nr_open_blocks--;
+ lun->nr_closed_blocks++;
+ blk->state &= ~NVM_BLK_ST_OPEN;
+ blk->state |= NVM_BLK_ST_CLOSED;
+ list_move_tail(&rblk->list, &rlun->closed_list);
+ spin_unlock(&lun->lock);
+
mempool_free(gcb, rrpc->gcb_pool);
pr_debug("nvm: block '%lu' is full, allow GC (sched)\n",
rblk->parent->id);
@@ -668,20 +677,8 @@ static void rrpc_end_io_write(struct rrpc *rrpc, struct rrpc_rq *rrqd,
lun = rblk->parent->lun;
cmnt_size = atomic_inc_return(&rblk->data_cmnt_size);
- if (unlikely(cmnt_size == rrpc->dev->pgs_per_blk)) {
- struct nvm_block *blk = rblk->parent;
- struct rrpc_lun *rlun = rblk->rlun;
-
- spin_lock(&lun->lock);
- lun->nr_open_blocks--;
- lun->nr_closed_blocks++;
- blk->state &= ~NVM_BLK_ST_OPEN;
- blk->state |= NVM_BLK_ST_CLOSED;
- list_move_tail(&rblk->list, &rlun->closed_list);
- spin_unlock(&lun->lock);
-
+ if (unlikely(cmnt_size == rrpc->dev->pgs_per_blk))
rrpc_run_gc(rrpc, rblk);
- }
}
}
--
2.5.0
[toc] | [prev] | [next] | [standalone]
| From | Matias Bjørling <m@bjorling.me> |
|---|---|
| Date | 2016-02-20 09:00 +0100 |
| Subject | [PATCH 3/4] lightnvm: remove struct nvm_dev->total_blocks |
| Message-ID | <r4aCm-1NO-13@gated-at.bofh.it> |
| In reply to | #1338656 |
The struct nvm_dev->total_blocks was only used for calculating total sectors. Remove and instead calculate total sectors from the number of luns and its sectors. Signed-off-by: Matias Bjørling <m@bjorling.me> --- drivers/lightnvm/core.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 2f1e16c..0d1fb6b 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c @@ -463,11 +463,7 @@ static int nvm_core_init(struct nvm_dev *dev) dev->sec_per_lun = dev->sec_per_blk * dev->blks_per_lun; dev->nr_luns = dev->luns_per_chnl * dev->nr_chnls; - dev->total_blocks = dev->nr_planes * - dev->blks_per_lun * - dev->luns_per_chnl * - dev->nr_chnls; - dev->total_secs = dev->total_blocks * dev->sec_per_blk; + dev->total_secs = dev->nr_luns * dev->sec_per_lun; INIT_LIST_HEAD(&dev->online_targets); mutex_init(&dev->mlock); -- 2.5.0
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web