Re: [PATCH v2 13/16] lightnvm: pblk: store multiple copies of smeta

2019-03-24 Thread Javier González
nbalanced(pblk, line)) > pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id); > @@ -722,7 +726,7 @@ struct pblk_line *pblk_recov_l2p(struct pblk *pblk) > > line = &pblk->lines[i]; > > - memset(smeta, 0, lm->smeta_len); > + memset(smeta, 0, lm->smeta_len * lm->smeta_copies); > line->smeta = smeta; > line->lun_bitmap = ((void *)(smeta_buf)) + > sizeof(struct line_smeta); > diff --git a/drivers/lightnvm/pblk-rl.c b/drivers/lightnvm/pblk-rl.c > index b014957..944372c 100644 > --- a/drivers/lightnvm/pblk-rl.c > +++ b/drivers/lightnvm/pblk-rl.c > @@ -218,7 +218,8 @@ void pblk_rl_init(struct pblk_rl *rl, int budget, int > threshold) > unsigned int rb_windows; > > /* Consider sectors used for metadata */ > - sec_meta = (lm->smeta_sec + lm->emeta_sec[0]) * l_mg->nr_free_lines; > + sec_meta = ((lm->smeta_sec * lm->smeta_copies) > + + lm->emeta_sec[0]) * l_mg->nr_free_lines; > blk_meta = DIV_ROUND_UP(sec_meta, geo->clba); > > rl->high = pblk->op_blks - blk_meta - lm->blk_per_line; > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index 3a84c8a..0999245 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -547,6 +547,7 @@ struct pblk_line_mgmt { > struct pblk_line_meta { > unsigned int smeta_len; /* Total length for smeta */ > unsigned int smeta_sec; /* Sectors needed for smeta */ > + unsigned int smeta_copies; /* Number of smeta copies */ > > unsigned int emeta_len[4]; /* Lengths for emeta: >* [0]: Total > -- > 2.9.5 Looks good. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [RFC PATCH v2] lightnvm: add mechanism to trigger pblk close on reboot

2019-03-24 Thread Javier González
gt; - > - mutex_lock(&dev->mlock); > - list_for_each_entry_safe(t, tmp, &dev->targets, list) { > - if (t->dev->parent != dev) > - continue; > - __nvm_remove_target(t, false); > - } > - mutex_unlock(&dev->mlock); > - > down_write(&nvm_lock); > - list_del(&dev->devices); > + _nvm_unregister(dev, false); > up_write(&nvm_lock); > - > - nvm_free(dev); > } > EXPORT_SYMBOL(nvm_unregister); > > -- > 1.8.3.1 Otherwise, it looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH v4 6/7] lightnvm: track inflight target creations

2019-04-23 Thread Javier González
p;dev->ref); > + ret = nvm_create_tgt(dev, create); > + if (ret) > + kref_put(&dev->ref, nvm_free); > + > + return ret; > } > > static long nvm_ioctl_info(struct file *file, void __user *arg) > diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h > index d3b0270..4d0d565 100644 > --- a/include/linux/lightnvm.h > +++ b/include/linux/lightnvm.h > @@ -428,6 +428,7 @@ struct nvm_dev { > char name[DISK_NAME_LEN]; > void *private_data; > > + struct kref ref; > void *rmap; > > struct mutex mlock; > -- > 2.9.5 Much better with the kref() Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH v4 7/7] lightnvm: do not remove instance under global lock

2019-04-23 Thread Javier González
ioctl_remove))) > return -EFAULT; > @@ -1361,15 +1367,7 @@ static long nvm_ioctl_dev_remove(struct file *file, > void __user *arg) > return -EINVAL; > } > > - down_read(&nvm_lock); > - list_for_each_entry(dev, &nvm_devices,

Re: [PATCH v5 1/3] lightnvm: pblk: simplify partial read path

2019-04-30 Thread Javier González
*/ > + bio_put(int_bio); > + int_bio = bio_clone_fast(bio, GFP_KERNEL, &pblk_bio_set); > + goto split_retry; > + } else if (pblk_submit_io(pblk, rqd)) { > + /* Submitting IO to drive failed, let's report an error */ > + rqd->error = -ENODEV; > + pblk_end_io_read(rqd); > } > } > > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index 17ced12..a678553 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -121,18 +121,6 @@ struct pblk_g_ctx { > u64 lba; > }; > > -/* partial read context */ > -struct pblk_pr_ctx { > - struct bio *orig_bio; > - DECLARE_BITMAP(bitmap, NVM_MAX_VLBA); > - unsigned int orig_nr_secs; > - unsigned int bio_init_idx; > - void *ppa_ptr; > - dma_addr_t dma_ppa_list; > - u64 lba_list_mem[NVM_MAX_VLBA]; > - u64 lba_list_media[NVM_MAX_VLBA]; > -}; > - > /* Pad context */ > struct pblk_pad_rq { > struct pblk *pblk; > @@ -759,7 +747,7 @@ 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); > 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); > + struct ppa_addr ppa); > unsigned int pblk_rb_read_commit(struct pblk_rb *rb, unsigned int entries); > > unsigned int pblk_rb_sync_init(struct pblk_rb *rb, unsigned long *flags); > @@ -859,8 +847,8 @@ int pblk_update_map_gc(struct pblk *pblk, sector_t lba, > struct ppa_addr ppa, > struct pblk_line *gc_line, u64 paddr); > void pblk_lookup_l2p_rand(struct pblk *pblk, struct ppa_addr *ppas, > u64 *lba_list, int nr_secs); > -void pblk_lookup_l2p_seq(struct pblk *pblk, struct ppa_addr *ppas, > - sector_t blba, int nr_secs); > +int pblk_lookup_l2p_seq(struct pblk *pblk, struct ppa_addr *ppas, > + sector_t blba, int nr_secs, bool *from_cache); > void *pblk_get_meta_for_writes(struct pblk *pblk, struct nvm_rq *rqd); > void pblk_get_packed_meta(struct pblk *pblk, struct nvm_rq *rqd); > > -- > 2.9.5 It looks good to me. Thanks for this Igor! Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [RFC PATCH 13/18] drivers: set bio iopriority field

