Skip to contentSkip to conversation

lightnvm updates for 4.18

GIT PULL Matias Bjørling 5 participants 37 messages May 28, 2018 – Jun 5, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi Jens,

Please pick up the following patches.

- Hans reworked the write error recovery path in pblk.
- Igor added extra error handling for lines, and fixed a bug in the pblk ringbuffer during GC.
- Javier refactored the pblk code a bit, added extra error handling, and added checks to verify that data returned from drive is appropriate.
- Marcin added some extra logic to manage the write buffer. Now MW_CUNITS can be zero and the size of write buffer can be changed at module load time.

Thanks,
Matias

Hans Holmberg (3):
lightnvm: pblk: rework write error recovery path
lightnvm: pblk: garbage collect lines with failed writes
lightnvm: pblk: fix smeta write error path

Igor Konopko (4):
lightnvm: proper error handling for pblk_bio_add_pages
lightnvm: error handling when whole line is bad
lightnvm: fix partial read error path
lightnvm: pblk: sync RB and RL states during GC

Javier González (11):
lightnvm: pblk: fail gracefully on line alloc. failure
lightnvm: pblk: recheck for bad lines at runtime
lightnvm: pblk: check read lba on gc path
lightnvn: pblk: improve error msg on corrupted LBAs
lightnvm: pblk: warn in case of corrupted write buffer
lightnvm: pblk: return NVM_ error on failed submission
lightnvm: pblk: remove unnecessary indirection
lightnvm: pblk: remove unnecessary argument
lightnvm: pblk: check for chunk size before allocating it
lightnvn: pass flag on graceful teardown to targets
lightnvm: pblk: remove dead function

Marcin Dziegielewski (2):
lightnvm: pblk: handle case when mw_cunits equals to 0
lightnvm: pblk: add possibility to set write buffer size manually

 drivers/lightnvm/core.c          |  10 +-
 drivers/lightnvm/pblk-core.c     | 149 +++++++++++++++------
 drivers/lightnvm/pblk-gc.c       | 112 ++++++++++------
 drivers/lightnvm/pblk-init.c     | 112 +++++++++++-----
 drivers/lightnvm/pblk-map.c      |  33 +++--
 drivers/lightnvm/pblk-rb.c       |  51 +------
 drivers/lightnvm/pblk-read.c     |  83 +++++++++---
 drivers/lightnvm/pblk-recovery.c |  91 -------------
 drivers/lightnvm/pblk-rl.c       |  29 +++-
 drivers/lightnvm/pblk-sysfs.c    |  15 ++-
 drivers/lightnvm/pblk-write.c    | 281 +++++++++++++++++++++++++--------------
 drivers/lightnvm/pblk.h          |  43 +++---
 drivers/nvme/host/lightnvm.c     |   1 -
 include/linux/lightnvm.h         |   2 +-
 14 files changed, 604 insertions(+), 408 deletions(-)
Signature · 1 line
2.11.0
#1 lore raw

[GIT PULL 01/20] lightnvm: pblk: fail gracefully on line alloc. failure

From: Javier González <[email protected]>

In the event of a line failing to allocate, fail gracefully and stop the pipeline to avoid more write failing in the same place.

---
 drivers/lightnvm/pblk-init.c |  5 +++++
 drivers/lightnvm/pblk-map.c  | 33 ++++++++++++++++++++++++---------
 2 files changed, 29 insertions(+), 9 deletions(-)
drivers/lightnvm/pblk-init.c +5 -0
index 91a5bc2556a3..dee64f91227d 100644
@@ -1047,6 +1047,11 @@ static int pblk_lines_init(struct pblk *pblk)
 		nr_free_chks += pblk_setup_line_meta(pblk, line, chunk_meta, i);
 	}
 
+	if (!nr_free_chks) {
+		pr_err("pblk: too many bad blocks prevent for sane instance\n");
+		return -EINTR;
+	}
+
 	pblk_set_provision(pblk, nr_free_chks);
 
 	kfree(chunk_meta);
drivers/lightnvm/pblk-map.c +24 -9
index 20dbaa89c9df..953ca31dda68 100644
@@ -18,11 +18,11 @@
 
 #include "pblk.h"
 
