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
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
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
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,
*/
> + 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
*/
> 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
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)
> +
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
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
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
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
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
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|
* 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
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
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
> 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
>
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
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
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
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
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
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
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
> 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
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
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
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
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
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
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
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
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
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
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
> 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
> 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
> 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,
> 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
>
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
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
> 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
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
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
> 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
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
> 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
> 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,
>>>>
>&
> 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
> 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
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
> 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:
> 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
>>>>
>>>>
> 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
> 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,
> 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:
>>>>
>>>>
> 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:
>>>>
>>>>&
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
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
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
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:
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
. 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
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
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
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
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
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
, 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
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
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
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
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
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
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
, 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
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
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
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
> 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
> 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
> 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
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
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
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
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
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
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 ++-
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
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
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
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
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
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
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
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
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
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
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
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
101 - 200 of 550 matches
Mail list logo