2019-04-30 Thread Javier González
*/ > bio_set_op_attrs(new_bio, REQ_OP_READ, 0); > + bio_set_prio(bio, get_current_ioprio()); > > rqd->bio = new_bio; > rqd->nr_ppas = nr_holes; > diff --git a/drivers/lightnvm/pblk-write.c b/drivers/lightnvm/pblk-write.c > index 6593deab52da..3fdbbff40fde 100644 > --- a/drivers/lightnvm/pblk-write.c > +++ b/drivers/lightnvm/pblk-write.c > @@ -628,6 +628,7 @@ static int pblk_submit_write(struct pblk *pblk, int > *secs_left) > > bio->bi_iter.bi_sector = 0; /* internal bio */ > bio_set_op_attrs(bio, REQ_OP_WRITE, 0); > + bio_set_prio(bio, get_current_ioprio()); > > rqd = pblk_alloc_rqd(pblk, PBLK_WRITE); > rqd->bio = bio; > pblk bits look god to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH] lightnvm: pblk: Fix freeing merged pages

2019-05-15 Thread Javier González
t; + for (i = 0; i < bio->bi_vcnt; i++) { > + bv = &bio->bi_io_vec[i]; > + page = bv->bv_page; > + for (e = 0; e < bv->bv_len; e += PBLK_EXPOSED_PAGE_SIZE, nbv++) > + if (nbv >= off) > +

[PATCH 2/4] lightnvm: fix cleanup order of disk on init error

2017-04-07 Thread Javier González
Reorder disk allocation such that the disk structure can be put safely. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index da4c082..28e69a7 100644

[PATCH 3/4] lightnvm: bad type conversion for nvme control bits

2017-04-07 Thread Javier González
The NVMe I/O command control bits are 16 bytes, but is interpreted as 32 bytes in the lightnvm user I/O data path. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host

[PATCH 1/4] lightnvm: double-clear of dev->lun_map on target init error

2017-04-07 Thread Javier González
hen cleaning up a successful initialized target. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 2122922..da4c082 100

[PATCH 4/4] lightnvm: allow to init targets on factory mode

2017-04-07 Thread Javier González
any moment in time without requiring a full-device erase. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 14 +++--- drivers/lightnvm/rrpc.c | 3 ++- include/linux/lightnvm.h | 3 ++- include/uapi/linux/lightnvm.h | 4 4 files changed, 19 insertions

[PATCH v3] lightnvm: pblk

2017-04-07 Thread Javier González
imizations. * Improvements on GC workqueue management and victim selection. * Implement sysfs interface to query pblk's operation and statistics. * Implement a user - GC I/O rate-limiter * Various bug fixes Javier González (1): lightnvm: physical block device (pblk) target Documentation/li

Re: [PATCH v3] lightnvm: physical block device (pblk) target

2017-04-09 Thread Javier González
Hi Bart, Thanks for reviewing the code. > On 8 Apr 2017, at 22.56, Bart Van Assche wrote: > > On 04/07/17 11:50, Javier González wrote: >> Documentation/lightnvm/pblk.txt | 21 + >> drivers/lightnvm/Kconfig | 19 + >> drivers/lightnvm/Makefile|

[PATCH v4] lightnvm: pblk

2017-04-10 Thread Javier González
* Improvements on GC workqueue management and victim selection. * Implement sysfs interface to query pblk's operation and statistics. * Implement a user - GC I/O rate-limiter * Various bug fixes Javier González (1): lightnvm: physical block device (pblk) target Documentation/lightnvm/pblk

[PATCH 1/3] lightnvm: convert sprintf into snprintf

2017-04-10 Thread Javier González
Convert sprintf calls to snprintf in order to make possible buffer overflow more obvious. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index c3340ef

[PATCH 2/3] lightnvm: make nvm_free static

2017-04-10 Thread Javier González
Prefix the nvm_free static function with a missing static keyword. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index bdbb333..3e51a05 100644 --- a/drivers

Re: [PATCH 1/3] lightnvm: convert sprintf into snprintf

2017-04-10 Thread Javier González
> On 10 Apr 2017, at 20.56, Bart Van Assche wrote: > > On Mon, 2017-04-10 at 20:51 +0200, Javier González wrote: >> Convert sprintf calls to snprintf in order to make possible buffer >> overflow more obvious. >> >> Signed-off-by: Javier González >

[PATCH] lightnvm: convert sprintf into strlcpy

2017-04-11 Thread Javier González
Convert sprintf calls to strlcpy in order to make possible buffer overflow more obvious. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 258007a..2c26af3

[PATCH 2/3] lightnvm: fix type checks on rrpc

2017-04-11 Thread Javier González
sector_t is always unsigned, therefore avoid < 0 checks on it. Signed-off-by: Javier González --- drivers/lightnvm/rrpc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 5dba544..cf0e28a 100644 --- a/driv

[PATCH 1/3] lightnvm: clean unused variable

2017-04-11 Thread Javier González
Clean unused variable on lightnvm core. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index eb9ab1a..258007a 100644 --- a/drivers/lightnvm/core.c +++ b/drivers/lightnvm/core.c

[PATCH 0/3] lightnvm: small fixes

2017-04-11 Thread Javier González
Last small lightnvm fixes for lightnvm core. These are motivated by Bart's comments on pblk's patch. Javier González (3): lightnvm: clean unused variable lightnvm: fix type checks on rrpc lightnvm: convert sprintf into strlcpy drivers/lightnvm/core.c | 9 +++-- driver

[PATCH 3/3] lightnvm: convert sprintf into strlcpy

2017-04-11 Thread Javier González
Convert sprintf calls to strlcpy in order to make possible buffer overflow more obvious. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c index 258007a..2c26af3

[PATCH v5] lightnvn: pblk

2017-04-11 Thread Javier González
data is stored per line instead of per LUN. This allows for space optimizations. * Improvements on GC workqueue management and victim selection. * Implement sysfs interface to query pblk's operation and statistics. * Implement a user - GC I/O rate-limiter * Various bug fixes Javier Gonzál

Re: [PATCH v5] lightnvn: pblk

2017-04-11 Thread Javier González
Hi Bart, > On 11 Apr 2017, at 17.19, Bart Van Assche wrote: > > On Tue, 2017-04-11 at 16:31 +0200, Javier González wrote: >> Changes since v4: >> * Rebase on top of Matias' for-4.12/core >> * Fix type implicit conversions reported by sparse (reported by Bart Van

Re: [PATCH v5] lightnvn: pblk

2017-04-12 Thread Javier González
> On 12 Apr 2017, at 00.23, Bart Van Assche wrote: > > On Wed, 2017-04-12 at 00:13 +0200, Javier González wrote: >> please point out to any other tools/concerns you may have. > > Hello Javier, > > Do you already have an account at https://scan.coverity.com/? Any L

[PATCH v6] lightnvm: pblk

2017-04-12 Thread Javier González
GC workqueue management and victim selection. * Implement sysfs interface to query pblk's operation and statistics. * Implement a user - GC I/O rate-limiter * Various bug fixes Javier González (1): lightnvm: physical block device (pblk) target Documentation/lightnvm/pblk.txt | 21

Re: [PATCH] lightnvm: propagate pblk_init return to userspace

2017-04-21 Thread Javier González
ct return value to userspace. > > Because pblk was introduced recently this only needs to go in 4.12. > > Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target") > Signed-off-by: Rakesh Pandit > Looks good. Reviewed-by: Javier González Javier signature.asc Description: Message signed with OpenPGP

Re: [PATCH 1/2] lightnvm: potential underflow in pblk_read_rq()

2017-04-21 Thread Javier González
the type on the other 2 calls to pblk_get_secs in pblk-cache and pblk-core? Otherwise, it is a good catch. Reviewed-by: Javier González Javier signature.asc Description: Message signed with OpenPGP

Re: [PATCH 2/2] lightnvm: don't print a warning for ADDR_EMPTY

2017-04-21 Thread Javier González
ADDR_EMPTY) > - goto out; > - > spin_lock(&pblk->trans_lock); > ppa = pblk_trans_map_get(pblk, lba); > spin_unlock(&pblk->trans_lock); Thanks Dan. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