-static void pblk_map_page_data(struct pblk *pblk, unsigned int sentry,
-			       struct ppa_addr *ppa_list,
-			       unsigned long *lun_bitmap,
-			       struct pblk_sec_meta *meta_list,
-			       unsigned int valid_secs)
+static int pblk_map_page_data(struct pblk *pblk, unsigned int sentry,
+			      struct ppa_addr *ppa_list,
+			      unsigned long *lun_bitmap,
+			      struct pblk_sec_meta *meta_list,
+			      unsigned int valid_secs)
 {
 	struct pblk_line *line = pblk_line_get_data(pblk);
 	struct pblk_emeta *emeta;
@@ -35,8 +35,14 @@ static void pblk_map_page_data(struct pblk *pblk, unsigned int sentry,
 	if (pblk_line_is_full(line)) {
 		struct pblk_line *prev_line = line;
 
+		/* If we cannot allocate a new line, make sure to store metadata
+		 * on current line and then fail
+		 */
 		line = pblk_line_replace_data(pblk);
 		pblk_line_close_meta(pblk, prev_line);
+
+		if (!line)
+			return -EINTR;
 	}
 
 	emeta = line->emeta;
@@ -74,6 +80,7 @@ static void pblk_map_page_data(struct pblk *pblk, unsigned int sentry,
 	}
 
 	pblk_down_rq(pblk, ppa_list, nr_secs, lun_bitmap);
+	return 0;
 }
 
 void pblk_map_rq(struct pblk *pblk, struct nvm_rq *rqd, unsigned int sentry,
@@ -87,8 +94,12 @@ void pblk_map_rq(struct pblk *pblk, struct nvm_rq *rqd, unsigned int sentry,
 
 	for (i = off; i < rqd->nr_ppas; i += min) {
 		map_secs = (i + min > valid_secs) ? (valid_secs % min) : min;
-		pblk_map_page_data(pblk, sentry + i, &rqd->ppa_list[i],
-					lun_bitmap, &meta_list[i], map_secs);
+		if (pblk_map_page_data(pblk, sentry + i, &rqd->ppa_list[i],
+					lun_bitmap, &meta_list[i], map_secs)) {
+			bio_put(rqd->bio);
+			pblk_free_rqd(pblk, rqd, PBLK_WRITE);
+			pblk_pipeline_stop(pblk);
+		}
 	}
 }
 
@@ -108,8 +119,12 @@ void pblk_map_erase_rq(struct pblk *pblk, struct nvm_rq *rqd,
 
 	for (i = 0; i < rqd->nr_ppas; i += min) {
 		map_secs = (i + min > valid_secs) ? (valid_secs % min) : min;
-		pblk_map_page_data(pblk, sentry + i, &rqd->ppa_list[i],
-					lun_bitmap, &meta_list[i], map_secs);
+		if (pblk_map_page_data(pblk, sentry + i, &rqd->ppa_list[i],
+					lun_bitmap, &meta_list[i], map_secs)) {
+			bio_put(rqd->bio);
+			pblk_free_rqd(pblk, rqd, PBLK_WRITE);
+			pblk_pipeline_stop(pblk);
+		}
 
 		erase_lun = pblk_ppa_to_pos(geo, rqd->ppa_list[i]);
 
Signature · 1 line
2.11.0
#2 lore raw

[GIT PULL 03/20] lightnvm: pblk: check read lba on gc path

In reply to Matias Bjørling

From: Javier González <[email protected]>

Check that the lba stored in the LBA metadata is correct in the GC path too. This requires a new helper function to check random reads in the vector read.

---
 drivers/lightnvm/pblk-read.c | 39 +++++++++++++++++++++++++++++++++------
 1 file changed, 33 insertions(+), 6 deletions(-)
drivers/lightnvm/pblk-read.c +33 -6
index 9eee10f69df0..1f699c09e0ea 100644
@@ -113,15 +113,14 @@ static int pblk_submit_read_io(struct pblk *pblk, struct nvm_rq *rqd)
 	return NVM_IO_OK;
 }
 
-static void pblk_read_check(struct pblk *pblk, struct nvm_rq *rqd,
-			   sector_t blba)
+static void pblk_read_check_seq(struct pblk *pblk, void *meta_list,
+				sector_t blba, int nr_lbas)
 {
-	struct pblk_sec_meta *meta_list = rqd->meta_list;
-	int nr_lbas = rqd->nr_ppas;
+	struct pblk_sec_meta *meta_lba_list = meta_list;
 	int i;
 
 	for (i = 0; i < nr_lbas; i++) {
-		u64 lba = le64_to_cpu(meta_list[i].lba);
+		u64 lba = le64_to_cpu(meta_lba_list[i].lba);
 
 		if (lba == ADDR_EMPTY)
 			continue;
@@ -130,6 +129,32 @@ static void pblk_read_check(struct pblk *pblk, struct nvm_rq *rqd,
 	}
 }
 
+/*
+ * There can be holes in the lba list.
+ */
+static void pblk_read_check_rand(struct pblk *pblk, void *meta_list,
+				u64 *lba_list, int nr_lbas)
+{
+	struct pblk_sec_meta *meta_lba_list = meta_list;
+	int i, j;
+
+	for (i = 0, j = 0; i < nr_lbas; i++) {
+		u64 lba = lba_list[i];
+		u64 meta_lba;
+
+		if (lba == ADDR_EMPTY)
+			continue;
+
+		meta_lba = le64_to_cpu(meta_lba_list[j++].lba);
+
+		if (lba != meta_lba) {
+			pr_err("pblk: corrupted read LBA (%llu/%llu)\n",
+								lba, meta_lba);
+			WARN_ON(1);
+		}
+	}
+}
+
 static void pblk_read_put_rqd_kref(struct pblk *pblk, struct nvm_rq *rqd)
 {
 	struct ppa_addr *ppa_list;
@@ -172,7 +197,7 @@ static void __pblk_end_io_read(struct pblk *pblk, struct nvm_rq *rqd,
 		WARN_ONCE(bio->bi_status, "pblk: corrupted read error\n");
 #endif
 
-	pblk_read_check(pblk, rqd, r_ctx->lba);
+	pblk_read_check_seq(pblk, rqd->meta_list, r_ctx->lba, rqd->nr_ppas);
 
 	bio_put(bio);
 	if (r_ctx->private)
@@ -585,6 +610,8 @@ int pblk_submit_read_gc(struct pblk *pblk, struct pblk_gc_rq *gc_rq)
 		goto err_free_bio;
 	}
 
+	pblk_read_check_rand(pblk, rqd.meta_list, gc_rq->lba_list, rqd.nr_ppas);
+
 	atomic_dec(&pblk->inflight_io);
 
 	if (rqd.error) {
Signature · 1 line
2.11.0
#3 lore raw

[GIT PULL 02/20] lightnvm: pblk: recheck for bad lines at runtime

In reply to Matias Bjørling

From: Javier González <[email protected]>

Bad blocks can grow at runtime. Check that the number of valid blocks in a line are within the sanity threshold before allocating the line for new writes.

---
 drivers/lightnvm/pblk-core.c | 38 ++++++++++++++++++++++++++++----------
 drivers/lightnvm/pblk-init.c | 11 +++++++----
 2 files changed, 35 insertions(+), 14 deletions(-)
drivers/lightnvm/pblk-core.c +28 -10
index 94d5d97c9d8a..2cad918434a7 100644
@@ -1174,7 +1174,8 @@ static int pblk_prepare_new_line(struct pblk *pblk, struct pblk_line *line)
 static int pblk_line_prepare(struct pblk *pblk, struct pblk_line *line)
 {
 	struct pblk_line_meta *lm = &pblk->lm;
-	int blk_to_erase;
+	int blk_in_line = atomic_read(&line->blk_in_line);
+	int blk_to_erase, ret;
 
 	line->map_bitmap = kzalloc(lm->sec_bitmap_len, GFP_ATOMIC);
 	if (!line->map_bitmap)
@@ -1183,8 +1184,8 @@ static int pblk_line_prepare(struct pblk *pblk, struct pblk_line *line)
 	/* will be initialized using bb info from map_bitmap */
 	line->invalid_bitmap = kmalloc(lm->sec_bitmap_len, GFP_ATOMIC);
 	if (!line->invalid_bitmap) {
-		kfree(line->map_bitmap);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto fail_free_map_bitmap;
 	}
 
 	/* Bad blocks do not need to be erased */
@@ -1199,16 +1200,19 @@ static int pblk_line_prepare(struct pblk *pblk, struct pblk_line *line)
 		blk_to_erase = pblk_prepare_new_line(pblk, line);
 		line->state = PBLK_LINESTATE_FREE;
 	} else {
-		blk_to_erase = atomic_read(&line->blk_in_line);
+		blk_to_erase = blk_in_line;
+	}
+
+	if (blk_in_line < lm->min_blk_line) {
+		ret = -EAGAIN;
+		goto fail_free_invalid_bitmap;
 	}
 
 	if (line->state != PBLK_LINESTATE_FREE) {
-		kfree(line->map_bitmap);
-		kfree(line->invalid_bitmap);
-		spin_unlock(&line->lock);
 		WARN(1, "pblk: corrupted line %d, state %d\n",
 							line->id, line->state);
-		return -EAGAIN;
+		ret = -EINTR;
+		goto fail_free_invalid_bitmap;
 	}
 
 	line->state = PBLK_LINESTATE_OPEN;
@@ -1222,6 +1226,16 @@ static int pblk_line_prepare(struct pblk *pblk, struct pblk_line *line)
 	kref_init(&line->ref);
 
 	return 0;
+
+fail_free_invalid_bitmap:
+	spin_unlock(&line->lock);
+	kfree(line->invalid_bitmap);
+	line->invalid_bitmap = NULL;
+fail_free_map_bitmap:
+	kfree(line->map_bitmap);
+	line->map_bitmap = NULL;
+
+	return ret;
 }
 
 int pblk_line_recov_alloc(struct pblk *pblk, struct pblk_line *line)
@@ -1292,10 +1306,14 @@ struct pblk_line *pblk_line_get(struct pblk *pblk)
 
 	ret = pblk_line_prepare(pblk, line);
 	if (ret) {
-		if (ret == -EAGAIN) {
+		switch (ret) {
+		case -EAGAIN:
+			list_add(&line->list, &l_mg->bad_list);
+			goto retry;
+		case -EINTR:
 			list_add(&line->list, &l_mg->corrupt_list);
 			goto retry;
-		} else {
+		default:
 			pr_err("pblk: failed to prepare line %d\n", line->id);
 			list_add(&line->list, &l_mg->free_list);
 			l_mg->nr_free_lines++;
drivers/lightnvm/pblk-init.c +7 -4
index dee64f91227d..8f8c9abd14fc 100644
@@ -127,10 +127,8 @@ static int pblk_l2p_recover(struct pblk *pblk, bool factory_init)
 	if (!line) {
 		/* Configure next line for user data */
 		line = pblk_line_get_first_data(pblk);
-		if (!line) {
-			pr_err("pblk: line list corrupted\n");
+		if (!line)
 			return -EFAULT;
-		}
 	}
 
 	return 0;
@@ -141,6 +139,7 @@ static int pblk_l2p_init(struct pblk *pblk, bool factory_init)
 	sector_t i;
 	struct ppa_addr ppa;
 	size_t map_size;
+	int ret = 0;
 
 	map_size = pblk_trans_map_size(pblk);
 	pblk->trans_map = vmalloc(map_size);
@@ -152,7 +151,11 @@ static int pblk_l2p_init(struct pblk *pblk, bool factory_init)
 	for (i = 0; i < pblk->rl.nr_secs; i++)
 		pblk_trans_map_set(pblk, i, ppa);
 
-	return pblk_l2p_recover(pblk, factory_init);
+	ret = pblk_l2p_recover(pblk, factory_init);
+	if (ret)
+		vfree(pblk->trans_map);
+
+	return ret;
 }
 
 static void pblk_rwb_free(struct pblk *pblk)
Signature · 1 line
2.11.0
#4 lore raw

[GIT PULL 13/20] lightnvm: pblk: garbage collect lines with failed writes

In reply to Matias Bjørling

From: Hans Holmberg <[email protected]>

Write failures should not happen under normal circumstances, so in order to bring the chunk back into a known state as soon as possible, evacuate all the valid data out of the line and let the fw judge if the block can be written to in the next reset cycle.

Do this by introducing a new gc list for lines with failed writes, and ensure that the rate limiter allocates a small portion of the write bandwidth to get the job done.

The lba list is saved in memory for use during gc as we cannot gurantee that the emeta data is readable if a write error occurred.

---
 drivers/lightnvm/pblk-core.c  |  45 ++++++++++++++++++-
 drivers/lightnvm/pblk-gc.c    | 102 +++++++++++++++++++++++++++---------------
 drivers/lightnvm/pblk-init.c  |  46 ++++++++++++-------
 drivers/lightnvm/pblk-rl.c    |  29 ++++++++++--
 drivers/lightnvm/pblk-sysfs.c |  15 ++++++-
 drivers/lightnvm/pblk-write.c |   2 +
 drivers/lightnvm/pblk.h       |  25 +++++++++--
 7 files changed, 200 insertions(+), 64 deletions(-)
drivers/lightnvm/pblk-core.c +43 -2
index 5dae72e8b46b..263da2e43567 100644
@@ -373,7 +373,13 @@ struct list_head *pblk_line_gc_list(struct pblk *pblk, struct pblk_line *line)
 
 	lockdep_assert_held(&line->lock);
 
-	if (!vsc) {
+	if (line->w_err_gc->has_write_err) {
+		if (line->gc_group != PBLK_LINEGC_WERR) {
+			line->gc_group = PBLK_LINEGC_WERR;
+			move_list = &l_mg->gc_werr_list;
+			pblk_rl_werr_line_in(&pblk->rl);
+		}
+	} else if (!vsc) {
 		if (line->gc_group != PBLK_LINEGC_FULL) {
 			line->gc_group = PBLK_LINEGC_FULL;
 			move_list = &l_mg->gc_full_list;
@@ -1589,8 +1595,13 @@ static void __pblk_line_put(struct pblk *pblk, struct pblk_line *line)
 	line->state = PBLK_LINESTATE_FREE;
 	line->gc_group = PBLK_LINEGC_NONE;
 	pblk_line_free(line);
+
+	if (line->w_err_gc->has_write_err) {
+		pblk_rl_werr_line_out(&pblk->rl);
+		line->w_err_gc->has_write_err = 0;
+	}
+
 	spin_unlock(&line->lock);
-
 	atomic_dec(&gc->pipeline_gc);
 
 	spin_lock(&l_mg->free_lock);
@@ -1753,11 +1764,34 @@ void pblk_line_close_meta(struct pblk *pblk, struct pblk_line *line)
 
 	spin_lock(&l_mg->close_lock);
 	spin_lock(&line->lock);
+
+	/* Update the in-memory start address for emeta, in case it has
+	 * shifted due to write errors
+	 */
+	if (line->emeta_ssec != line->cur_sec)
+		line->emeta_ssec = line->cur_sec;
+
 	list_add_tail(&line->list, &l_mg->emeta_list);
 	spin_unlock(&line->lock);
 	spin_unlock(&l_mg->close_lock);
 
 	pblk_line_should_sync_meta(pblk);
+
+
+}
+
+static void pblk_save_lba_list(struct pblk *pblk, struct pblk_line *line)
+{
+	struct pblk_line_meta *lm = &pblk->lm;
+	struct pblk_line_mgmt *l_mg = &pblk->l_mg;
+	unsigned int lba_list_size = lm->emeta_len[2];
+	struct pblk_w_err_gc *w_err_gc = line->w_err_gc;
+	struct pblk_emeta *emeta = line->emeta;
+
+	w_err_gc->lba_list = pblk_malloc(lba_list_size,
+					 l_mg->emeta_alloc_type, GFP_KERNEL);
+	memcpy(w_err_gc->lba_list, emeta_to_lbas(pblk, emeta->buf),
+				lba_list_size);
 }
 
 void pblk_line_close_ws(struct work_struct *work)
@@ -1766,6 +1800,13 @@ void pblk_line_close_ws(struct work_struct *work)
 									ws);
 	struct pblk *pblk = line_ws->pblk;
 	struct pblk_line *line = line_ws->line;
+	struct pblk_w_err_gc *w_err_gc = line->w_err_gc;
+
+	/* Write errors makes the emeta start address stored in smeta invalid,
+	 * so keep a copy of the lba list until we've gc'd the line
+	 */
+	if (w_err_gc->has_write_err)
+		pblk_save_lba_list(pblk, line);
 
 	pblk_line_close(pblk, line);
 	mempool_free(line_ws, pblk->gen_ws_pool);
drivers/lightnvm/pblk-gc.c +65 -37

159 lines not on this page · raw message

drivers/lightnvm/pblk-init.c +31 -15

88 lines not on this page · raw message

drivers/lightnvm/pblk-rl.c +25 -4
index 883a7113b19d..6a0616a6fcaf 100644
@@ -73,6 +73,16 @@ void pblk_rl_user_in(struct pblk_rl *rl, int nr_entries)
 	pblk_rl_kick_u_timer(rl);
 }
 
+void pblk_rl_werr_line_in(struct pblk_rl *rl)
+{
+	atomic_inc(&rl->werr_lines);
+}
+
+void pblk_rl_werr_line_out(struct pblk_rl *rl)
+{
+	atomic_dec(&rl->werr_lines);
+}
+
 void pblk_rl_gc_in(struct pblk_rl *rl, int nr_entries)
 {
 	atomic_add(nr_entries, &rl->rb_gc_cnt);
@@ -99,11 +109,21 @@ static void __pblk_rl_update_rates(struct pblk_rl *rl,
 {
 	struct pblk *pblk = container_of(rl, struct pblk, rl);
 	int max = rl->rb_budget;
+	int werr_gc_needed = atomic_read(&rl->werr_lines);
 
 	if (free_blocks >= rl->high) {
-		rl->rb_user_max = max;
-		rl->rb_gc_max = 0;
-		rl->rb_state = PBLK_RL_HIGH;
+		if (werr_gc_needed) {
+			/* Allocate a small budget for recovering
+			 * lines with write errors
+			 */
+			rl->rb_gc_max = 1 << rl->rb_windows_pw;
+			rl->rb_user_max = max - rl->rb_gc_max;
+			rl->rb_state = PBLK_RL_WERR;
+		} else {
+			rl->rb_user_max = max;
+			rl->rb_gc_max = 0;
+			rl->rb_state = PBLK_RL_OFF;
+		}
 	} else if (free_blocks < rl->high) {
 		int shift = rl->high_pw - rl->rb_windows_pw;
 		int user_windows = free_blocks >> shift;
@@ -124,7 +144,7 @@ static void __pblk_rl_update_rates(struct pblk_rl *rl,
 		rl->rb_state = PBLK_RL_LOW;
 	}
 
-	if (rl->rb_state == (PBLK_RL_MID | PBLK_RL_LOW))
+	if (rl->rb_state != PBLK_RL_OFF)
 		pblk_gc_should_start(pblk);
 	else
 		pblk_gc_should_stop(pblk);
@@ -221,6 +241,7 @@ void pblk_rl_init(struct pblk_rl *rl, int budget)
 	atomic_set(&rl->rb_user_cnt, 0);
 	atomic_set(&rl->rb_gc_cnt, 0);
 	atomic_set(&rl->rb_space, -1);
+	atomic_set(&rl->werr_lines, 0);
 
 	timer_setup(&rl->u_timer, pblk_rl_u_timer, 0);
 
drivers/lightnvm/pblk-sysfs.c +13 -2
index e61909af23a5..88a0a7c407aa 100644
@@ -173,6 +173,8 @@ static ssize_t pblk_sysfs_lines(struct pblk *pblk, char *page)
 	int free_line_cnt = 0, closed_line_cnt = 0, emeta_line_cnt = 0;
 	int d_line_cnt = 0, l_line_cnt = 0;
 	int gc_full = 0, gc_high = 0, gc_mid = 0, gc_low = 0, gc_empty = 0;
+	int gc_werr = 0;
+
 	int bad = 0, cor = 0;
 	int msecs = 0, cur_sec = 0, vsc = 0, sec_in_line = 0;
 	int map_weight = 0, meta_weight = 0;
@@ -237,6 +239,15 @@ static ssize_t pblk_sysfs_lines(struct pblk *pblk, char *page)
 		gc_empty++;
 	}
 
+	list_for_each_entry(line, &l_mg->gc_werr_list, list) {
+		if (line->type == PBLK_LINETYPE_DATA)
+			d_line_cnt++;
+		else if (line->type == PBLK_LINETYPE_LOG)
+			l_line_cnt++;
+		closed_line_cnt++;
+		gc_werr++;
+	}
+
 	list_for_each_entry(line, &l_mg->bad_list, list)
 		bad++;
 	list_for_each_entry(line, &l_mg->corrupt_list, list)
@@ -275,8 +286,8 @@ static ssize_t pblk_sysfs_lines(struct pblk *pblk, char *page)
 					l_mg->nr_lines);
 
 	sz += snprintf(page + sz, PAGE_SIZE - sz,
-		"GC: full:%d, high:%d, mid:%d, low:%d, empty:%d, queue:%d\n",
-			gc_full, gc_high, gc_mid, gc_low, gc_empty,
+		"GC: full:%d, high:%d, mid:%d, low:%d, empty:%d, werr: %d, queue:%d\n",
+			gc_full, gc_high, gc_mid, gc_low, gc_empty, gc_werr,
 			atomic_read(&pblk->gc.read_inflight_gc));
 
 	sz += snprintf(page + sz, PAGE_SIZE - sz,
drivers/lightnvm/pblk-write.c +2 -0
index f62e432f7c91..f33c2c3993f0 100644
@@ -136,6 +136,7 @@ static void pblk_map_remaining(struct pblk *pblk, struct ppa_addr *ppa)
 		}
 	}
 
+	line->w_err_gc->has_write_err = 1;
 	spin_unlock(&line->lock);
 }
 
@@ -279,6 +280,7 @@ static void pblk_end_io_write_meta(struct nvm_rq *rqd)
 	if (rqd->error) {
 		pblk_log_write_err(pblk, rqd);
 		pr_err("pblk: metadata I/O failed. Line %d\n", line->id);
+		line->w_err_gc->has_write_err = 1;
 	}
 
 	sync = atomic_add_return(rqd->nr_ppas, &emeta->sync);
drivers/lightnvm/pblk.h +21 -4
index a75ffae53a0d..7fbdfdc809d3 100644
@@ -89,12 +89,14 @@ struct pblk_sec_meta {
 /* The number of GC lists and the rate-limiter states go together. This way the
  * rate-limiter can dictate how much GC is needed based on resource utilization.
  */
-#define PBLK_GC_NR_LISTS 3
+#define PBLK_GC_NR_LISTS 4
 
 enum {
-	PBLK_RL_HIGH = 1,
-	PBLK_RL_MID = 2,
-	PBLK_RL_LOW = 3,
+	PBLK_RL_OFF = 0,
+	PBLK_RL_WERR = 1,
+	PBLK_RL_HIGH = 2,
+	PBLK_RL_MID = 3,
+	PBLK_RL_LOW = 4
 };
 
 #define pblk_dma_meta_size (sizeof(struct pblk_sec_meta) * PBLK_MAX_REQ_ADDRS)
@@ -278,6 +280,8 @@ struct pblk_rl {
 	int rb_user_active;
 	int rb_gc_active;
 
+	atomic_t werr_lines;	/* Number of write error lines that needs gc */
+
 	struct timer_list u_timer;
 
 	unsigned long long nr_secs;
@@ -311,6 +315,7 @@ enum {
 	PBLK_LINEGC_MID = 23,
 	PBLK_LINEGC_HIGH = 24,
 	PBLK_LINEGC_FULL = 25,
+	PBLK_LINEGC_WERR = 26
 };
 
 #define PBLK_MAGIC 0x70626c6b /*pblk*/
@@ -412,6 +417,11 @@ struct pblk_smeta {
 	struct line_smeta *buf;		/* smeta buffer in persistent format */
 };
 
+struct pblk_w_err_gc {
+	int has_write_err;
+	__le64 *lba_list;
+};
+
 struct pblk_line {
 	struct pblk *pblk;
 	unsigned int id;		/* Line number corresponds to the
@@ -457,6 +467,8 @@ struct pblk_line {
 
 	struct kref ref;		/* Write buffer L2P references */
 
+	struct pblk_w_err_gc *w_err_gc;	/* Write error gc recovery metadata */
+
 	spinlock_t lock;		/* Necessary for invalid_bitmap only */
 };
 
@@ -488,6 +500,8 @@ struct pblk_line_mgmt {
 	struct list_head gc_mid_list;	/* Full lines ready to GC, mid isc */
 	struct list_head gc_low_list;	/* Full lines ready to GC, low isc */
 
+	struct list_head gc_werr_list;  /* Write err recovery list */
+
 	struct list_head gc_full_list;	/* Full lines ready to GC, no valid */
 	struct list_head gc_empty_list;	/* Full lines close, all valid */
 
@@ -890,6 +904,9 @@ void pblk_rl_free_lines_dec(struct pblk_rl *rl, struct pblk_line *line,
 			    bool used);
 int pblk_rl_is_limit(struct pblk_rl *rl);
 
+void pblk_rl_werr_line_in(struct pblk_rl *rl);
+void pblk_rl_werr_line_out(struct pblk_rl *rl);
+
 /*
  * pblk sysfs
  */
Signature · 1 line
2.11.0
#5 lore raw

[GIT PULL 14/20] lightnvm: pblk: fix smeta write error path

In reply to Matias Bjørling

From: Hans Holmberg <[email protected]>

Smeta write errors were previously ignored. Skip these lines instead and throw them back on the free list, so the chunks will go through a reset cycle before we attempt to use the line again.

---
 drivers/lightnvm/pblk-core.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/lightnvm/pblk-core.c +4 -3
index 263da2e43567..e43093e27084 100644
@@ -849,9 +849,10 @@ static int pblk_line_submit_smeta_io(struct pblk *pblk, struct pblk_line *line,
 	atomic_dec(&pblk->inflight_io);
 
 	if (rqd.error) {
-		if (dir == PBLK_WRITE)
+		if (dir == PBLK_WRITE) {
 			pblk_log_write_err(pblk, &rqd);
-		else if (dir == PBLK_READ)
+			ret = 1;
+		} else if (dir == PBLK_READ)
 			pblk_log_read_err(pblk, &rqd);
 	}
 
@@ -1101,7 +1102,7 @@ static int pblk_line_init_bb(struct pblk *pblk, struct pblk_line *line,
 
 	if (init && pblk_line_submit_smeta_io(pblk, line, off, PBLK_WRITE)) {
 		pr_debug("pblk: line smeta I/O failed. Retry\n");
-		return 1;
+		return 0;
 	}
 
 	bitmap_copy(line->invalid_bitmap, line->map_bitmap, lm->sec_per_line);
Signature · 1 line
2.11.0
#6 lore raw

[GIT PULL 12/20] lightnvm: pblk: rework write error recovery path

In reply to Matias Bjørling

From: Hans Holmberg <[email protected]>

The write error recovery path is incomplete, so rework the write error recovery handling to do resubmits directly from the write buffer.

When a write error occurs, the remaining sectors in the chunk are mapped out and invalidated and the request inserted in a resubmit list.

The writer thread checks if there are any requests to resubmit, scans and invalidates any lbas that have been overwritten by later writes and resubmits the failed entries.

---
 drivers/lightnvm/pblk-init.c     |   2 +
 drivers/lightnvm/pblk-rb.c       |  39 ------
 drivers/lightnvm/pblk-recovery.c |  91 -------------
 drivers/lightnvm/pblk-write.c    | 279 +++++++++++++++++++++++++--------------
 drivers/lightnvm/pblk.h          |  11 +-
 5 files changed, 187 insertions(+), 235 deletions(-)
drivers/lightnvm/pblk-init.c +2 -0
index bfc488d0dda9..6f06727afcf6 100644
@@ -426,6 +426,7 @@ static int pblk_core_init(struct pblk *pblk)
 		goto free_r_end_wq;
 
 	INIT_LIST_HEAD(&pblk->compl_list);
+	INIT_LIST_HEAD(&pblk->resubmit_list);
 
 	return 0;
 
@@ -1185,6 +1186,7 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct gendisk *tdisk,
 	pblk->state = PBLK_STATE_RUNNING;
 	pblk->gc.gc_enabled = 0;
 
+	spin_lock_init(&pblk->resubmit_lock);
 	spin_lock_init(&pblk->trans_lock);
 	spin_lock_init(&pblk->lock);
 
drivers/lightnvm/pblk-rb.c +0 -39
index 58946ffebe81..1b74ec51a4ad 100644
@@ -503,45 +503,6 @@ int pblk_rb_may_write_gc(struct pblk_rb *rb, unsigned int nr_entries,
 }
 
 /*
- * The caller of this function must ensure that the backpointer will not
- * overwrite the entries passed on the list.
- */
-unsigned int pblk_rb_read_to_bio_list(struct pblk_rb *rb, struct bio *bio,
-				      struct list_head *list,
-				      unsigned int max)
-{
-	struct pblk_rb_entry *entry, *tentry;
-	struct page *page;
-	unsigned int read = 0;
-	int ret;
-
-	list_for_each_entry_safe(entry, tentry, list, index) {
-		if (read > max) {
-			pr_err("pblk: too many entries on list\n");
-			goto out;
-		}
-
-		page = virt_to_page(entry->data);
-		if (!page) {
-			pr_err("pblk: could not allocate write bio page\n");
-			goto out;
-		}
-
-		ret = bio_add_page(bio, page, rb->seg_size, 0);
-		if (ret != rb->seg_size) {
-			pr_err("pblk: could not add page to write bio\n");
-			goto out;
-		}
-
-		list_del(&entry->index);
-		read++;
-	}
-
-out:
-	return read;
-}
-
-/*
  * Read available entries on rb and add them to the given bio. To avoid a memory
  * copy, a page reference to the write buffer is used to be added to the bio.
  *
drivers/lightnvm/pblk-recovery.c +0 -91

97 lines not on this page · raw message

drivers/lightnvm/pblk-write.c +182 -97

322 lines not on this page · raw message

drivers/lightnvm/pblk.h +3 -8
index 5a4daf0b949d..a75ffae53a0d 100644
@@ -128,7 +128,6 @@ struct pblk_pad_rq {
 struct pblk_rec_ctx {
 	struct pblk *pblk;
 	struct nvm_rq *rqd;
-	struct list_head failed;
 	struct work_struct ws_rec;
 };
 
@@ -664,6 +663,9 @@ struct pblk {
 
 	struct list_head compl_list;
 
+	spinlock_t resubmit_lock;	 /* Resubmit list lock */
+	struct list_head resubmit_list; /* Resubmit list for failed writes*/
+
 	mempool_t *page_bio_pool;
 	mempool_t *gen_ws_pool;
 	mempool_t *rec_pool;
@@ -713,9 +715,6 @@ void pblk_rb_sync_l2p(struct pblk_rb *rb);
 unsigned int pblk_rb_read_to_bio(struct pblk_rb *rb, struct nvm_rq *rqd,
 				 unsigned int pos, unsigned int nr_entries,
 				 unsigned int count);
-unsigned int pblk_rb_read_to_bio_list(struct pblk_rb *rb, struct bio *bio,
-				      struct list_head *list,
-				      unsigned int max);
 int pblk_rb_copy_to_bio(struct pblk_rb *rb, struct bio *bio, sector_t lba,
 			struct ppa_addr ppa, int bio_iter, bool advanced_bio);
 unsigned int pblk_rb_read_commit(struct pblk_rb *rb, unsigned int entries);
@@ -848,13 +847,9 @@ int pblk_submit_read_gc(struct pblk *pblk, struct pblk_gc_rq *gc_rq);
 /*
  * pblk recovery
  */
-void pblk_submit_rec(struct work_struct *work);
 struct pblk_line *pblk_recov_l2p(struct pblk *pblk);
 int pblk_recov_pad(struct pblk *pblk);
 int pblk_recov_check_emeta(struct pblk *pblk, struct line_emeta *emeta);
-int pblk_recov_setup_rq(struct pblk *pblk, struct pblk_c_ctx *c_ctx,
-			struct pblk_rec_ctx *recovery, u64 *comp_bits,
-			unsigned int comp);
 
 /*
  * pblk gc
Signature · 1 line
2.11.0
#7 lore raw

[GIT PULL 20/20] lightnvm: pblk: sync RB and RL states during GC

In reply to Matias Bjørling

From: Igor Konopko <[email protected]>

During sequential workloads we can met the case when almost all the lines are fully written with data. In that case rate limiter will significantly reduce the max number of requests for user IOs.

Unfortunately in the case when round buffer is flushed to drive and the entries are not yet removed (which is ok, since there is still enough free entries in round buffer for user IO) we hang on user IO due to not enough entries in rate limiter. The reason is that rate limiter user entries are decreased after freeing the round buffer entries, which does not happen if there is still plenty of space in round buffer.

This patch forces freeing the round buffer by calling pblk_rb_sync_l2p and thus making new free entries in rate limiter, when there is no enough of them for user IO.

Reworded description.

---
 drivers/lightnvm/pblk-init.c | 2 ++
 drivers/lightnvm/pblk-rb.c   | 7 +++----
 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/lightnvm/pblk-init.c +2 -0
index 25aa1e73984f..9d7d9e3b8506 100644
@@ -1159,7 +1159,9 @@ static void pblk_tear_down(struct pblk *pblk, bool graceful)
 		__pblk_pipeline_flush(pblk);
 	__pblk_pipeline_stop(pblk);
 	pblk_writer_stop(pblk);
+	spin_lock(&pblk->rwb.w_lock);
 	pblk_rb_sync_l2p(&pblk->rwb);
+	spin_unlock(&pblk->rwb.w_lock);
 	pblk_rl_free(&pblk->rl);
 
 	pr_debug("pblk: consistent tear down (graceful:%d)\n", graceful);
drivers/lightnvm/pblk-rb.c +3 -4
index 1b74ec51a4ad..91824cd3e8d8 100644
@@ -266,21 +266,18 @@ static int pblk_rb_update_l2p(struct pblk_rb *rb, unsigned int nr_entries,
  * Update the l2p entry for all sectors stored on the write buffer. This means
  * that all future lookups to the l2p table will point to a device address, not
  * to the cacheline in the write buffer.
+ * Caller must ensure that rb->w_lock is taken.
  */
 void pblk_rb_sync_l2p(struct pblk_rb *rb)
 {
 	unsigned int sync;
 	unsigned int to_update;
 
-	spin_lock(&rb->w_lock);
-
 	/* Protect from reads and writes */
 	sync = smp_load_acquire(&rb->sync);
 
 	to_update = pblk_rb_ring_count(sync, rb->l2p_update, rb->nr_entries);
 	__pblk_rb_update_l2p(rb, to_update);
-
-	spin_unlock(&rb->w_lock);
 }
 
 /*
@@ -462,6 +459,8 @@ int pblk_rb_may_write_user(struct pblk_rb *rb, struct bio *bio,
 	spin_lock(&rb->w_lock);
 	io_ret = pblk_rl_user_may_insert(&pblk->rl, nr_entries);
 	if (io_ret) {
+		/* Sync RB & L2P in order to update rate limiter values */
+		pblk_rb_sync_l2p(rb);
 		spin_unlock(&rb->w_lock);
 		return io_ret;
 	}
Signature · 1 line
2.11.0
#8 lore raw

Re: [GIT PULL 20/20] lightnvm: pblk: sync RB and RL states during GC

Javier

I somehow missed these patches in the mailing list. Sorry for coming with feedback this late. I'll look at my filters - in any case, would you mind Cc'ing me in the future?

Quoted 7 lines · Matias Bjørling

From: Igor Konopko <[email protected]>

During sequential workloads we can met the case when almost all the lines are fully written with data. In that case rate limiter will significantly reduce the max number of requests for user IOs.

Do you mean random writes? On fully sequential, a line will either be fully written, fully invalidated or on its way to be written. When invalidating the line, then the whole line will be invalidated and GC will free it without having to move valid data.

Quoted 9 lines

Unfortunately in the case when round buffer is flushed to drive and the entries are not yet removed (which is ok, since there is still enough free entries in round buffer for user IO) we hang on user IO due to not enough entries in rate limiter. The reason is that rate limiter user entries are decreased after freeing the round buffer entries, which does not happen if there is still plenty of space in round buffer.

Quoted 3 lines

This patch forces freeing the round buffer by calling pblk_rb_sync_l2p and thus making new free entries in rate limiter, when there is no enough of them for user IO.

I can see why you might have problems with very low OP due to the rate limiter, but unfortunately this is not a good way of solving the problem. When you do this, you basically make the L2P to point to the device instead of pointing to the write cache, which in essence bypasses mw_cuints. As a result, if a read comes in to one of the synced entries, it will violate the device-host contract and most probably fail (for sure fail on > SLC).

I think that the right way of solving this problem is separating the write and GC buffers and then assigning tokens to them. The write thread will then consume both buffers based on these tokens. In this case, user I/O will have a buffer for itself, which will be guaranteed to advance at the rate the rate-limiter is allowing it to. Note that the 2 buffers can be a single buffer with a new set of pointers so that the lookup can be done with a single bit.

I have been looking for time to implement this for a while. If you want to give it a go, we can talk and I can give you some pointers on potential issues I have thought about.

Javier

#9 lore raw

RE: [GIT PULL 20/20] lightnvm: pblk: sync RB and RL states during GC

Quoted 5 lines

From: Javier Gonzalez [mailto:[email protected]]
Do you mean random writes? On fully sequential, a line will either be fully written, fully invalidated or on its way to be written. When invalidating the line, then the whole line will be invalidated and GC will free it without having to move valid data.

I meant sequential writes, since this is the easiest way to reach rl->rb_state = PBLK_RL_LOW. When we updating this values inside __pblk_rl_update_rates(), most of the times rl->rb_user_cnt will became equal to rl->rb_user_max - which means that we cannot handle any more user IOs. In that case pblk_rl_user_may_insert() will return false, no one will call pblk_rb_update_l2p(), rl->rb_user_cnt will not be decreased, so user IOs will stuck for forever.

Quoted 7 lines

I can see why you might have problems with very low OP due to the rate limiter, but unfortunately this is not a good way of solving the problem. When you do this, you basically make the L2P to point to the device instead of pointing to the write cache, which in essence bypasses mw_cuints. As a result, if a read comes in to one of the synced entries, it will violate the device-host contract and most probably fail (for sure fail on > SLC).

What about using on that path some modified version of pblk_rb_sync_l2p() which will synchronize all the RB entries except last mw_cunits number of elements?

Also you wrote about mw_cuints definitely makes sense, but even without my changes I believe that we can lead into such a situation - especially for pblk with small number of LUNs assigned under write IOs with high sector count. Pblk_rb_update_l2p() does not explicitly takes mw_cunints this value into consideration right now.

Quoted 11 lines

I think that the right way of solving this problem is separating the write and GC buffers and then assigning tokens to them. The write thread will then consume both buffers based on these tokens. In this case, user I/O will have a buffer for itself, which will be guaranteed to advance at the rate the rate-limiter is allowing it to. Note that the 2 buffers can be a single buffer with a new set of pointers so that the lookup can be done with a single bit.

I have been looking for time to implement this for a while. If you want to give it a go, we can talk and I can give you some pointers on potential issues I have thought about.

I believe this is interesting option - we can discuss this for one of next releases.

#10 lore raw

Re: [GIT PULL 20/20] lightnvm: pblk: sync RB and RL states during GC

Quoted 9 lines · Igor J
Quoted 6 lines

From: Javier Gonzalez [mailto:[email protected]]
Do you mean random writes? On fully sequential, a line will either be fully written, fully invalidated or on its way to be written. When invalidating the line, then the whole line will be invalidated and GC will free it without having to move valid data.

Quoted 8 lines

I meant sequential writes, since this is the easiest way to reach rl->rb_state = PBLK_RL_LOW. When we updating this values inside __pblk_rl_update_rates(), most of the times rl->rb_user_cnt will became equal to rl->rb_user_max - which means that we cannot handle any more user IOs. In that case pblk_rl_user_may_insert() will return false, no one will call pblk_rb_update_l2p(), rl->rb_user_cnt will not be decreased, so user IOs will stuck for forever.

What OP are you using? Even with a 5%, full lines should start being freed as they are completely invalid. But fair enough, if you decide to optimize for a guaranteed sequential workload where the OP is only to support grown bad blocks, you will run into this issue.

Quoted 8 lines
Quoted 7 lines

I can see why you might have problems with very low OP due to the rate limiter, but unfortunately this is not a good way of solving the problem. When you do this, you basically make the L2P to point to the device instead of pointing to the write cache, which in essence bypasses mw_cuints. As a result, if a read comes in to one of the synced entries, it will violate the device-host contract and most probably fail (for sure fail on > SLC).

Quoted 4 lines

What about using on that path some modified version of pblk_rb_sync_l2p() which will synchronize all the RB entries except last mw_cunits number of elements?

Typically, the size of the buffer is the closest upper power of two to nr_luns * mw_cuints. So in essence, we only update the L2P as we wrap up. You could go down to match nr_luns * mw_cuints exactly, which depending on the media geometry can gain you some extra user entries.

Quoted 6 lines

Also you wrote about mw_cuints definitely makes sense, but even without my changes I believe that we can lead into such a situation - especially for pblk with small number of LUNs assigned under write IOs with high sector count. Pblk_rb_update_l2p() does not explicitly takes mw_cunints this value into consideration right now.

As mentioned, the size of the buffer is always over nr_luns * mw_cuints and we only update when we wrap up - this is, when the mem pointer (which writes new data to the write buffer), wraps and starts writing new data. So this case is guaranteed not to happen. In fact, this particular case is what inspired the design of the write buffer and the current 5 pointers to extend the typical head and tail.

Quoted 8 lines
Quoted 8 lines

I think that the right way of solving this problem is separating the write and GC buffers and then assigning tokens to them. The write thread will then consume both buffers based on these tokens. In this case, user I/O will have a buffer for itself, which will be guaranteed to advance at the rate the rate-limiter is allowing it to. Note that the 2 buffers can be a single buffer with a new set of pointers so that the lookup can be done with a single bit.

Quoted 6 lines
Quoted 3 lines

I have been looking for time to implement this for a while. If you want to give it a go, we can talk and I can give you some pointers on potential issues I have thought about.

I believe this is interesting option - we can discuss this for one of next releases.

Sure. Ping me if you want to discuss in more detail.

Javier

#11 lore raw

[GIT PULL 19/20] lightnvm: pblk: add possibility to set write buffer size manually

In reply to Matias Bjørling

From: Marcin Dziegielewski <[email protected]>

In some cases, users can want set write buffer size manually, e.g. to adjust it to specific workload. This patch provides the possibility to set write buffer size via module parameter feature.

---
 drivers/lightnvm/pblk-init.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/lightnvm/pblk-init.c +12 -2
index 0f277744266b..25aa1e73984f 100644
@@ -20,6 +20,11 @@
 
 #include "pblk.h"
 
+unsigned int write_buffer_size;
+
+module_param(write_buffer_size, uint, 0644);
+MODULE_PARM_DESC(write_buffer_size, "number of entries in a write buffer");
+
 static struct kmem_cache *pblk_ws_cache, *pblk_rec_cache, *pblk_g_rq_cache,
 				*pblk_w_rq_cache;
 static DECLARE_RWSEM(pblk_lock);
@@ -172,10 +177,15 @@ static int pblk_rwb_init(struct pblk *pblk)
 	struct nvm_tgt_dev *dev = pblk->dev;
 	struct nvm_geo *geo = &dev->geo;
 	struct pblk_rb_entry *entries;
-	unsigned long nr_entries;
+	unsigned long nr_entries, buffer_size;
 	unsigned int power_size, power_seg_sz;
 
-	nr_entries = pblk_rb_calculate_size(pblk->pgs_in_buffer);
+	if (write_buffer_size && (write_buffer_size > pblk->pgs_in_buffer))
+		buffer_size = write_buffer_size;
+	else
+		buffer_size = pblk->pgs_in_buffer;
+
+	nr_entries = pblk_rb_calculate_size(buffer_size);
 
 	entries = vzalloc(nr_entries * sizeof(struct pblk_rb_entry));
 	if (!entries)
Signature · 1 line
2.11.0
#12 lore raw

[GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

In reply to Matias Bjørling

From: Marcin Dziegielewski <[email protected]>

Some devices can expose mw_cunits equal to 0, it can cause creation of too small write buffer and cause performance to drop on write workloads.

To handle that, we use the default value for MLC and beacause it covers both 1.2 and 2.0 OC specification, setting up mw_cunits in nvme_nvm_setup_12 function isn't longer necessary.

---
 drivers/lightnvm/pblk-init.c | 10 +++++++++-
 drivers/nvme/host/lightnvm.c |  1 -
 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/lightnvm/pblk-init.c +9 -1
index d65d2f972ccf..0f277744266b 100644
@@ -356,7 +356,15 @@ static int pblk_core_init(struct pblk *pblk)
 	atomic64_set(&pblk->nr_flush, 0);
 	pblk->nr_flush_rst = 0;
 
-	pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
+	if (geo->mw_cunits) {
+		pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
+	} else {
+		pblk->pgs_in_buffer = (geo->ws_opt << 3) * geo->all_luns;
+		/*
+		 * Some devices can expose mw_cunits equal to 0, so let's use
+		 * here default safe value for MLC.
+		 */
+	}
 
 	pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE);
 	max_write_ppas = pblk->min_write_pgs * geo->all_luns;
drivers/nvme/host/lightnvm.c +0 -1
index 41279da799ed..c747792da915 100644
@@ -338,7 +338,6 @@ static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id,
 
 	geo->ws_min = sec_per_pg;
 	geo->ws_opt = sec_per_pg;
-	geo->mw_cunits = geo->ws_opt << 3;	/* default to MLC safe values */
 
 	/* Do not impose values for maximum number of open blocks as it is
 	 * unspecified in 1.2. Users of 1.2 must be aware of this and eventually
Signature · 1 line
2.11.0
#13 lore raw

Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 54 lines · Matias Bjørling

From: Marcin Dziegielewski <[email protected]>

Some devices can expose mw_cunits equal to 0, it can cause creation of too small write buffer and cause performance to drop on write workloads.

To handle that, we use the default value for MLC and beacause it covers both 1.2 and 2.0 OC specification, setting up mw_cunits in nvme_nvm_setup_12 function isn't longer necessary.

---
drivers/lightnvm/pblk-init.c | 10 +++++++++-
drivers/nvme/host/lightnvm.c | 1 -

2 files changed, 9 insertions(+), 2 deletions(-)
drivers/lightnvm/pblk-init.c +9 -1
index d65d2f972ccf..0f277744266b 100644
@@ -356,7 +356,15 @@ static int pblk_core_init(struct pblk *pblk)
 	atomic64_set(&pblk->nr_flush, 0);
 	pblk->nr_flush_rst = 0;
 
-	pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
+	if (geo->mw_cunits) {
+		pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
+	} else {
+		pblk->pgs_in_buffer = (geo->ws_opt << 3) * geo->all_luns;
+		/*
+		 * Some devices can expose mw_cunits equal to 0, so let's use
+		 * here default safe value for MLC.
+		 */
+	}
 
 	pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE);
 	max_write_ppas = pblk->min_write_pgs * geo->all_luns;
drivers/nvme/host/lightnvm.c +0 -2
index 41279da799ed..c747792da915 100644
@@ -338,7 +338,6 @@ static int nvme_nvm_setup_12(struct nvme_nvm_id12 *id,
 
 	geo->ws_min = sec_per_pg;
 	geo->ws_opt = sec_per_pg;
-	geo->mw_cunits = geo->ws_opt << 3;	/* default to MLC safe values */
 
 	/* Do not impose values for maximum number of open blocks as it is
 	 * unspecified in 1.2. Users of 1.2 must be aware of this and eventually
--
Quoted 1 line

2.11.0

By doing this, 1.2 future users (beyond pblk), will fail to have a valid mw_cunits value. It's ok to deal with the 0 case in pblk, but I believe that we should have the default value for 1.2 either way.

A more generic way of doing this would be to have a default value for 2.0 too, in case mw_cunits is reported as 0.

Javier

#14 lore raw

RE: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

DQpGcmlzdCBvZiBhbGwgSSB3YW50IHRvIHNheSBzb3JyeSBmb3IgbGF0ZSByZXNwb25zZSAtIEkg d2FzIG9uIGhvbGlkYXkuDQoNCj4gRnJvbTogSmF2aWVyIEdvbnphbGV6IFttYWlsdG86amF2aWVy QGNuZXhsYWJzLmNvbV0NCj4gU2VudDogTW9uZGF5LCBNYXkgMjgsIDIwMTggMTowMyBQTQ0KPiBU bzogTWF0aWFzIEJqw7hybGluZyA8bWJAbGlnaHRudm0uaW8+DQo+IENjOiBKZW5zIEF4Ym9lIDxh eGJvZUBmYi5jb20+OyBsaW51eC1ibG9ja0B2Z2VyLmtlcm5lbC5vcmc7IGxpbnV4LQ0KPiBrZXJu ZWxAdmdlci5rZXJ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Lg0KLSB3aGVuIG13X2N1bml0ID09IDAgIGJ1ZmZlciBzaXplIHNo b3VsZCBoYXZlIG51bWJlciBvZiBlbnRyaWVzIGF0IGxlYXN0ICB3c19taW4gKiBuciBfbHVucyBh bmQgd2UgY2FuIHVzZSB0aGUgc2FtZSBwdXNldWRvY29kZSBhcyBhYm92ZS4NCg0KRG8geW91IHNl ZSBhbnkgb3RoZXIgY2FzZT8gQ291bGQgeW91IGNsYXJpZnkgc2Vjb25kIGNhc2UgbWVudGlvbmVk IGJ5IHlvdSBvciBtYXliZSBkaWQgeW91IG1lYW4gb3Bwb3NpdGUgY2FzZT8gSWYgeWVzLCBJIGJl bGlldmUgdGhhdCBhYm92ZSBwc2V1ZG8gY29kZSB3aWxsIGhhbmRsZSBzdWNoIGNhc2UgdG9vLg0K DQo+IA0KPiA+DQo+ID4+Pj4gSmF2aWVyDQo+ID4+Pg0KPiA+Pj4gVGhhbmtzLA0KPiA+Pj4gTWFy Y2luDQo+ID4+DQo+ID4+IEphdmllcg0KPiA+IFRoYW5rcywNCj4gPiBNYXJjaW4NClRoYW5rcyEs DQpNYXJjaW4NCg0KDQo=

#19 lore raw

Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 170 lines · Marcin
Quoted 161 lines

From: Javier Gonzalez [mailto:[email protected]]
Sent: Monday, June 4, 2018 1:16 PM
To: Dziegielewski, Marcin <[email protected]>
Cc: Matias Bjørling <[email protected]>; Jens Axboe <[email protected]>; linux- [email protected]; [email protected]; Konopko, Igor J <[email protected]>
Subject: Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 1 line

On 4 Jun 2018, at 13.11, Dziegielewski, Marcin

Quoted 58 lines · <[email protected]> wrote:
Quoted 54 lines

-----Original Message-----
From: Javier Gonzalez [mailto:[email protected]]
Sent: Monday, June 4, 2018 12:22 PM
To: Dziegielewski, Marcin <[email protected]>
Cc: Matias Bjørling <[email protected]>; Jens Axboe <[email protected]>; linux- [email protected]; [email protected]; Konopko, Igor J <[email protected]>
Subject: Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 1 line

On 4 Jun 2018, at 12.09, Dziegielewski, Marcin

Quoted 42 lines · <[email protected]> wrote:

Frist of all I want to say sorry for late response - I was on holiday.

Quoted 40 lines

From: Javier Gonzalez [mailto:[email protected]]
Sent: Monday, May 28, 2018 1:03 PM
To: Matias Bjørling <[email protected]>
Cc: Jens Axboe <[email protected]>; [email protected]; linux- [email protected]; Dziegielewski, Marcin <[email protected]>; Konopko, Igor J <[email protected]>
Subject: Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 30 lines · Matias Bjørling

From: Marcin Dziegielewski <[email protected]>

Some devices can expose mw_cunits equal to 0, it can cause creation of too small write buffer and cause performance to drop on write workloads.

To handle that, we use the default value for MLC and beacause it covers both 1.2 and 2.0 OC specification, setting up mw_cunits in nvme_nvm_setup_12 function isn't longer necessary.

Signed-off-by: Marcin Dziegielewski
<[email protected]>

---
drivers/lightnvm/pblk-init.c | 10 +++++++++-
drivers/nvme/host/lightnvm.c | 1 -

2 files changed, 9 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/lightnvm/pblk-init.c index d65d2f972ccf..0f277744266b 100644

drivers/lightnvm/pblk-init.c +0 -0
@@ -356,7 +356,15 @@ static int pblk_core_init(struct pblk *pblk)
 	atomic64_set(&pblk->nr_flush, 0);
 	pblk->nr_flush_rst = 0;
 
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

drivers/lightnvm/pblk-init.c static int pblk_core_init(struct pblk *pblk) · line 360

Quoted 3 lines
drivers/lightnvm/pblk-init.c +2 -1
-	pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
+	if (geo->mw_cunits) {
+		pblk->pgs_in_buffer = geo->mw_cunits * geo-

all_luns;

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/lightnvm/pblk-init.c static int pblk_core_init(struct pblk *pblk) · line 362

Quoted 2 lines
drivers/lightnvm/pblk-init.c +2 -0
+	} else {
+		pblk->pgs_in_buffer = (geo->ws_opt << 3) * geo-

all_luns;

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/lightnvm/pblk-init.c static int pblk_core_init(struct pblk *pblk) · line 364

Quoted 2 lines
drivers/lightnvm/pblk-init.c +2 -0
+		/*
+		 * Some devices can expose mw_cunits equal to 0, so

let's

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines

use

drivers/nvme/host/lightnvm.c static int nvme_nvm_setup_12(struct

Quoted 12 lines
drivers/lightnvm/pblk-init.c +3 -0
+		 * here default safe value for MLC.
+		 */
+	}
 
 	pblk->min_write_pgs = geo->ws_opt * (geo->csecs / PAGE_SIZE);
 	max_write_ppas = pblk->min_write_pgs * geo->all_luns; diff --git

a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c index
41279da799ed..c747792da915 100644

drivers/nvme/host/lightnvm.c +0 -0
@@ -338,7 +338,6 @@ static int nvme_nvm_setup_12(struct

nvme_nvm_id12

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/nvme/host/lightnvm.c static int nvme_nvm_setup_12(struct · line 342

Quoted 5 lines
drivers/nvme/host/lightnvm.c +0 -1
 *id,
 
 	geo->ws_min = sec_per_pg;
 	geo->ws_opt = sec_per_pg;
-	geo->mw_cunits = geo->ws_opt << 3;	/* default to MLC

safe values

Quoted 29 lines
Quoted 29 lines
Quoted 7 lines
Quoted 7 lines

*/

Quoted 5 lines
drivers/nvme/host/lightnvm.c +0 -0
 /* Do not impose values for maximum number of open blocks as it is
 	 * unspecified in 1.2. Users of 1.2 must be aware of this and

eventually
--
2.11.0

Quoted 6 lines
Quoted 3 lines

By doing this, 1.2 future users (beyond pblk), will fail to have a valid mw_cunits value. It's ok to deal with the 0 case in pblk, but I believe that we should have the default value for 1.2 either way.

I'm not sure. From my understanding, setting of default value was workaround for pblk case, am I right ?.

The default value covers the MLC case directly at the lightnvm layer, as opposed to doing it directly in pblk. Since pblk is the only user now, you can argue that all changes in the lightnvm layer are to solve pblk issues, but the idea is that the geometry should be generic.

Quoted 5 lines

In my opinion any user of 1.2
spec should be aware that there is not mw_cunit value. From my point of view, leaving here 0 (and decision what do with it to lightnvm user) is more safer way, but maybe I'm wrong. I believe that it is topic to wider discussion with maintainers.

1.2 and 2.0 have different geometries, but when we designed the common nvm_geo structure, the idea was to abstract both specs and allow the upper layers to use the geometry transparently.

Quoted 8 lines
Quoted 5 lines

Specifically in pblk, I would prefer to keep it in such a way that we don't need to media specific policies (e.g., set default values for MLC memories), as a general design principle. We already do some geometry version checks to avoid dereferencing unnecessary pointers on the fast path, which I would eventually like to remove.

Ok, now I understand your point of view and agree with that, I will prepare second version of this patch without this change.

Sounds good.

Quoted 2 lines

Thanks for
the clarification.

Sure :)

Quoted 11 lines
Quoted 11 lines
Quoted 7 lines
Quoted 3 lines

A more generic way of doing this would be to have a default value for
2.0 too, in case mw_cunits is reported as 0.

Since 0 is correct value and users can make different decisions based on it, I think we shouldn't overwrite it by default value. Is it make sense?

Here I meant at a pblk level - I should have specified it. At the geometry level, we should not change it.

Quoted 7 lines
Quoted 3 lines

The case I am thinking is if mw_cuints repoints 0, but ws_min > 0. In this case, we still need a host side buffer to serve < ws_min I/Os, even though the device does not require the buffer to guarantee reads.

Oh, ok now we are on the same page. In this patch I was trying to address such case. Do you have other idea how to do it or here are you thinking only on value of default variable?

Quoted 6 lines

If doing this, I guess that something in the line of what you did with increasing the size of the write buffer via a module parameter. For example, checking if the size of the write buffer based on mw_cuints is enough to cover ws_min, which normally would only be an issue when mw_cuints == 0 or when the number of PUs used for the pblk instance is very small and mw_cuints < nr_luns * ws_min.

Quoted 7 lines

I see here two cases:
- when mw_cunits > 0 buffer size should have number of entries at least max(mw_cunits, ws_min) * nr_luns and here we are taking care of both cases mw_cunits > ws_min and mw_cunits < ws_min.
- when mw_cunit == 0 buffer size should have number of entries at least ws_min * nr _luns and we can use the same puseudocode as above.

Agree.

Quoted 4 lines

Do you see any other case? Could you clarify second case mentioned by you or maybe did you mean opposite case? If yes, I believe that above pseudo code will handle such case too.

Yes, it is the same case.

One thing to consider is whether the buffer should at least be ws_opt * nr_luns for performance reasons. Since the write thread will always try to send ws_opt, in the case that ws_opt > ws_min, then a buffer size of ws_min * nr_luns will not make use of the whole parallelism exposed by the device.

Therefore, I would probably go for ws_opt * nr_luns as the default value when mw_cuints * nr_luns < ws_opt * nr_luns (which covers mw_cuints == 0), and then keep ws_min * nr_luns as the minimum requirement when setting the buffer size manually.

Does this cover your use case?

Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Javier

Thanks,
Marcin

Javier

Thanks,
Marcin

Thanks!,
Marcin

#20 lore raw

RE: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 202 lines

From: Javier Gonzalez [mailto:[email protected]]
Sent: Tuesday, June 5, 2018 9:12 AM
To: Dziegielewski, Marcin <[email protected]>
Cc: Matias Bjørling <[email protected]>; Jens Axboe <[email protected]>; linux- [email protected]; [email protected]; Konopko, Igor J <[email protected]>
Subject: Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 1 line

On 4 Jun 2018, at 19.17, Dziegielewski, Marcin

Quoted 78 lines · <[email protected]> wrote:
Quoted 78 lines

From: Javier Gonzalez [mailto:[email protected]]
Sent: Monday, June 4, 2018 1:16 PM
To: Dziegielewski, Marcin <[email protected]>
Cc: Matias Bjørling <[email protected]>; Jens Axboe <[email protected]>; linux- [email protected]; [email protected]; Konopko, Igor J <[email protected]>
Subject: Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 1 line

On 4 Jun 2018, at 13.11, Dziegielewski, Marcin

Quoted 59 lines · <[email protected]> wrote:
Quoted 55 lines

-----Original Message-----
From: Javier Gonzalez [mailto:[email protected]]
Sent: Monday, June 4, 2018 12:22 PM
To: Dziegielewski, Marcin <[email protected]>
Cc: Matias Bjørling <[email protected]>; Jens Axboe <[email protected]>; linux- [email protected]; [email protected]; Konopko, Igor J <[email protected]>
Subject: Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 1 line

On 4 Jun 2018, at 12.09, Dziegielewski, Marcin

Quoted 43 lines · <[email protected]> wrote:

Frist of all I want to say sorry for late response - I was on holiday.

Quoted 41 lines

From: Javier Gonzalez [mailto:[email protected]]
Sent: Monday, May 28, 2018 1:03 PM
To: Matias Bjørling <[email protected]>
Cc: Jens Axboe <[email protected]>; [email protected]; linux- [email protected]; Dziegielewski, Marcin <[email protected]>; Konopko, Igor J <[email protected]>
Subject: Re: [GIT PULL 18/20] lightnvm: pblk: handle case when mw_cunits equals to 0

Quoted 31 lines · Matias Bjørling

From: Marcin Dziegielewski <[email protected]>

Some devices can expose mw_cunits equal to 0, it can cause creation of too small write buffer and cause performance to drop on write workloads.

To handle that, we use the default value for MLC and beacause it covers both 1.2 and 2.0 OC specification, setting up mw_cunits in
nvme_nvm_setup_12 function isn't longer necessary.

Signed-off-by: Marcin Dziegielewski
<[email protected]>

---
drivers/lightnvm/pblk-init.c | 10 +++++++++-
drivers/nvme/host/lightnvm.c | 1 -

2 files changed, 9 insertions(+), 2 deletions(-)
(quoted diff) +0 -0

b/drivers/lightnvm/pblk-init.c index d65d2f972ccf..0f277744266b 100644

drivers/lightnvm/pblk-init.c +0 -0
@@ -356,7 +356,15 @@ static int pblk_core_init(struct pblk *pblk)
 	atomic64_set(&pblk->nr_flush, 0);
 	pblk->nr_flush_rst = 0;
 
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

drivers/lightnvm/pblk-init.c static int pblk_core_init(struct pblk *pblk) · line 360

Quoted 3 lines
drivers/lightnvm/pblk-init.c +2 -1
-	pblk->pgs_in_buffer = geo->mw_cunits * geo->all_luns;
+	if (geo->mw_cunits) {
+		pblk->pgs_in_buffer = geo->mw_cunits * geo-

all_luns;

Quoted 5 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/lightnvm/pblk-init.c static int pblk_core_init(struct pblk *pblk) · line 362

Quoted 2 lines
drivers/lightnvm/pblk-init.c +2 -0
+	} else {
+		pblk->pgs_in_buffer = (geo->ws_opt << 3) * geo-

all_luns;

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

drivers/lightnvm/pblk-init.c static int pblk_core_init(struct pblk *pblk) · line 364

Quoted 2 lines
drivers/lightnvm/pblk-init.c +2 -0
+		/*
+		 * Some devices can expose mw_cunits equal to 0, so

let's

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

use

drivers/lightnvm/pblk-init.c static int pblk_core_init(struct pblk *pblk) · line 369

Quoted 5 lines
drivers/lightnvm/pblk-init.c +3 -0
+		 * here default safe value for MLC.
+		 */
+	}
 
 	pblk->min_write_pgs = geo->ws_opt * (geo->csecs /

PAGE_SIZE);

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

drivers/nvme/host/lightnvm.c static int nvme_nvm_setup_12(struct

Quoted 7 lines
drivers/lightnvm/pblk-init.c +0 -1
 	max_write_ppas = pblk->min_write_pgs * geo->all_luns; diff
--git a/drivers/nvme/host/lightnvm.c

b/drivers/nvme/host/lightnvm.c index
41279da799ed..c747792da915 100644

drivers/nvme/host/lightnvm.c +0 -0
@@ -338,7 +338,6 @@ static int nvme_nvm_setup_12(struct

nvme_nvm_id12

Quoted 8 lines
Quoted 8 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

drivers/nvme/host/lightnvm.c static int nvme_nvm_setup_12(struct · line 342

Quoted 5 lines
drivers/nvme/host/lightnvm.c +0 -1
 *id,
 
 	geo->ws_min = sec_per_pg;
 	geo->ws_opt = sec_per_pg;
-	geo->mw_cunits = geo->ws_opt << 3;	/* default to MLC

safe values

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

*/

Quoted 1 line
drivers/nvme/host/lightnvm.c +0 -0
 /* Do not impose values for maximum number of open blocks as it

is

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
drivers/nvme/host/lightnvm.c +0 -0
 	 * unspecified in 1.2. Users of 1.2 must be aware of this and

eventually
--
2.11.0

By doing this, 1.2 future users (beyond pblk), will fail to have a valid mw_cunits value. It's ok to deal with the 0 case in pblk, but I believe that we should have the default value for 1.2 either

way.

Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

I'm not sure. From my understanding, setting of default value was workaround for pblk case, am I right ?.

The default value covers the MLC case directly at the lightnvm layer, as opposed to doing it directly in pblk. Since pblk is the only user now, you can argue that all changes in the lightnvm layer are to solve pblk issues, but the idea is that the geometry should be

generic.

Quoted 36 lines
Quoted 36 lines
Quoted 12 lines
Quoted 12 lines
Quoted 7 lines

In my opinion any user of 1.2
spec should be aware that there is not mw_cunit value. From my point of view, leaving here 0 (and decision what do with it to lightnvm
user) is more safer way, but maybe I'm wrong. I believe that it is topic to wider discussion with maintainers.

1.2 and 2.0 have different geometries, but when we designed the common nvm_geo structure, the idea was to abstract both specs and allow the upper layers to use the geometry transparently.

Quoted 8 lines
Quoted 5 lines

Specifically in pblk, I would prefer to keep it in such a way that we don't need to media specific policies (e.g., set default values for MLC memories), as a general design principle. We already do some geometry version checks to avoid dereferencing unnecessary pointers on the fast path, which I would eventually like to remove.

Ok, now I understand your point of view and agree with that, I will prepare second version of this patch without this change.

Sounds good.

Quoted 2 lines

Thanks for
the clarification.

Sure :)

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines

A more generic way of doing this would be to have a default value for
2.0 too, in case mw_cunits is reported as 0.

Since 0 is correct value and users can make different decisions based on it, I think we shouldn't overwrite it by default value. Is it make sense?

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

Here I meant at a pblk level - I should have specified it. At the geometry level, we should not change it.

The case I am thinking is if mw_cuints repoints 0, but ws_min > 0. In this case, we still need a host side buffer to serve < ws_min I/Os, even though the device does not require the buffer to guarantee

reads.

Quoted 13 lines
Quoted 11 lines
Quoted 4 lines

Oh, ok now we are on the same page. In this patch I was trying to address such case. Do you have other idea how to do it or here are you thinking only on value of default variable?

If doing this, I guess that something in the line of what you did with increasing the size of the write buffer via a module parameter. For example, checking if the size of the write buffer based on mw_cuints is enough to cover ws_min, which normally would only be an issue when mw_cuints == 0 or when the number of PUs used for the pblk instance is very small and mw_cuints < nr_luns * ws_min.

Quoted 7 lines

I see here two cases:
- when mw_cunits > 0 buffer size should have number of entries at least max(mw_cunits, ws_min) * nr_luns and here we are taking care of both cases mw_cunits > ws_min and mw_cunits < ws_min.
- when mw_cunit == 0 buffer size should have number of entries at least ws_min * nr _luns and we can use the same puseudocode as above.

Agree.

Quoted 4 lines

Do you see any other case? Could you clarify second case mentioned by you or maybe did you mean opposite case? If yes, I believe that above pseudo code will handle such case too.

Quoted 8 lines

Yes, it is the same case.

One thing to consider is whether the buffer should at least be ws_opt * nr_luns for performance reasons. Since the write thread will always try to send ws_opt, in the case that ws_opt > ws_min, then a buffer size of ws_min * nr_luns will not make use of the whole parallelism exposed by the device.

Agree. After I had sent last email I also thought that should be ws_opt instead of ws_min.

Quoted 4 lines

Therefore, I would probably go for ws_opt * nr_luns as the default value when mw_cuints * nr_luns < ws_opt * nr_luns (which covers mw_cuints == 0), and then keep ws_min * nr_luns as the minimum requirement when setting the buffer size manually.

Sounds good.

Quoted 3 lines

Does this cover your use case?

Yes, I think that cover all cases related to this topic. I will prepare patch in the afternoon.

Many thanks for perfect cooperation!
Marcin

Quoted 10 lines
Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
Quoted 6 lines
Quoted 4 lines
Quoted 1 line

Javier

Thanks,
Marcin

Javier

Thanks,
Marcin

Thanks!,
Marcin

#21 lore raw

[GIT PULL 17/20] lightnvm: fix partial read error path

In reply to Matias Bjørling

From: Igor Konopko <[email protected]>

When error occurs during bio_add_page on partial read path, pblk tries to free pages twice.

---
 drivers/lightnvm/pblk-read.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/lightnvm/pblk-read.c +4 -4
index a2e678de428f..fa7b60f852d9 100644
@@ -256,7 +256,7 @@ static int pblk_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd,
 	new_bio = bio_alloc(GFP_KERNEL, nr_holes);
 
 	if (pblk_bio_add_pages(pblk, new_bio, GFP_KERNEL, nr_holes))
-		goto err;
+		goto err_add_pages;
 
 	if (nr_holes != new_bio->bi_vcnt) {
 		pr_err("pblk: malformed bio\n");
@@ -347,10 +347,10 @@ static int pblk_partial_read_bio(struct pblk *pblk, struct nvm_rq *rqd,
 	return NVM_IO_OK;
 
 err:
-	pr_err("pblk: failed to perform partial read\n");
-
 	/* Free allocated pages in new bio */
-	pblk_bio_free_pages(pblk, bio, 0, new_bio->bi_vcnt);
+	pblk_bio_free_pages(pblk, new_bio, 0, new_bio->bi_vcnt);
+err_add_pages:
+	pr_err("pblk: failed to perform partial read\n");
 	__pblk_end_io_read(pblk, rqd, false);
 	return NVM_IO_ERR;
 }
Signature · 1 line
2.11.0
#22 lore raw

[GIT PULL 16/20] lightnvm: error handling when whole line is bad

In reply to Matias Bjørling

From: Igor Konopko <[email protected]>

When all the blocks (chunks) in line are marked as bad (offline) we shouldn't try to read smeta during init process.

Currently we are trying to do so by passing -1 as PPA address, what causes multiple warnings, that we issuing IOs to out-of-bound PPAs.

Updated title.

---
 drivers/lightnvm/pblk-core.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/lightnvm/pblk-core.c +5 -0
index a20b41c355c5..e3e883547198 100644
@@ -868,6 +868,11 @@ int pblk_line_read_smeta(struct pblk *pblk, struct pblk_line *line)
 {
 	u64 bpaddr = pblk_line_smeta_start(pblk, line);
 
+	if (bpaddr == -1) {
+		/* Whole line is bad - do not try to read smeta. */
+		return 1;
+	}
+
 	return pblk_line_submit_smeta_io(pblk, line, bpaddr, PBLK_READ_RECOV);
 }
 
Signature · 1 line
2.11.0
#23 lore raw

Re: [GIT PULL 16/20] lightnvm: error handling when whole line is bad

Quoted 24 lines · Matias Bjørling

From: Igor Konopko <[email protected]>

When all the blocks (chunks) in line are marked as bad (offline) we shouldn't try to read smeta during init process.

Currently we are trying to do so by passing -1 as PPA address, what causes multiple warnings, that we issuing IOs to out-of-bound PPAs.

Updated title.

---
drivers/lightnvm/pblk-core.c | 5 +++++

1 file changed, 5 insertions(+)
drivers/lightnvm/pblk-core.c +0 -0
index a20b41c355c5..e3e883547198 100644

drivers/lightnvm/pblk-core.c int pblk_line_read_smeta(struct pblk *pblk, struct pblk_line *line) · line 874

Quoted 7 lines
drivers/lightnvm/pblk-core.c +4 -0
@@ -868,6 +868,11 @@ int pblk_line_read_smeta(struct pblk *pblk, struct pblk_line *line)
 {
 	u64 bpaddr = pblk_line_smeta_start(pblk, line);
 
+	if (bpaddr == -1) {
+		/* Whole line is bad - do not try to read smeta. */
+		return 1;
+	}

This case cannot occur on the only user of the function (pblk_recov_l2p()). On the previous check (pblk_line_was_written()), we verify the state of the line and the position of the first good chunk. In the case of a bad line (less chunks than a given threshold to allow emeta), the recovery will not be carried out in the line.

Javier

#24 lore raw

RE: [GIT PULL 16/20] lightnvm: error handling when whole line is bad

Quoted 6 lines

From: Javier Gonzalez [mailto:[email protected]]
This case cannot occur on the only user of the function (pblk_recov_l2p()). On the previous check (pblk_line_was_written()), we verify the state of the line and the position of the first good chunk. In the case of a bad line (less chunks than a given threshold to allow emeta), the recovery will not be carried out in the line.

You are right. It looks that during my testing there was some inconsistency between chunks state table which is verified inside pblk_line_was_written() and blk_bitmap which was read from emeta and is verified in pblk_line_smeta_start(). I'm living decision to maintainers whether we should keep this sanity check or not - it really just pass gracefully the result from pblk_line_smeta_start() where similar sanity check is present.

Igor

#25 lore raw

Re: [GIT PULL 16/20] lightnvm: error handling when whole line is bad

Quoted 8 lines · Igor J
Quoted 7 lines

From: Javier Gonzalez [mailto:[email protected]]
This case cannot occur on the only user of the function (pblk_recov_l2p()). On the previous check (pblk_line_was_written()), we verify the state of the line and the position of the first good chunk. In the case of a bad line (less chunks than a given threshold to allow emeta), the recovery will not be carried out in the line.

Quoted 8 lines

You are right. It looks that during my testing there was some inconsistency between chunks state table which is verified inside pblk_line_was_written() and blk_bitmap which was read from emeta and is verified in pblk_line_smeta_start(). I'm living decision to maintainers whether we should keep this sanity check or not - it really just pass gracefully the result from pblk_line_smeta_start() where similar sanity check is present.

Let's avoid an extra check now that there is no users for it in the current flow. If we have a new use for pblk_line_smeta_start() on a flow that does cannot offer the same guarantees, we can add it at that point.

Javier

#26 lore raw

[GIT PULL 15/20] lightnvm: proper error handling for pblk_bio_add_pages

In reply to Matias Bjørling

From: Igor Konopko <[email protected]>

Currently in case of error caused by bio_pc_add_page in pblk_bio_add_pages two issues occur when calling from pblk_rb_read_to_bio(). First one is in pblk_bio_free_pages, since we are trying to free pages not allocated from our mempool. Second one is the warn from dma_pool_free, that we are trying to free NULL pointer dma.

This commit fix both issues.

---
 drivers/lightnvm/pblk-core.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/lightnvm/pblk-core.c +4 -2
index e43093e27084..a20b41c355c5 100644
@@ -278,7 +278,9 @@ void pblk_free_rqd(struct pblk *pblk, struct nvm_rq *rqd, int type)
 		return;
 	}
 
-	nvm_dev_dma_free(dev->parent, rqd->meta_list, rqd->dma_meta_list);
+	if (rqd->meta_list)
+		nvm_dev_dma_free(dev->parent, rqd->meta_list,
+				rqd->dma_meta_list);
 	mempool_free(rqd, pool);
 }
 
@@ -316,7 +318,7 @@ int pblk_bio_add_pages(struct pblk *pblk, struct bio *bio, gfp_t flags,
 
 	return 0;
 err:
-	pblk_bio_free_pages(pblk, bio, 0, i - 1);
+	pblk_bio_free_pages(pblk, bio, (bio->bi_vcnt - i), i);
 	return -1;
 }
 
Signature · 1 line
2.11.0
#27 lore raw

[GIT PULL 11/20] lightnvm: pblk: remove dead function

In reply to Matias Bjørling

From: Javier González <[email protected]>

Remove dead function for manual sync. I/O

---
 drivers/lightnvm/pblk-core.c | 7 -------
 drivers/lightnvm/pblk.h      | 1 -
 2 files changed, 8 deletions(-)
drivers/lightnvm/pblk-core.c +0 -7
index 5f1e5b1b3094..5dae72e8b46b 100644
@@ -342,13 +342,6 @@ void pblk_write_should_kick(struct pblk *pblk)
 		pblk_write_kick(pblk);
 }
 
-void pblk_end_io_sync(struct nvm_rq *rqd)
-{
-	struct completion *waiting = rqd->private;
-
-	complete(waiting);
-}
-
 static void pblk_wait_for_meta(struct pblk *pblk)
 {
 	do {
drivers/lightnvm/pblk.h +0 -1
index 0c69eb880f56..5a4daf0b949d 100644
@@ -796,7 +796,6 @@ void pblk_down_rq(struct pblk *pblk, struct ppa_addr *ppa_list, int nr_ppas,
 void pblk_down_page(struct pblk *pblk, struct ppa_addr *ppa_list, int nr_ppas);
 void pblk_up_rq(struct pblk *pblk, struct ppa_addr *ppa_list, int nr_ppas,
 		unsigned long *lun_bitmap);
-void pblk_end_io_sync(struct nvm_rq *rqd);
 int pblk_bio_add_pages(struct pblk *pblk, struct bio *bio, gfp_t flags,
 		       int nr_pages);
 void pblk_bio_free_pages(struct pblk *pblk, struct bio *bio, int off,
Signature · 1 line
2.11.0
#28 lore raw

[GIT PULL 10/20] lightnvm: pass flag on graceful teardown to targets

In reply to Matias Bjørling

From: Javier González <[email protected]>

If the namespace is unregistered before the LightNVM target is removed (e.g., on hot unplug) it is too late for the target to store any metadata on the device - any attempt to write to the device will fail. In this case, pass on a "gracefull teardown" flag to the target to let it know when this happens.

In the case of pblk, we pad the open line (close all open chunks) to improve data retention. In the event of an ungraceful shutdown, avoid this part and just clean up.

---
 drivers/lightnvm/core.c      | 10 +++++-----
 drivers/lightnvm/pblk-core.c | 13 ++++++++++++-
 drivers/lightnvm/pblk-gc.c   | 10 ++++++----
 drivers/lightnvm/pblk-init.c | 14 ++++++++------
 drivers/lightnvm/pblk.h      |  4 +++-
 include/linux/lightnvm.h     |  2 +-
 6 files changed, 35 insertions(+), 18 deletions(-)
drivers/lightnvm/core.c +5 -5
index 63171cdce270..60aa7bc5a630 100644
@@ -431,7 +431,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
 	return 0;
 err_sysfs:
 	if (tt->exit)
-		tt->exit(targetdata);
+		tt->exit(targetdata, true);
 err_init:
 	blk_cleanup_queue(tqueue);
 	tdisk->queue = NULL;
@@ -446,7 +446,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
 	return ret;
 }
 
-static void __nvm_remove_target(struct nvm_target *t)
+static void __nvm_remove_target(struct nvm_target *t, bool graceful)
 {
 	struct nvm_tgt_type *tt = t->type;
 	struct gendisk *tdisk = t->disk;
@@ -459,7 +459,7 @@ static void __nvm_remove_target(struct nvm_target *t)
 		tt->sysfs_exit(tdisk);
 
 	if (tt->exit)
-		tt->exit(tdisk->private_data);
+		tt->exit(tdisk->private_data, graceful);
 
 	nvm_remove_tgt_dev(t->dev, 1);
 	put_disk(tdisk);
@@ -489,7 +489,7 @@ static int nvm_remove_tgt(struct nvm_dev *dev, struct nvm_ioctl_remove *remove)
 		mutex_unlock(&dev->mlock);
 		return 1;
 	}
-	__nvm_remove_target(t);
+	__nvm_remove_target(t, true);
 	mutex_unlock(&dev->mlock);
 
 	return 0;
@@ -963,7 +963,7 @@ void nvm_unregister(struct nvm_dev *dev)
 	list_for_each_entry_safe(t, tmp, &dev->targets, list) {
 		if (t->dev->parent != dev)
 			continue;
-		__nvm_remove_target(t);
+		__nvm_remove_target(t, false);
 	}
 	mutex_unlock(&dev->mlock);
 
drivers/lightnvm/pblk-core.c +12 -1
index 4b10122aec89..5f1e5b1b3094 100644
@@ -1461,7 +1461,7 @@ static void pblk_line_close_meta_sync(struct pblk *pblk)
 	flush_workqueue(pblk->close_wq);
 }
 
-void pblk_pipeline_stop(struct pblk *pblk)
+void __pblk_pipeline_flush(struct pblk *pblk)
 {
 	struct pblk_line_mgmt *l_mg = &pblk->l_mg;
 	int ret;
@@ -1486,6 +1486,11 @@ void pblk_pipeline_stop(struct pblk *pblk)
 
 	flush_workqueue(pblk->bb_wq);
 	pblk_line_close_meta_sync(pblk);
+}
+
+void __pblk_pipeline_stop(struct pblk *pblk)
+{
+	struct pblk_line_mgmt *l_mg = &pblk->l_mg;
 
 	spin_lock(&l_mg->free_lock);
 	pblk->state = PBLK_STATE_STOPPED;
@@ -1494,6 +1499,12 @@ void pblk_pipeline_stop(struct pblk *pblk)
 	spin_unlock(&l_mg->free_lock);
 }
 
+void pblk_pipeline_stop(struct pblk *pblk)
+{
+	__pblk_pipeline_flush(pblk);
+	__pblk_pipeline_stop(pblk);
+}
+
 struct pblk_line *pblk_line_replace_data(struct pblk *pblk)
 {
 	struct pblk_line_mgmt *l_mg = &pblk->l_mg;
drivers/lightnvm/pblk-gc.c +6 -4
index 6851a5c67189..b0cc277bf972 100644
@@ -649,7 +649,7 @@ int pblk_gc_init(struct pblk *pblk)
 	return ret;
 }
 
-void pblk_gc_exit(struct pblk *pblk)
+void pblk_gc_exit(struct pblk *pblk, bool graceful)
 {
 	struct pblk_gc *gc = &pblk->gc;
 
@@ -663,10 +663,12 @@ void pblk_gc_exit(struct pblk *pblk)
 	if (gc->gc_reader_ts)
 		kthread_stop(gc->gc_reader_ts);
 
-	flush_workqueue(gc->gc_reader_wq);
+	if (graceful) {
+		flush_workqueue(gc->gc_reader_wq);
+		flush_workqueue(gc->gc_line_reader_wq);
+	}
+
 	destroy_workqueue(gc->gc_reader_wq);
-
-	flush_workqueue(gc->gc_line_reader_wq);
 	destroy_workqueue(gc->gc_line_reader_wq);
 
 	if (gc->gc_writer_ts)
drivers/lightnvm/pblk-init.c +8 -6
index 9e3a43346d4c..bfc488d0dda9 100644
@@ -1118,23 +1118,25 @@ static void pblk_free(struct pblk *pblk)
 	kfree(pblk);
 }
 
-static void pblk_tear_down(struct pblk *pblk)
+static void pblk_tear_down(struct pblk *pblk, bool graceful)
 {
-	pblk_pipeline_stop(pblk);
+	if (graceful)
+		__pblk_pipeline_flush(pblk);
+	__pblk_pipeline_stop(pblk);
 	pblk_writer_stop(pblk);
 	pblk_rb_sync_l2p(&pblk->rwb);
 	pblk_rl_free(&pblk->rl);
 
-	pr_debug("pblk: consistent tear down\n");
+	pr_debug("pblk: consistent tear down (graceful:%d)\n", graceful);
 }
 
-static void pblk_exit(void *private)
+static void pblk_exit(void *private, bool graceful)
 {
 	struct pblk *pblk = private;
 
 	down_write(&pblk_lock);
-	pblk_gc_exit(pblk);
-	pblk_tear_down(pblk);
+	pblk_gc_exit(pblk, graceful);
+	pblk_tear_down(pblk, graceful);
 
 #ifdef CONFIG_NVM_DEBUG
 	pr_info("pblk exit: L2P CRC: %x\n", pblk_l2p_crc(pblk));
drivers/lightnvm/pblk.h +3 -1
index dfbfe9e9a385..0c69eb880f56 100644
@@ -771,6 +771,8 @@ void pblk_line_close_meta(struct pblk *pblk, struct pblk_line *line);
 void pblk_line_close(struct pblk *pblk, struct pblk_line *line);
 void pblk_line_close_ws(struct work_struct *work);
 void pblk_pipeline_stop(struct pblk *pblk);
+void __pblk_pipeline_stop(struct pblk *pblk);
+void __pblk_pipeline_flush(struct pblk *pblk);
 void pblk_gen_run_ws(struct pblk *pblk, struct pblk_line *line, void *priv,
 		     void (*work)(struct work_struct *), gfp_t gfp_mask,
 		     struct workqueue_struct *wq);
@@ -864,7 +866,7 @@ int pblk_recov_setup_rq(struct pblk *pblk, struct pblk_c_ctx *c_ctx,
 #define PBLK_GC_RSV_LINE 1	/* Reserved lines for GC */
 
 int pblk_gc_init(struct pblk *pblk);
-void pblk_gc_exit(struct pblk *pblk);
+void pblk_gc_exit(struct pblk *pblk, bool graceful);
 void pblk_gc_should_start(struct pblk *pblk);
 void pblk_gc_should_stop(struct pblk *pblk);
 void pblk_gc_should_kick(struct pblk *pblk);
include/linux/lightnvm.h +1 -1
index 6e0859b9d4d2..e9e0d1c7eaf5 100644
@@ -489,7 +489,7 @@ typedef blk_qc_t (nvm_tgt_make_rq_fn)(struct request_queue *, struct bio *);
 typedef sector_t (nvm_tgt_capacity_fn)(void *);
 typedef void *(nvm_tgt_init_fn)(struct nvm_tgt_dev *, struct gendisk *,
 				int flags);
-typedef void (nvm_tgt_exit_fn)(void *);
+typedef void (nvm_tgt_exit_fn)(void *, bool);
 typedef int (nvm_tgt_sysfs_init_fn)(struct gendisk *);
 typedef void (nvm_tgt_sysfs_exit_fn)(struct gendisk *);
 
Signature · 1 line
2.11.0
#29 lore raw

[GIT PULL 09/20] lightnvm: pblk: check for chunk size before allocating it

In reply to Matias Bjørling

From: Javier González <[email protected]>

Do the check for the chunk state after making sure that the chunk type is supported.

Fixes 32ef9412c114 ("lightnvm: pblk: implement get log report chunk")
---
 drivers/lightnvm/pblk-init.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/lightnvm/pblk-init.c +3 -3
index b52855f9336b..9e3a43346d4c 100644
@@ -751,14 +751,14 @@ static int pblk_setup_line_meta_20(struct pblk *pblk, struct pblk_line *line,
 		chunk->cnlb = chunk_meta->cnlb;
 		chunk->wp = chunk_meta->wp;
 
-		if (!(chunk->state & NVM_CHK_ST_OFFLINE))
-			continue;
-
 		if (chunk->type & NVM_CHK_TP_SZ_SPEC) {
 			WARN_ONCE(1, "pblk: custom-sized chunks unsupported\n");
 			continue;
 		}
 
+		if (!(chunk->state & NVM_CHK_ST_OFFLINE))
+			continue;
+
 		set_bit(pos, line->blk_bitmap);
 		nr_bad_chks++;
 	}
Signature · 1 line
2.11.0
#30 lore raw

[GIT PULL 08/20] lightnvm: pblk: remove unnecessary argument

In reply to Matias Bjørling

From: Javier González <[email protected]>

Remove unnecessary argument on pblk_line_free()

---
 drivers/lightnvm/pblk-core.c | 6 +++---
 drivers/lightnvm/pblk-init.c | 2 +-
 drivers/lightnvm/pblk.h      | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/lightnvm/pblk-core.c +3 -3
index 0d4078805ecc..4b10122aec89 100644
@@ -1337,7 +1337,7 @@ static struct pblk_line *pblk_line_retry(struct pblk *pblk,
 	retry_line->emeta = line->emeta;
 	retry_line->meta_line = line->meta_line;
 
-	pblk_line_free(pblk, line);
+	pblk_line_free(line);
 	l_mg->data_line = retry_line;
 	spin_unlock(&l_mg->free_lock);
 
@@ -1562,7 +1562,7 @@ struct pblk_line *pblk_line_replace_data(struct pblk *pblk)
 	return new;
 }
 
-void pblk_line_free(struct pblk *pblk, struct pblk_line *line)
+void pblk_line_free(struct pblk_line *line)
 {
 	kfree(line->map_bitmap);
 	kfree(line->invalid_bitmap);
@@ -1584,7 +1584,7 @@ static void __pblk_line_put(struct pblk *pblk, struct pblk_line *line)
 	WARN_ON(line->state != PBLK_LINESTATE_GC);
 	line->state = PBLK_LINESTATE_FREE;
 	line->gc_group = PBLK_LINEGC_NONE;
-	pblk_line_free(pblk, line);
+	pblk_line_free(line);
 	spin_unlock(&line->lock);
 
 	atomic_dec(&gc->pipeline_gc);
drivers/lightnvm/pblk-init.c +1 -1
index 8f8c9abd14fc..b52855f9336b 100644
@@ -509,7 +509,7 @@ static void pblk_lines_free(struct pblk *pblk)
 	for (i = 0; i < l_mg->nr_lines; i++) {
 		line = &pblk->lines[i];
 
-		pblk_line_free(pblk, line);
+		pblk_line_free(line);
 		pblk_line_meta_free(line);
 	}
 	spin_unlock(&l_mg->free_lock);
drivers/lightnvm/pblk.h +1 -1
index 9c682acfc5d1..dfbfe9e9a385 100644
@@ -766,7 +766,7 @@ struct pblk_line *pblk_line_get_data(struct pblk *pblk);
 struct pblk_line *pblk_line_get_erase(struct pblk *pblk);
 int pblk_line_erase(struct pblk *pblk, struct pblk_line *line);
 int pblk_line_is_full(struct pblk_line *line);
-void pblk_line_free(struct pblk *pblk, struct pblk_line *line);
+void pblk_line_free(struct pblk_line *line);
 void pblk_line_close_meta(struct pblk *pblk, struct pblk_line *line);
 void pblk_line_close(struct pblk *pblk, struct pblk_line *line);
 void pblk_line_close_ws(struct work_struct *work);
Signature · 1 line
2.11.0
#31 lore raw

[GIT PULL 07/20] lightnvm: pblk: remove unnecessary indirection

In reply to Matias Bjørling

From: Javier González <[email protected]>

Call nvm_submit_io directly and remove an unnecessary indirection on the read path.

---
 drivers/lightnvm/pblk-read.c | 14 ++------------
 1 file changed, 2 insertions(+), 12 deletions(-)
drivers/lightnvm/pblk-read.c +2 -12
index b201fc486adb..a2e678de428f 100644
@@ -102,16 +102,6 @@ static void pblk_read_ppalist_rq(struct pblk *pblk, struct nvm_rq *rqd,
 #endif
 }
 
-static int pblk_submit_read_io(struct pblk *pblk, struct nvm_rq *rqd)
-{
-	int err;
-
-	err = pblk_submit_io(pblk, rqd);
-	if (err)
-		return NVM_IO_ERR;
-
-	return NVM_IO_OK;
-}
 
 static void pblk_read_check_seq(struct pblk *pblk, struct nvm_rq *rqd,
 				sector_t blba)
@@ -485,9 +475,9 @@ int pblk_submit_read(struct pblk *pblk, struct bio *bio)
 		rqd->bio = int_bio;
 		r_ctx->private = bio;
 
-		ret = pblk_submit_read_io(pblk, rqd);
-		if (ret) {
+		if (pblk_submit_io(pblk, rqd)) {
 			pr_err("pblk: read IO submission failed\n");
+			ret = NVM_IO_ERR;
 			if (int_bio)
 				bio_put(int_bio);
 			goto fail_end_io;
Signature · 1 line
2.11.0
#32 lore raw

[GIT PULL 06/20] lightnvm: pblk: return NVM_ error on failed submission

In reply to Matias Bjørling

From: Javier González <[email protected]>

Return a meaningful error when the sanity vector I/O check fails.

---
 drivers/lightnvm/pblk-core.c | 22 ++++++++--------------
 1 file changed, 8 insertions(+), 14 deletions(-)
drivers/lightnvm/pblk-core.c +8 -14
index 2cad918434a7..0d4078805ecc 100644
@@ -467,16 +467,13 @@ int pblk_submit_io(struct pblk *pblk, struct nvm_rq *rqd)
 {
 	struct nvm_tgt_dev *dev = pblk->dev;
 
+	atomic_inc(&pblk->inflight_io);
+
 #ifdef CONFIG_NVM_DEBUG
-	int ret;
-
-	ret = pblk_check_io(pblk, rqd);
-	if (ret)
-		return ret;
+	if (pblk_check_io(pblk, rqd))
+		return NVM_IO_ERR;
 #endif
 
-	atomic_inc(&pblk->inflight_io);
-
 	return nvm_submit_io(dev, rqd);
 }
 
@@ -484,16 +481,13 @@ int pblk_submit_io_sync(struct pblk *pblk, struct nvm_rq *rqd)
 {
 	struct nvm_tgt_dev *dev = pblk->dev;
 
+	atomic_inc(&pblk->inflight_io);
+
 #ifdef CONFIG_NVM_DEBUG
-	int ret;
-
-	ret = pblk_check_io(pblk, rqd);
-	if (ret)
-		return ret;
+	if (pblk_check_io(pblk, rqd))
+		return NVM_IO_ERR;
 #endif
 
-	atomic_inc(&pblk->inflight_io);
-
 	return nvm_submit_io_sync(dev, rqd);
 }
 
Signature · 1 line
2.11.0
#33 lore raw

[GIT PULL 05/20] lightnvm: pblk: warn in case of corrupted write buffer

In reply to Matias Bjørling

From: Javier González <[email protected]>

When cleaning up buffer entries as we wrap up, their state should be "completed". If any of the entries is in "submitted" state, it means that something bad has happened. Trigger a warning immediately instead of waiting for the state flag to eventually be updated, thus hiding the issue.

---
 drivers/lightnvm/pblk-rb.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/lightnvm/pblk-rb.c +2 -3
index 52fdd85dbc97..58946ffebe81 100644
@@ -142,10 +142,9 @@ static void clean_wctx(struct pblk_w_ctx *w_ctx)
 {
 	int flags;
 
-try:
 	flags = READ_ONCE(w_ctx->flags);
-	if (!(flags & PBLK_SUBMITTED_ENTRY))
-		goto try;
+	WARN_ONCE(!(flags & PBLK_SUBMITTED_ENTRY),
+			"pblk: overwriting unsubmitted data\n");
 
 	/* Release flags on context. Protect from writes and reads */
 	smp_store_release(&w_ctx->flags, PBLK_WRITABLE_ENTRY);
Signature · 1 line
2.11.0
#34 lore raw

[GIT PULL 04/20] lightnvm: pblk: improve error msg on corrupted LBAs

In reply to Matias Bjørling

From: Javier González <[email protected]>

In the event of a mismatch between the read LBA and the metadata pointer reported by the device, improve the error message to be able to detect the offending physical address (PPA) mapped to the corrupted LBA.

---
 drivers/lightnvm/pblk-read.c | 42 ++++++++++++++++++++++++++++++++----------
 1 file changed, 32 insertions(+), 10 deletions(-)
drivers/lightnvm/pblk-read.c +32 -10
index 1f699c09e0ea..b201fc486adb 100644
@@ -113,10 +113,11 @@ static int pblk_submit_read_io(struct pblk *pblk, struct nvm_rq *rqd)
 	return NVM_IO_OK;
 }
 
-static void pblk_read_check_seq(struct pblk *pblk, void *meta_list,
-				sector_t blba, int nr_lbas)
+static void pblk_read_check_seq(struct pblk *pblk, struct nvm_rq *rqd,
+				sector_t blba)
 {
-	struct pblk_sec_meta *meta_lba_list = meta_list;
+	struct pblk_sec_meta *meta_lba_list = rqd->meta_list;
+	int nr_lbas = rqd->nr_ppas;
 	int i;
 
 	for (i = 0; i < nr_lbas; i++) {
@@ -125,17 +126,27 @@ static void pblk_read_check_seq(struct pblk *pblk, void *meta_list,
 		if (lba == ADDR_EMPTY)
 			continue;
 
-		WARN(lba != blba + i, "pblk: corrupted read LBA\n");
+		if (lba != blba + i) {
+#ifdef CONFIG_NVM_DEBUG
+			struct ppa_addr *p;
+
+			p = (nr_lbas == 1) ? &rqd->ppa_list[i] : &rqd->ppa_addr;
+			print_ppa(&pblk->dev->geo, p, "seq", i);
+#endif
+			pr_err("pblk: corrupted read LBA (%llu/%llu)\n",
+							lba, (u64)blba + i);
+			WARN_ON(1);
+		}
 	}
 }
 
 /*
  * There can be holes in the lba list.
  */
-static void pblk_read_check_rand(struct pblk *pblk, void *meta_list,
-				u64 *lba_list, int nr_lbas)
+static void pblk_read_check_rand(struct pblk *pblk, struct nvm_rq *rqd,
+				 u64 *lba_list, int nr_lbas)
 {
-	struct pblk_sec_meta *meta_lba_list = meta_list;
+	struct pblk_sec_meta *meta_lba_list = rqd->meta_list;
 	int i, j;
 
 	for (i = 0, j = 0; i < nr_lbas; i++) {
@@ -145,14 +156,25 @@ static void pblk_read_check_rand(struct pblk *pblk, void *meta_list,
 		if (lba == ADDR_EMPTY)
 			continue;
 
-		meta_lba = le64_to_cpu(meta_lba_list[j++].lba);
+		meta_lba = le64_to_cpu(meta_lba_list[j].lba);
 
 		if (lba != meta_lba) {
+#ifdef CONFIG_NVM_DEBUG
+			struct ppa_addr *p;
+			int nr_ppas = rqd->nr_ppas;
+
+			p = (nr_ppas == 1) ? &rqd->ppa_list[j] : &rqd->ppa_addr;
+			print_ppa(&pblk->dev->geo, p, "seq", j);
+#endif
 			pr_err("pblk: corrupted read LBA (%llu/%llu)\n",
 								lba, meta_lba);
 			WARN_ON(1);
 		}
+
+		j++;
 	}
+
+	WARN_ONCE(j != rqd->nr_ppas, "pblk: corrupted random request\n");
 }
 
 static void pblk_read_put_rqd_kref(struct pblk *pblk, struct nvm_rq *rqd)
@@ -197,7 +219,7 @@ static void __pblk_end_io_read(struct pblk *pblk, struct nvm_rq *rqd,
 		WARN_ONCE(bio->bi_status, "pblk: corrupted read error\n");
 #endif
 
-	pblk_read_check_seq(pblk, rqd->meta_list, r_ctx->lba, rqd->nr_ppas);
+	pblk_read_check_seq(pblk, rqd, r_ctx->lba);
 
 	bio_put(bio);
 	if (r_ctx->private)
@@ -610,7 +632,7 @@ int pblk_submit_read_gc(struct pblk *pblk, struct pblk_gc_rq *gc_rq)
 		goto err_free_bio;
 	}
 
-	pblk_read_check_rand(pblk, rqd.meta_list, gc_rq->lba_list, rqd.nr_ppas);
+	pblk_read_check_rand(pblk, &rqd, gc_rq->lba_list, gc_rq->nr_secs);
 
 	atomic_dec(&pblk->inflight_io);
 
Signature · 1 line
2.11.0
#35 lore raw
In reply to Matias Bjørling
Quoted 45 lines · Matias Bjørling

Hi Jens,

Please pick up the following patches.

- Hans reworked the write error recovery path in pblk.
- Igor added extra error handling for lines, and fixed a bug in the pblk ringbuffer during GC.
- Javier refactored the pblk code a bit, added extra error handling, and added checks to verify that data returned from drive is appropriate.
- Marcin added some extra logic to manage the write buffer. Now MW_CUNITS can be zero and the size of write buffer can be changed at module load time.

Thanks,
Matias

Hans Holmberg (3):
lightnvm: pblk: rework write error recovery path
lightnvm: pblk: garbage collect lines with failed writes
lightnvm: pblk: fix smeta write error path

Igor Konopko (4):
lightnvm: proper error handling for pblk_bio_add_pages
lightnvm: error handling when whole line is bad
lightnvm: fix partial read error path
lightnvm: pblk: sync RB and RL states during GC

Javier González (11):
lightnvm: pblk: fail gracefully on line alloc. failure
lightnvm: pblk: recheck for bad lines at runtime
lightnvm: pblk: check read lba on gc path
lightnvn: pblk: improve error msg on corrupted LBAs
lightnvm: pblk: warn in case of corrupted write buffer
lightnvm: pblk: return NVM_ error on failed submission
lightnvm: pblk: remove unnecessary indirection
lightnvm: pblk: remove unnecessary argument
lightnvm: pblk: check for chunk size before allocating it
lightnvn: pass flag on graceful teardown to targets
lightnvm: pblk: remove dead function

Marcin Dziegielewski (2):
lightnvm: pblk: handle case when mw_cunits equals to 0
lightnvm: pblk: add possibility to set write buffer size manually

Quoted 16 lines
  drivers/lightnvm/core.c          |  10 +-
  drivers/lightnvm/pblk-core.c     | 149 +++++++++++++++------
  drivers/lightnvm/pblk-gc.c       | 112 ++++++++++------
  drivers/lightnvm/pblk-init.c     | 112 +++++++++++-----
  drivers/lightnvm/pblk-map.c      |  33 +++--
  drivers/lightnvm/pblk-rb.c       |  51 +------
  drivers/lightnvm/pblk-read.c     |  83 +++++++++---
  drivers/lightnvm/pblk-recovery.c |  91 -------------
  drivers/lightnvm/pblk-rl.c       |  29 +++-
  drivers/lightnvm/pblk-sysfs.c    |  15 ++-
  drivers/lightnvm/pblk-write.c    | 281 +++++++++++++++++++++++++--------------
  drivers/lightnvm/pblk.h          |  43 +++---
  drivers/nvme/host/lightnvm.c     |   1 -
  include/linux/lightnvm.h         |   2 +-
  14 files changed, 604 insertions(+), 408 deletions(-)

Hi Jens,

Javier had some comments to 16, 18, and 20. The rest is ready to go. Would you like me to resend the patches?

Thank you!

maintainer
#36 lore raw
Quoted 50 lines · On Jun 1, 2018, at 4:45 AM, Matias Bj=C3=B8rling <[email protected]> wrote:

=20

Quoted 49 lines · On 05/28/2018 10:58 AM, Matias Bj=C3=B8rling wrote:

Hi Jens,
Please pick up the following patches.
- Hans reworked the write error recovery path in pblk.
- Igor added extra error handling for lines, and fixed a bug in the pblk ringbuffer during GC.
- Javier refactored the pblk code a bit, added extra error handling, and added checks to verify that data returned from drive is appropriate.
- Marcin added some extra logic to manage the write buffer. Now MW_CUNITS can be zero and the size of write buffer can be changed at module load time.
Thanks,
Matias
Hans Holmberg (3):
lightnvm: pblk: rework write error recovery path
lightnvm: pblk: garbage collect lines with failed writes
lightnvm: pblk: fix smeta write error path
Igor Konopko (4):
lightnvm: proper error handling for pblk_bio_add_pages
lightnvm: error handling when whole line is bad
lightnvm: fix partial read error path
lightnvm: pblk: sync RB and RL states during GC
Javier Gonz=C3=A1lez (11):
lightnvm: pblk: fail gracefully on line alloc. failure
lightnvm: pblk: recheck for bad lines at runtime
lightnvm: pblk: check read lba on gc path
lightnvn: pblk: improve error msg on corrupted LBAs
lightnvm: pblk: warn in case of corrupted write buffer
lightnvm: pblk: return NVM_ error on failed submission
lightnvm: pblk: remove unnecessary indirection
lightnvm: pblk: remove unnecessary argument
lightnvm: pblk: check for chunk size before allocating it
lightnvn: pass flag on graceful teardown to targets
lightnvm: pblk: remove dead function
Marcin Dziegielewski (2):
lightnvm: pblk: handle case when mw_cunits equals to 0
lightnvm: pblk: add possibility to set write buffer size manually

 drivers/lightnvm/core.c          |  10 +-
 drivers/lightnvm/pblk-core.c     | 149 +++++++++++++++------
 drivers/lightnvm/pblk-gc.c       | 112 ++++++++++------
 drivers/lightnvm/pblk-init.c     | 112 +++++++++++-----
 drivers/lightnvm/pblk-map.c      |  33 +++--
 drivers/lightnvm/pblk-rb.c       |  51 +------
 drivers/lightnvm/pblk-read.c     |  83 +++++++++---
 drivers/lightnvm/pblk-recovery.c |  91 -------------
 drivers/lightnvm/pblk-rl.c       |  29 +++-
 drivers/lightnvm/pblk-sysfs.c    |  15 ++-

drivers/lightnvm/pblk-write.c | 281 +++++++++++++++++++++++++--------=

------

Quoted 8 lines
Quoted 4 lines
 drivers/lightnvm/pblk.h          |  43 +++---
 drivers/nvme/host/lightnvm.c     |   1 -
 include/linux/lightnvm.h         |   2 +-
 14 files changed, 604 insertions(+), 408 deletions(-)

=20
Hi Jens,
=20
Javier had some comments to 16, 18, and 20. The rest is ready to go. Would=

you like me to resend the patches?

Yes please.=20