Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1727357 > unrolled thread
| Started by | "Javier González" <jg@lightnvm.io> |
|---|---|
| First post | 2017-09-06 13:00 +0200 |
| Last post | 2017-09-06 16:20 +0200 |
| Articles | 7 — 4 participants |
Back to article view | Back to linux.kernel
[PATCH 00/18] lightnvm: pblk patches for 4.14 "Javier González" <jg@lightnvm.io> - 2017-09-06 13:00 +0200
[PATCH 07/18] lightnvm: pblk: use constant for GC parameter "Javier González" <jg@lightnvm.io> - 2017-09-06 13:00 +0200
[PATCH 01/18] lightnvm: pblk: improve naming for internal req. "Javier González" <jg@lightnvm.io> - 2017-09-06 13:00 +0200
Re: [PATCH 01/18] lightnvm: pblk: improve naming for internal req. Christoph Hellwig <hch@infradead.org> - 2017-09-06 15:50 +0200
Re: [PATCH 01/18] lightnvm: pblk: improve naming for internal req. Javier González <jg@lightnvm.io> - 2017-09-06 16:10 +0200
Re: [PATCH 00/18] lightnvm: pblk patches for 4.14 Jens Axboe <axboe@kernel.dk> - 2017-09-06 16:10 +0200
Re: [PATCH 00/18] lightnvm: pblk patches for 4.14 Javier González <jg@lightnvm.io> - 2017-09-06 16:20 +0200
| From | "Javier González" <jg@lightnvm.io> |
|---|---|
| Date | 2017-09-06 13:00 +0200 |
| Subject | [PATCH 00/18] lightnvm: pblk patches for 4.14 |
| Message-ID | <umGdP-wH-3@gated-at.bofh.it> |
Hi Jens,
Here is the pblk patchset for this window.
The most notable patches are on the read path:
- ("lightnvm: pblk: check lba sanity on read path") uses the lba
stored on the out-of-bound area to verify that the read ppa
corresponds to the lba pointed to by the read bio.
- ("lightnvm: pblk: guarantee line integrity on reads") guarantees
that if a line is being GC'ed and a read comes in the middle, that
line is not being moved into the free list until the read completes.
Otherwise, the line could be reclaimed to be erased and re-written,
thus causing data corruption.
The rest of the patches are are basically bug fixes and refactoring to
improve code readability.
The patches apply on your for-4.14/block, and you can be found at:
https://github.com/OpenChannelSSD/linux/tree/pblk.for-4.14
Thanks,
Javier
Javier González (18):
lightnvm: pblk: improve naming for internal req.
lightnvm: pblk: refactor read lba sanity check
lightnvm: pblk: normalize ppa namings
lightnvm: pblk: check for failed mempool alloc.
lightnvm: pblk: initialize debug stat counter
lightnvm: pblk: use right flag for GC allocation
lightnvm: pblk: use constant for GC parameter
lightnvm: pblk: check lba sanity on read path
lightnvm: pblk: simplify data validity check on GC
lightnvm: pblk: use bio_copy_kern when possible
lightnvm: pblk: refactor read path on GC
lightnvm: pblk: free padded entries in write buffer
lightnvm: pblk: fix write I/O sync stat
lightnvm: pblk: simplify path on REQ_PREFLUSH
lightnvm: pblk: avoid deadlock on low LUN config
lightnvm: pblk: enable 1 LUN configuration
lightnvm: pblk: guarantee line integrity on reads
lightnvm: pblk: remove unnecessary check
drivers/lightnvm/pblk-cache.c | 24 ++--
drivers/lightnvm/pblk-core.c | 187 ++++++++++++++++--------------
drivers/lightnvm/pblk-gc.c | 133 ++++++++++------------
drivers/lightnvm/pblk-init.c | 25 ++++-
drivers/lightnvm/pblk-map.c | 21 ++--
drivers/lightnvm/pblk-rb.c | 14 +--
drivers/lightnvm/pblk-read.c | 237 ++++++++++++++++++++++++++-------------
drivers/lightnvm/pblk-recovery.c | 9 +-
drivers/lightnvm/pblk-rl.c | 6 +
drivers/lightnvm/pblk-write.c | 37 +++---
drivers/lightnvm/pblk.h | 40 +++----
11 files changed, 423 insertions(+), 310 deletions(-)
--
2.7.4
[toc] | [next] | [standalone]
| From | "Javier González" <jg@lightnvm.io> |
|---|---|
| Date | 2017-09-06 13:00 +0200 |
| Subject | [PATCH 07/18] lightnvm: pblk: use constant for GC parameter |
| Message-ID | <umGdR-wH-53@gated-at.bofh.it> |
| In reply to | #1727357 |
Use a constant instead of using meaningless tuning parameters on the
garbage collector algorithms.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
---
drivers/lightnvm/pblk-gc.c | 4 ++--
drivers/lightnvm/pblk.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/lightnvm/pblk-gc.c b/drivers/lightnvm/pblk-gc.c
index 6090d28f7995..92694e35afde 100644
--- a/drivers/lightnvm/pblk-gc.c
+++ b/drivers/lightnvm/pblk-gc.c
@@ -93,7 +93,7 @@ static int pblk_gc_move_valid_secs(struct pblk *pblk, struct pblk_gc_rq *gc_rq)
retry:
spin_lock(&gc->w_lock);
- if (gc->w_entries >= PBLK_GC_W_QD) {
+ if (gc->w_entries >= PBLK_GC_RQ_QD) {
spin_unlock(&gc->w_lock);
pblk_gc_writer_kick(&pblk->gc);
usleep_range(128, 256);
@@ -602,7 +602,7 @@ int pblk_gc_init(struct pblk *pblk)
spin_lock_init(&gc->w_lock);
spin_lock_init(&gc->r_lock);
- sema_init(&gc->gc_sem, 128);
+ sema_init(&gc->gc_sem, PBLK_GC_RQ_QD);
INIT_LIST_HEAD(&gc->w_list);
INIT_LIST_HEAD(&gc->r_list);
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
index 08a463fe855f..b7f5fa8b49d0 100644
--- a/drivers/lightnvm/pblk.h
+++ b/drivers/lightnvm/pblk.h
@@ -818,7 +818,7 @@ int pblk_recov_setup_rq(struct pblk *pblk, struct pblk_c_ctx *c_ctx,
* pblk gc
*/
#define PBLK_GC_MAX_READERS 8 /* Max number of outstanding GC reader jobs */
-#define PBLK_GC_W_QD 128 /* Queue depth for inflight GC write I/Os */
+#define PBLK_GC_RQ_QD 128 /* Queue depth for inflight GC requests */
#define PBLK_GC_L_QD 4 /* Queue depth for inflight GC lines */
#define PBLK_GC_RSV_LINE 1 /* Reserved lines for GC */
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | "Javier González" <jg@lightnvm.io> |
|---|---|
| Date | 2017-09-06 13:00 +0200 |
| Subject | [PATCH 01/18] lightnvm: pblk: improve naming for internal req. |
| Message-ID | <umGdR-wH-55@gated-at.bofh.it> |
| In reply to | #1727357 |
Each request type sent to the LightNVM subsystem requires different
metadata. Until now, we have tailored this metadata based on write, read
and erase commands. However, pblk uses different metadata for internal
writes that do not hit the write buffer. Instead of abusing the metadata
for reads, create a new request type - internal write. This improves
code readability.
Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <matias@cnexlabs.com>
---
drivers/lightnvm/pblk-recovery.c | 6 +++---
drivers/lightnvm/pblk-write.c | 6 +++---
drivers/lightnvm/pblk.h | 5 ++++-
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c
index cb556e06673e..279638309d9a 100644
--- a/drivers/lightnvm/pblk-recovery.c
+++ b/drivers/lightnvm/pblk-recovery.c
@@ -344,7 +344,7 @@ static void pblk_end_io_recov(struct nvm_rq *rqd)
bio_put(rqd->bio);
nvm_dev_dma_free(dev->parent, rqd->meta_list, rqd->dma_meta_list);
- pblk_free_rqd(pblk, rqd, WRITE);
+ pblk_free_rqd(pblk, rqd, WRITE_INT);
atomic_dec(&pblk->inflight_io);
kref_put(&pad_rq->ref, pblk_recov_complete);
@@ -404,7 +404,7 @@ static int pblk_recov_pad_oob(struct pblk *pblk, struct pblk_line *line,
ppa_list = (void *)(meta_list) + pblk_dma_meta_size;
dma_ppa_list = dma_meta_list + pblk_dma_meta_size;
- rqd = pblk_alloc_rqd(pblk, WRITE);
+ rqd = pblk_alloc_rqd(pblk, WRITE_INT);
if (IS_ERR(rqd)) {
ret = PTR_ERR(rqd);
goto fail_free_meta;
@@ -491,7 +491,7 @@ static int pblk_recov_pad_oob(struct pblk *pblk, struct pblk_line *line,
fail_free_bio:
bio_put(bio);
fail_free_rqd:
- pblk_free_rqd(pblk, rqd, WRITE);
+ pblk_free_rqd(pblk, rqd, WRITE_INT);
fail_free_meta:
nvm_dev_dma_free(dev->parent, meta_list, dma_meta_list);
fail_free_pad:
diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c
index 3ad9e56d2473..920b93fb15d5 100644
--- a/drivers/lightnvm/pblk-write.c
+++ b/drivers/lightnvm/pblk-write.c
@@ -199,7 +199,7 @@ static void pblk_end_io_write_meta(struct nvm_rq *rqd)
bio_put(rqd->bio);
nvm_dev_dma_free(dev->parent, rqd->meta_list, rqd->dma_meta_list);
- pblk_free_rqd(pblk, rqd, READ);
+ pblk_free_rqd(pblk, rqd, WRITE_INT);
atomic_dec(&pblk->inflight_io);
}
@@ -370,7 +370,7 @@ int pblk_submit_meta_io(struct pblk *pblk, struct pblk_line *meta_line)
int i, j;
int ret;
- rqd = pblk_alloc_rqd(pblk, READ);
+ rqd = pblk_alloc_rqd(pblk, WRITE_INT);
if (IS_ERR(rqd)) {
pr_err("pblk: cannot allocate write req.\n");
return PTR_ERR(rqd);
@@ -434,7 +434,7 @@ int pblk_submit_meta_io(struct pblk *pblk, struct pblk_line *meta_line)
if (likely(l_mg->emeta_alloc_type == PBLK_VMALLOC_META))
bio_put(bio);
fail_free_rqd:
- pblk_free_rqd(pblk, rqd, READ);
+ pblk_free_rqd(pblk, rqd, WRITE_INT);
return ret;
}
diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h
index 67e623bd5c2d..08a463fe855f 100644
--- a/drivers/lightnvm/pblk.h
+++ b/drivers/lightnvm/pblk.h
@@ -59,7 +59,10 @@
for ((i) = 0, rlun = &(pblk)->luns[0]; \
(i) < (pblk)->nr_luns; (i)++, rlun = &(pblk)->luns[(i)])
-#define ERASE 2 /* READ = 0, WRITE = 1 */
+/* READ = 0, WRITE (user) = 1 */
+#define ERASE 2
+#define WRITE_INT 3 /* Internal write. Not through write buffer */
+
enum {
/* IO Types */
--
2.7.4
[toc] | [prev] | [next] | [standalone]
| From | Christoph Hellwig <hch@infradead.org> |
|---|---|
| Date | 2017-09-06 15:50 +0200 |
| Subject | Re: [PATCH 01/18] lightnvm: pblk: improve naming for internal req. |
| Message-ID | <umISm-2uc-31@gated-at.bofh.it> |
| In reply to | #1727359 |
> -#define ERASE 2 /* READ = 0, WRITE = 1 */
> +/* READ = 0, WRITE (user) = 1 */
> +#define ERASE 2
> +#define WRITE_INT 3 /* Internal write. Not through write buffer */
enum {
PBLK_READ,
PBLK_WRITE,
PBLK_ERASE,
PBLK_WRITE,
};
please. Don't abuse and overload the messy READ/WRITE macros in any
new code.
[toc] | [prev] | [next] | [standalone]
| From | Javier González <jg@lightnvm.io> |
|---|---|
| Date | 2017-09-06 16:10 +0200 |
| Subject | Re: [PATCH 01/18] lightnvm: pblk: improve naming for internal req. |
| Message-ID | <umJbH-2R0-1@gated-at.bofh.it> |
| In reply to | #1727490 |
[Multipart message — attachments visible in raw view] — view raw
> On 6 Sep 2017, at 15.46, Christoph Hellwig <hch@infradead.org> wrote:
>
>> -#define ERASE 2 /* READ = 0, WRITE = 1 */
>> +/* READ = 0, WRITE (user) = 1 */
>> +#define ERASE 2
>> +#define WRITE_INT 3 /* Internal write. Not through write buffer */
>
> enum {
> PBLK_READ,
> PBLK_WRITE,
> PBLK_ERASE,
> PBLK_WRITE,
> };
>
> please. Don't abuse and overload the messy READ/WRITE macros in any
> new code.
Ok. I'll resend.
Javier
[toc] | [prev] | [next] | [standalone]
| From | Jens Axboe <axboe@kernel.dk> |
|---|---|
| Date | 2017-09-06 16:10 +0200 |
| Message-ID | <umJbI-2R0-15@gated-at.bofh.it> |
| In reply to | #1727357 |
On 09/06/2017 04:50 AM, Javier González wrote: > Hi Jens, > > Here is the pblk patchset for this window. You must mean for the next window, surely, since we're in the middle of the current merge window? Have these patches been posted for review before? This should have been done (at least) two weeks ago! Get rid of anything that isn't a bug fix, I don't want to take anything that looks like a feature or refactoring of code. -- Jens Axboe
[toc] | [prev] | [next] | [standalone]
| From | Javier González <jg@lightnvm.io> |
|---|---|
| Date | 2017-09-06 16:20 +0200 |
| Message-ID | <umJlp-2UP-33@gated-at.bofh.it> |
| In reply to | #1727525 |
[Multipart message — attachments visible in raw view] — view raw
> On 6 Sep 2017, at 16.04, Jens Axboe <axboe@kernel.dk> wrote: > > On 09/06/2017 04:50 AM, Javier González wrote: >> Hi Jens, >> >> Here is the pblk patchset for this window. > > You must mean for the next window, surely, since we're in the middle > of the current merge window? Have these patches been posted for > review before? This should have been done (at least) two weeks ago! > > Get rid of anything that isn't a bug fix, I don't want to take > anything that looks like a feature or refactoring of code. > Ok. I'll re-post only bug fixes. > -- > Jens Axboe Javier.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web