[PATCH 5/5] lightnvm: pblk: fix erase counters on error fail

2017-04-21 Thread Javier González
htnvm: physical block device (pblk) target" Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 28 +++- drivers/lightnvm/pblk-gc.c| 2 +- drivers/lightnvm/pblk-init.c | 9 ++--- drivers/lightnvm/pblk-map.c | 4 ++-- drivers/lightnvm/pblk-rl

[PATCH 2/5] lightnvm: pblk: fix bad error check

2017-04-21 Thread Javier González
Fix bad error check Fixes: a4bd217b4326 "lightnvm: physical block device (pblk) target" Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c ind

[PATCH 3/5] lightnvm: pblk: fix memory leak on error path

2017-04-21 Thread Javier González
When write recovery fails, Free memory for the recovery structure. Fixes: a4bd217b4326 "lightnvm: physical block device (pblk) target" Signed-off-by: Javier González --- drivers/lightnvm/pblk-write.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/lightnvm/pblk-write.c

[PATCH 0/5] lightnvm: pblk extra patches for 4.12

2017-04-21 Thread Javier González
Hi Matias, This is a couple of bug fixes for the pblk release patch. Thanks, Javier Javier González (5): lightnvm: pblk: fix race condition on line retry lightnvm: pblk: fix bad error check lightnvm: pblk: fix memory leak on error path lightnvm: pblk: free metadata on line alloc failure

[PATCH 1/5] lightnvm: pblk: fix race condition on line retry

2017-04-21 Thread Javier González
When a pblk line fails (or is recovered), make sure to take the line management lock. Fixes: a4bd217b4326 "lightnvm: physical block device (pblk) target" Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) di

[PATCH 4/5] lightnvm: pblk: free metadata on line alloc failure

2017-04-21 Thread Javier González
When a line allocation fails, for example, due to having too many bad blocks, free its metadata correctly. Fixes: a4bd217b4326 "lightnvm: physical block device (pblk) target" Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 16 +--- 1 file changed, 9

Re: [PATCH 01/11] blk: remove bio_set arg from blk_queue_split()

2017-04-22 Thread Javier González
> On 20 Apr 2017, at 07.38, NeilBrown wrote: > > blk_queue_split() is always called with the last arg being q->bio_split, > where 'q' is the first arg. > > Also blk_queue_split() sometimes uses the passed-in 'bs' and sometimes uses > q->bio_split. > > This is inconsistent and unnecessary. Remo

Re: [PATCH 5/5] lightnvm: pblk: fix erase counters on error fail

2017-04-22 Thread Javier González
> On 22 Apr 2017, at 11.22, Matias Bjørling wrote: > > On 04/22/2017 01:32 AM, Javier González wrote: >> When block erases fail, these blocks are marked bad. The number of valid >> blocks in the line was not updated, which could cause an infinite loop >> on the

Re: [PATCH 5/5] lightnvm: pblk: fix erase counters on error fail

2017-04-23 Thread Javier González
> On 23 Apr 2017, at 19.59, Matias Bjørling wrote: > > On 04/22/2017 11:31 AM, Javier González wrote: >>> On 22 Apr 2017, at 11.22, Matias Bjørling wrote: >>> >>> On 04/22/2017 01:32 AM, Javier González wrote: >>>> When block erases fail,

Re: [PATCH 1/2] lightnvm: potential underflow in pblk_read_rq()

2017-04-24 Thread Javier González
> On 24 Apr 2017, at 12.24, Dan Carpenter wrote: > > On Sat, Apr 22, 2017 at 12:24:50AM +0200, Javier González wrote: >>> On 21 Apr 2017, at 22.53, Dan Carpenter wrote: >>> >>> This is a static checker fix, and perhaps not a real bug. The static >

Re: [PATCH -next] lightnvm: fix possible memory leak in pblk_bb_discovery()

2017-04-25 Thread Javier González
s to > rlun->bb_list when error. > > Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target") > Signed-off-by: Wei Yongjun > --- > Thanks Wei. Looks good. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 09/13] lightnvm/pblk-read: use bio_clone_fast()

2017-05-02 Thread Javier González
gt; int pblk_submit_read_gc(struct pblk *pblk, u64 *lba_list, void *data, > unsigned int nr_secs, unsigned int *secs_to_gc, Hi Neil, Looks good. Thanks for fixing this. I did not know that bio_clone_bioset was not supposed to be used on drivers. Reviewed-by: Javier González Tested-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 09/13] lightnvm/pblk-read: use bio_clone_fast()

2017-05-02 Thread Javier González
> On 2 May 2017, at 23.51, NeilBrown wrote: > >> >> Hi Neil, >> >> Looks good. Thanks for fixing this. I did not know that bio_clone_bioset >> was not supposed to be used on drivers. > > Prior to my patchset, using bio_clone_bioset() wasn't wrong in drivers, > though it was a waste when bio_cl

[PATCH 2/2] lightnvm: fix bad back free on error path

2017-05-03 Thread Javier González
Free memory correctly when an allocation fails on a loop and we free backwards previously successful allocations. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c

[PATCH 1/2] lightnvm: create cmd before allocating request

2017-05-03 Thread Javier González
Create nvme command before allocating a request using nvme_alloc_request, which uses the command direction. Up until now, the command has been zeroized, so all commands have been allocated as a read operation. Signed-off-by: Javier González --- drivers/nvme/host/lightnvm.c | 4 ++-- 1 file

Re: [PATCH 1/2] lightnvm: create cmd before allocating request

2017-05-04 Thread Javier González
> On 4 May 2017, at 15.53, Jens Axboe wrote: > > On Wed, May 03 2017, Javier González wrote: >> Create nvme command before allocating a request using >> nvme_alloc_request, which uses the command direction. Up until now, the >> command has been zeroized, so all comman

Large latency on blk_queue_enter

2017-05-08 Thread Javier González
Hi, I find an unusual added latency(~20-30ms) on blk_queue_enter when allocating a request directly from the NVMe driver through nvme_alloc_request. I could use some help confirming that this is a bug and not an expected side effect due to something else. I can reproduce this latency consistently

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 14.27, Ming Lei wrote: > > On Mon, May 08, 2017 at 01:54:58PM +0200, Javier González wrote: >> Hi, >> >> I find an unusual added latency(~20-30ms) on blk_queue_enter when >> allocating a request directly from the NVMe driver through >&g

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 16.13, Jens Axboe wrote: > > On 05/08/2017 07:44 AM, Javier González wrote: >>> On 8 May 2017, at 14.27, Ming Lei wrote: >>> >>> On Mon, May 08, 2017 at 01:54:58PM +0200, Javier González wrote: >>>> Hi, >>>> >&

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 16.23, Jens Axboe wrote: > > On 05/08/2017 08:20 AM, Javier González wrote: >>> On 8 May 2017, at 16.13, Jens Axboe wrote: >>> >>> On 05/08/2017 07:44 AM, Javier González wrote: >>>>> On 8 May 2017, at 14.27, Ming Lei wro

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 16.52, Jens Axboe wrote: > > On 05/08/2017 08:46 AM, Javier González wrote: >>> On 8 May 2017, at 16.23, Jens Axboe wrote: >>> >>> On 05/08/2017 08:20 AM, Javier González wrote: >>>>> On 8 May 2017, at 16.13, Jens Axboe

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
Javier > On 8 May 2017, at 17.14, Jens Axboe wrote: > > On 05/08/2017 09:08 AM, Jens Axboe wrote: >> On 05/08/2017 09:02 AM, Javier González wrote: >>>> On 8 May 2017, at 16.52, Jens Axboe wrote: >>>> >>>> On 05/08/2017 08:46 AM, Javier G

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 17.25, Jens Axboe wrote: > > On 05/08/2017 09:22 AM, Javier González wrote: >> Javier >> >>> On 8 May 2017, at 17.14, Jens Axboe wrote: >>> >>> On 05/08/2017 09:08 AM, Jens Axboe wrote: >>>> On 05/08/2017 09:

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 17.40, Jens Axboe wrote: > > On 05/08/2017 09:38 AM, Javier González wrote: >>> On 8 May 2017, at 17.25, Jens Axboe wrote: >>> >>> On 05/08/2017 09:22 AM, Javier González wrote: >>>> Javier >>>> >>>>

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 18.06, Jens Axboe wrote: > > On 05/08/2017 09:49 AM, Javier González wrote: >>> On 8 May 2017, at 17.40, Jens Axboe wrote: >>> >>> On 05/08/2017 09:38 AM, Javier González wrote: >>>>> On 8 May 2017, at 17.25, Jens Axboe

Re: Large latency on blk_queue_enter

2017-05-09 Thread Javier González
> On 8 May 2017, at 18.39, Javier González wrote: > >> On 8 May 2017, at 18.06, Jens Axboe wrote: >> >> On 05/08/2017 09:49 AM, Javier González wrote: >>>> On 8 May 2017, at 17.40, Jens Axboe wrote: >>>> >>>> On 05/08/2017 09:38 AM,

Re: Large latency on blk_queue_enter

2017-05-09 Thread Javier González
> On 9 May 2017, at 12.58, Ming Lei wrote: > > On Tue, May 09, 2017 at 12:34:42PM +0200, Javier González wrote: >>> On 8 May 2017, at 18.39, Javier González wrote: >>> >>>> On 8 May 2017, at 18.06, Jens Axboe wrote: >>>> >>>>

Re: Large latency on blk_queue_enter

2017-05-09 Thread Javier González
> On 9 May 2017, at 13.21, Javier González wrote: > >> On 9 May 2017, at 12.58, Ming Lei wrote: >> >> On Tue, May 09, 2017 at 12:34:42PM +0200, Javier González wrote: >>>> On 8 May 2017, at 18.39, Javier González wrote: >>>> >>>>&

[PATCH] lightnvm: pblk: fix bad free seq. on error path

2017-05-12 Thread Javier González
Braces around the error patch for metadata pre-allocation are wrongly placed. This causes a memory leak in case of a memory allocation failure. Fix it Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 30 +++--- 1 file changed, 15 insertions(+), 15

[PATCH 01/20] lightnvm: re-convert ppa format on I/O failure

2017-06-26 Thread Javier González
In case of a failure when submitting a request, convert the ppa_list addresses to the target format so that it can interpret ppas for recovery Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/core.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion

[PATCH 02/20] lightnvm: propagate right error code to target

2017-06-26 Thread Javier González
If nvme_alloc_request fails, propagate the right error, instead of assuming ENOMEM. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/nvme/host/lightnvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme

[PATCH 00/20] LightNVM: pblk patches for 4.13

2017-06-26 Thread Javier González
https://github.com/OpenChannelSSD/linux.git pblk.for-4.13 Thanks, Javier Javier González (20): lightnvm: re-convert ppa format on I/O failure lightnvm: propagate right error code to target lightnvm: pblk: spare double cpu_to_le64 calc. lightnvm: pblk: add debug stat for read cache hits lightnvm:

[PATCH 07/20] lightnvm: pblk: rename read request pool

2017-06-26 Thread Javier González
Read requests allocate some extra memory to store its per I/O context. Instead of requiring yet another memory pool for other type of requests, generalize this context allocation (and change naming accordingly). Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm

[PATCH 08/20] lightnvm: pblk: sched. metadata on write thread

2017-06-26 Thread Javier González
. Using this approach, we see that we can saturate the media's bandwidth, which helps reducing both write latencies and the spinning time for user writer threads. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c

[PATCH 10/20] lightnvm: pblk: delete redundant buffer pointer

2017-06-26 Thread Javier González
After refactoring the metadata path, the backpointer controlling synced I/Os in a line becomes unnecessary; metadata is scheduled on the write thread, thus we know when the end of the line is reached and act on it directly. Signed-off-by: Javier González Signed-off-by: Matias Bjørling

[PATCH 09/20] lightnvm: pblk: delete redundant debug line stat

2017-06-26 Thread Javier González
Remove a legacy variable that helped verifying the consistency of the run-time metadata for the free line list. With the new metadata layout, this check is no longer necessary. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-sysfs.c | 8 +++- 1 file

[PATCH 12/20] lightnvm: pblk: simplify meta. memory allocation

2017-06-26 Thread Javier González
smeta size will always be suitable for a kmalloc allocation. Simplify the code and leave the vmalloc fallback only for emeta, where the pblk configuration has an impact. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 3 ++- drivers/lightnvm

[PATCH 04/20] lightnvm: pblk: add debug stat for read cache hits

2017-06-26 Thread Javier González
Add a new debug counter to measure cache hits on the read path Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 1 + drivers/lightnvm/pblk-read.c | 6 ++ drivers/lightnvm/pblk-sysfs.c | 3 ++- drivers/lightnvm/pblk.h | 1 + 4 files

[PATCH 17/20] lightnvm: pblk: add lock assertions on helpers

2017-06-26 Thread Javier González
Add lockdep assertions on helper functions. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c index d815cdad56b8..ed41cd7700b3 100644

[PATCH 18/20] lightnvm: pblk: redesign GC algorithm

2017-06-26 Thread Javier González
, while a single GC write thread places data in the write buffer. This design allows to (i) only move data from one line at a time, thus maintaining a sane free/recycled ration and (ii) maintain the GC writer busy with recycled data. Signed-off-by: Javier González Signed-off-by: Matias Bjørling

[PATCH 15/20] lightnvm: pblk: set metadata list for all I/Os

2017-06-26 Thread Javier González
Set a dma area for all I/Os in order to read/write from/to the metadata stored on the per-sector out-of-bound area. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 47 +++- drivers/lightnvm/pblk-read.c

[PATCH 11/20] lightnvm: pblk: issue multiplane reads if possible

2017-06-26 Thread Javier González
If a read request is sequential and its size aligns with a multi-plane page size, use the multi-plane hint to process the I/O in parallel in the controller. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 12 +++- drivers/lightnvm

[PATCH 03/20] lightnvm: pblk: spare double cpu_to_le64 calc.

2017-06-26 Thread Javier González
Spare a double calculation on the fast write path. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-map.c | 5 +++-- drivers/lightnvm/pblk-recovery.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/lightnvm/pblk-map.c

[PATCH 05/20] lightnvm: pblk: expose max sec per write on sysfs

2017-06-26 Thread Javier González
Allow to configure the number of maximum sectors per write command through sysfs. This makes it easier to tune write command sizes for different controller configurations. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 7 ++- drivers

[PATCH 16/20] lightnvm: pblk: cleanup unnecessary code

2017-06-26 Thread Javier González
Cleanup unnecessary headers and code lines. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 1 - drivers/lightnvm/pblk-write.c | 6 -- 2 files changed, 7 deletions(-) diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c

[PATCH 06/20] lightnvm: pblk: generalize erase path

2017-06-26 Thread Javier González
mapping algorithm. This patch generalizes the erase path so that other mapping algorithms can select an arbitrary line to be erased instead. It also gets rid of the erase semaphore since it creates jittering for user writes. Signed-off-by: Javier González Signed-off-by: Matias Bjørling

[PATCH 14/20] lightnvm: pblk: choose optimal victim GC line

2017-06-26 Thread Javier González
, which is somewhere between 1000-2000), we can afford scanning the lists to choose the optimal line to be recycled. This helps specially in lines with a high number of valid sectors. If the number of blocks per LUN increases, we will consider a more efficient policy. Signed-off-by: Javier González

[PATCH 13/20] lightnvm: pblk: decouple bad block from line alloc

2017-06-26 Thread Javier González
Decouple bad block discovery from line allocation logic. This allows to return meaningful error codes in case of bad block discovery failure. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-init.c | 55 ++-- 1 file

[PATCH 20/20] lightnvm: pblk: fail gracefully on irrec. error

2017-06-26 Thread Javier González
its best to persist buffered writes (which are already acknowledged) and close down on a graceful manner. This way, data might be recovered by re-instantiating pblk. Such state machine paves out the way for a state-based FTL log. Signed-off-by: Javier González Signed-off-by: Matias Bjørling

[PATCH 19/20] lightnvm: pblk: set mempool and workqueue params.

2017-06-26 Thread Javier González
closed and bad blocks. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/pblk-core.c | 7 --- drivers/lightnvm/pblk-init.c | 39 ++- drivers/lightnvm/pblk-write.c | 5 +++-- drivers/lightnvm/pblk.h | 13

Re: [PATCH 00/20] LightNVM: pblk patches for 4.13

2017-06-27 Thread Javier González
> On 27 Jun 2017, at 00.29, Jens Axboe wrote: > > On Mon, Jun 26 2017, Javier González wrote: >> Hi Matias, >> >> Here you have the pblk patchset for this window. >> >> Apart from small fixes for LightNVM core and pblk, there are three >> relevant c

Re: [bug report] lightnvm: pblk: sched. metadata on write thread

2017-06-28 Thread Javier González
> On 28 Jun 2017, at 16.26, Dan Carpenter wrote: > > Hello Javier González, > > The patch dd2a43437337: "lightnvm: pblk: sched. metadata on write > thread" from Jun 26, 2017, leads to the following static checker > warning: > > drivers/lig

Re: [bug report] lightnvm: pblk: sched. metadata on write thread

2017-06-28 Thread Javier González
> On 28 Jun 2017, at 17.03, Dan Carpenter wrote: > > On Wed, Jun 28, 2017 at 04:46:02PM +0200, Javier González wrote: >>> On 28 Jun 2017, at 16.26, Dan Carpenter wrote: >>> >>> Hello Javier González, >>> >>> The patch dd2a43437337: &quo

lightnvm: pblk: avoid ref warning on cache creation

2018-11-22 Thread Javier González
Matias, Can you pick this up for 4.20? Even though it is not an error per se, it does trigger an ugly false positive warning when CONFIG_REFCOUNT_FULL is set. Thanks, Javier Javier González (1): lightnvm: pblk: avoid ref warning on cache creation drivers/lightnvm/pblk-init.c | 14

[PATCH] lightnvm: pblk: avoid ref warning on cache creation

2018-11-22 Thread Javier González
about what actually happens on cache creation. In the process, do a small refactoring to use kref helpers. Signed-off-by: Javier González --- drivers/lightnvm/pblk-init.c | 14 +- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/lightnvm/pblk-init.c b/drivers

[PATCH] lightnvm: remove dma alloc/free helpers

2018-11-27 Thread Javier González
Time has shown that the LightNVM alloc/free dma helpers are merely replacements of the native dma_pool operations. Thus, remove them and let targets manage the LightNVM dma pool directly. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 25 +++-- drivers

lightnvm: remove dma alloc/free helpers

2018-11-27 Thread Javier González
n you send the V4 to make it easier to Matias to track. Thanks, Javier Javier González (1): lightnvm: remove dma alloc/free helpers drivers/lightnvm/core.c | 25 +++-- drivers/lightnvm/pblk-core.c | 10 +- drivers/lightnvm/pblk-read.c | 3 ++- dr

[PATCH] lightnvm: pblk: add comments wrt locking in recovery path

2018-11-28 Thread Javier González
pblk's recovery path is single threaded and therefore a number of assumptions regarding concurrency can be made. To avoid confusion, make this explicit with a couple of comments in the code. Signed-off-by: Javier González --- drivers/lightnvm/pblk-core.c | 1 + drivers/lightnvm

[PATCH 3/7] lightnvm: manage block list on LUN owner

2016-10-27 Thread Javier González
ment. Thus, since LUNs are managed strictly by the target, there is no need for the media manager to reserve GC blocks. As a FTL, rrpc owns exclusively its LUNs. Therefore, adapt rrpc to use the new management interface. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 5 ++-

[PATCH 1/7] lightnvm: enable to send hint to erase command

2016-10-27 Thread Javier González
Erases might be subject to host hints. An example is multi-plane programming to erase blocks in parallel. Enable targets to specify this hints. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 9 ++--- drivers/lightnvm/gennvm.c| 5 ++--- drivers/lightnvm/rrpc.c | 2

[PATCH 4/7] lightnvm: drop reserve and release LUN callbacks

2016-10-27 Thread Javier González
which target exclusively owns each target and can therefore allocate and free all the necessary structures before initializing the target. Not exclusively owned LUNs belong to the media manager in any case. Adapt rrpc to not use the reserve_lun/release_lun callback functions. Signed-off-by: Javier

[PATCH 7/7] lightnvm: rrpc: split bios of size > 256kb

2016-10-27 Thread Javier González
rrpc cannot handle bios of size > 256kb due to NVME's 64 bit completion bitmap. If a larger bio comes, split it explicitly. Signed-off-by: Javier González --- drivers/lightnvm/rrpc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnv

[PATCH 6/7] lightnvm: add ECC error codes

2016-10-27 Thread Javier González
Add ECC error codes to enable the appropriate handling in the target. Signed-off-by: Javier González --- include/linux/lightnvm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index e3ccaff..33643ae 100644 --- a/include/linux

[PATCH 2/7] lightnvm: do not decide on device blocks

2016-10-27 Thread Javier González
Device blocks should be marked by the device and considered as bad blocks by the media manager. Thus, do not make assumptions on which blocks are going to be used by the device. In doing so we might lose valid blocks from the free list. Signed-off-by: Javier González --- drivers/lightnvm

[PATCH 5/7] lightnvm: export set bad block table

2016-10-27 Thread Javier González
block management to rrpc. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 27 +++ drivers/lightnvm/gennvm.c | 25 + drivers/lightnvm/rrpc.c | 34 +- drivers/lightnvm/sysblk.c | 29

[PATCH 0/7] LightNVM patchset V2

2016-10-27 Thread Javier González
V2: Rebase patches on Matias' for-next Javier González (7): lightnvm: enable to send hint to erase command lightnvm: do not decide on device blocks lightnvm: manage block list on LUN owner lightnvm: drop reserve and release LUN callbacks lightnvm: export set bad block table lig

[PATCH 5/7] lightnvm: export set bad block table

2016-10-27 Thread Javier González
block management to rrpc. Signed-off-by: Javier González --- drivers/lightnvm/core.c | 27 +++ drivers/lightnvm/gennvm.c | 25 + drivers/lightnvm/rrpc.c | 34 +- drivers/lightnvm/sysblk.c | 29

[PATCH 7/7] lightnvm: rrpc: split bios of size > 256kb

2016-10-27 Thread Javier González
rrpc cannot handle bios of size > 256kb due to NVMe using a 64 bit bitmap to signal I/O completion. If a larger bio comes, split it explicitly. Signed-off-by: Javier González --- drivers/lightnvm/rrpc.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b/driv

[PATCH 6/7] lightnvm: add ECC error codes

2016-10-27 Thread Javier González
Add ECC error codes to enable the appropriate handling in the target. Signed-off-by: Javier González --- include/linux/lightnvm.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h index e3ccaff..33643ae 100644 --- a/include/linux

[PATCH 3/7] lightnvm: manage block list on LUN owner

2016-10-27 Thread Javier González
From: Javier González LUNs can be exclusively owned by a target through the media manager's reserve_lun function. In this case, the target should implement its own provisioning and manage internally the free/used/bad block list. This patch introduces a LUN management structure that c

[PATCH 4/7] lightnvm: drop reserve and release LUN callbacks

2016-10-27 Thread Javier González
From: Javier González On target initialization, targets use callbacks to the media manager to configure the LUNs they use. In order to simplify the flow, drop this callbacks and manage everything internally on the media manager. By making use of the newly introduce LUN management structure, the

<    1   2   3   4   5   6   >