Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 16.13, Jens Axboe <ax...@fb.com> wrote: > > On 05/08/2017 07:44 AM, Javier González wrote: >>> On 8 May 2017, at 14.27, Ming Lei <ming@redhat.com> wrote: >>> >>> On Mon, May 08, 2017 at 01:54:58PM +0200, Javier González wr

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 14.27, Ming Lei <ming@redhat.com> 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 NV

[PATCH 5/5] lightnvm: pblk: remove checks on mempool alloc.

2017-09-14 Thread Javier González
As part of the mempool audit on pblk, remove unnecessary mempool allocation checks on mempools. Reported-by: Jens Axboe <ax...@kernel.dk> Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 4 drivers/lightnvm/pblk-read.c | 8 -

[PATCH 3/5] lightnvm: pblk: decouple read/erase mempools

2017-09-14 Thread Javier González
Since read and erase paths offer different guarantees for inflight I/Os, separate the mempools to set the right min_nr for each on creation. Reported-by: Jens Axboe <ax...@kernel.dk> Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 12 -

[PATCH 4/5] lightnvm: pblk: do not use a mempool for line bitmaps

2017-09-14 Thread Javier González
, get rid of the mempool and simply allocate memory through kmalloc. Reported-by: Jens Axboe <ax...@kernel.dk> Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 26 ++ drivers/lightnvm/pblk-ini

[PATCH 0/5] lightnvm: pblk: audit mempool usage

2017-09-14 Thread Javier González
in early versions of pblk. [1] https://patchwork.kernel.org/patch/9940973/ Javier González (5): lightnvm: pblk: fix min size for page mempool lightnvm: pblk: simplify work_queue mempool lightnvm: pblk: decouple read/erase mempools lightnvm: pblk: do not use a mempool for line bitmaps lightnvm

[PATCH 1/5] lightnvm: pblk: fix min size for page mempool

2017-09-14 Thread Javier González
the maximum number of sectors supported by NVMe (as of the time for this patch). Instead, use the maximum number of allowed sectors reported by the device. Reported-by: Jens Axboe <ax...@kernel.dk> Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 6 +++

[PATCH 2/5] lightnvm: pblk: simplify work_queue mempool

2017-09-14 Thread Javier González
kmalloc. This allows us to have a much smaller mempool. Reported-by: Jens Axboe <ax...@kernel.dk> Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 13 +++-- drivers/lightnvm/pblk-gc.c| 32 drivers/l

[PATCH] lightnvm: pblk: ensure right bad block calculation

2017-09-15 Thread Javier González
Make sure that the variable controlling block threshold for allocating extra metadata sectors in case of a line with bad blocks does not get a negative value. Otherwise, the line will be marked as corrupted and wasted. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/li

[PATCH] lightnvm: pblk: guarantee line integrity on reads

2017-09-15 Thread Javier González
the existing line reference to decide when a line is eligible for being freed after the recycle process. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 56 ++ drivers/lightnvm/pblk-init.c | 14 +++-- drivers/lightnvm/pblk-

[PATCH] lightnvm: pblk: check lba sanity on read path

2017-09-15 Thread Javier González
is an extra copy on the DMA region on the device and an extra comparison in the host, given that (i) the OOB area is being read together with the data in the media, and (ii) the DMA region allocated for the ppa list can be reused for the metadata stored on the OOB area. Signed-off-by: Javier González

[PATCH] lightnvm: pblk: enable 1 LUN configuration

2017-09-15 Thread Javier González
tes in order to guarantee block sequentiality. Note that, since there is only one LUN, both I/Os will block each other by design. However, such configuration only pursues tight read latencies, not write bandwidth. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pb

[PATCH 04/11] lightnvm: pblk: simplify data validity check on GC

2017-09-15 Thread Javier González
the invalid bitmap accessible even when the line is being recycled. When recycled data is being remapped, it is enough to check the invalid bitmap for the line before updating the L2P table. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-cache.c | 20 +-- d

[PATCH 03/11] lightnvm: pblk: refactor read lba sanity check

2017-09-15 Thread Javier González
Refactor lba sanity check on read path to avoid code duplication. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-read.c | 29 ++--- 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/drivers/lightnvm/pblk-read.c b/d

[PATCH 02/11] lightnvm: pblk: normalize ppa namings

2017-09-15 Thread Javier González
Normalize the way we name ppa variables to improve code readability. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 48 +++- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/drivers/lightnv

[PATCH] lightnvm: pblk: remove I/O dependency on write path

2017-09-15 Thread Javier González
this dependency and guarantees forward progress at a per I/O granurality. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-write.c | 145 +++--- 1 file changed, 65 insertions(+), 80 deletions(-) diff --git a/drivers/lightnv

[PATCH] lightnvm: pblk: remove redundant check on read path

2017-09-15 Thread Javier González
A partial read I/O in pblk is an I/O where some sectors reside in the write buffer in main memory and some are persisted on the device. Such an I/O must at least contain 2 lbas, therefore checking for the case where a single lba is mapped is not necessary. Signed-off-by: Javier González <

[PATCH 09/11] lightnvm: pblk: improve naming for internal req.

2017-09-15 Thread Javier González
, create a new request type - internal write to improve code readability. In the process, create internal values for each I/O type instead of abusing the READ/WRITE macros, as suggested by Christoph. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c

[PATCH 06/11] lightnvm: pblk: put bio on bio completion

2017-09-15 Thread Javier González
Simplify put bio by doing it on bio end_io instead of manually putting it on the completion path. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 10 +++--- drivers/lightnvm/pblk-read.c | 1 - drivers/lightnvm/pblk-recovery.c | 1 - d

[PATCH 00/11] lightnvm: pblk: cleanup

2017-09-15 Thread Javier González
This patchset is a general cleanup to improve code readability. Javier González (11): lightnvm: pblk: use constant for GC max inflight lightnvm: pblk: normalize ppa namings lightnvm: pblk: refactor read lba sanity check lightnvm: pblk: simplify data validity check on GC lightnvm: pblk

[PATCH 01/11] lightnvm: pblk: use constant for GC max inflight

2017-09-15 Thread Javier González
Use a constant to set the maximum number of inflight GC requests allowed. Signed-off-by: Javier González <jav...@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-

[PATCH 05/11] lightnvm: pblk: refactor read path on GC

2017-09-15 Thread Javier González
Simplify the part of the garbage collector where data is read from the line being recycled and moved into an internal queue before being copied to the memory buffer. This allows to get rid of a dedicated function, which introduces an unnecessary dependency on the code. Signed-off-by: Javier

[PATCH 10/11] lightnvm: pblk: refactor rqd alloc/free

2017-09-15 Thread Javier González
Refactor the rqd allocation and free functions so that all I/O types can use these helper functions. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 40 ++-- drivers/lightnvm/pblk-read.c | 2 -- drivers/li

[PATCH 08/11] lightnvm: pblk: allocate bio size more accurately

2017-09-15 Thread Javier González
Wait until we know the exact number of ppas to be sent to the device, before allocating the bio. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-rb.c| 5 +++-- drivers/lightnvm/pblk-write.c | 20 ++-- drivers/lightnvm/pblk.h | 4 +

[PATCH 11/11] lightnvm: pblk: use rqd->end_io for completion

2017-09-15 Thread Javier González
For consistency with the rest of pblk, use rqd->end_io to point to the function taking care of ending the request on the completion path. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 7 --- drivers/lightnvm/pblk-read.c | 5 ++--- 2 files c

[PATCH 07/11] lightnvm: pblk: simplify path on REQ_PREFLUSH

2017-09-15 Thread Javier González
-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-cache.c | 4 +++- drivers/lightnvm/pblk-rb.c| 8 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/lightnvm/pblk-cache.c b/drivers/lightnvm/pblk-cache.c index 1d6b8e3585f1..0d227ef7d1b9

Re: [PATCH 3/6] lightnvm: pblk: fix message if L2P MAP is in device

2017-09-22 Thread Javier González
> On 21 Sep 2017, at 13.26, Rakesh Pandit wrote: > > This usually happens if we are developing with qemu and ll2pmode has > default value. Even in that case message seems wrong. > > Signed-off-by: Rakesh Pandit > --- > drivers/lightnvm/pblk-init.c | 2 +-

Re: [PATCH 1/6] lightnvm: pblk: reuse pblk_gc_should_kick

2017-09-22 Thread Javier González
> On 22 Sep 2017, at 11.42, Rakesh Pandit <rak...@tuxera.com> wrote: > > On Fri, Sep 22, 2017 at 10:40:57AM +0200, Javier González wrote: >>> On 21 Sep 2017, at 13.25, Rakesh Pandit wrote: >>> >>> This is a trivial change which reuses pblk_gc_sho

Re: [PATCH 3/6] lightnvm: pblk: fix message if L2P MAP is in device

2017-09-22 Thread Javier González
Sure. Matias: Can you fix this when picking it up? Javier > On 22 Sep 2017, at 11.44, Rakesh Pandit <rak...@tuxera.com> wrote: > > On Fri, Sep 22, 2017 at 10:52:19AM +0200, Javier González wrote: >>> On 21 Sep 2017, at 13.26, Rakesh Pandit <rak...@tuxera.com>

Re: [PATCH 4/6] lightnvm: pblk: improve error message if down_timeout fails

2017-09-22 Thread Javier González
pr_err("pblk: taking lun semaphore timed out: err %d\n", -ret); > } > > void pblk_down_page(struct pblk *pblk, struct ppa_addr *ppa_list, int nr_ppas) > -- > 2.5.0 Looks good. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 5/6] lightnvm: pblk: print incompatible line version correctly

2017-09-22 Thread Javier González
} > > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index eaf5397..87b1d7f 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -318,6 +318,7 @@ enum { > }; > > #define PBLK_MAGIC 0x70626c6b /*pblk*/ > +#define SMETA_VERSI

Re: [PATCH 1/6] lightnvm: pblk: reuse pblk_gc_should_kick

2017-09-22 Thread Javier González
> On 21 Sep 2017, at 13.25, Rakesh Pandit wrote: > > This is a trivial change which reuses pblk_gc_should_kick instead of > repeating it again in pblk_rl_free_lines_inc. > > Signed-off-by: Rakesh Pandit > --- > drivers/lightnvm/pblk-core.c | 1 + >

Re: [PATCH 2/6] lightnvm: pblk: protect line bitmap while submitting meta io

2017-09-22 Thread Javier González
itmap)); > + spin_lock(>lock); > } > > u64 __pblk_alloc_page(struct pblk *pblk, struct pblk_line *line, int nr_secs) > -- > 2.5.0 Looks good. The reason not to have locks here was that the caller is always on the write thread - who did the allocation -, since it is error handlin

Re: [PATCH V2] lightnvm: protect target type list with correct locks

2017-09-18 Thread Javier González
; info->tgtsize = tgt_iter; > - up_write(_lock); > + up_write(_tgtt_lock); > > if (copy_to_user(arg, info, sizeof(struct nvm_ioctl_info))) { > kfree(info); > -- > 2.7.4 LGTM. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH] lightnvm: remove already calculated nr_chnls

2017-09-18 Thread Javier González
dev_map = kmalloc(sizeof(struct nvm_dev_map), GFP_KERNEL); > -- > 2.7.4 We wanted to make sure that nr_chnls was really, really set :) Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH] lightnvm: pblk: fix error path in pblk_lines_alloc_metadata

2017-09-21 Thread Javier González
++) > + while (--i >= 0) > kfree(l_mg->sline_meta[i]); It is safe to use kfree on NULL pointers. No need to do this. You can either send a new patch, or we can change it when picking it up. > > return -ENOMEM; > -- > 2.5.0 Rest looks good. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

[PATCH 1/2] lightnvm: fail fast on passthrough commands

2017-10-06 Thread Javier González
Make LightNVM passhtrough commands fail fast. User space will then take care of re-submitting. Fixes: 84d4add793c6 ('lightnvm: add ioctls for vector I/Os') Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/nvme/host/lightnvm.c | 2 -- 1 file changed, 2 deletions(-) diff

Re: [PATCH] lightnvm: pblk: remove spinlock when freeing line metadata

2017-10-06 Thread Javier González
> On 6 Oct 2017, at 11.20, Andrey Ryabinin wrote: > > On 10/05/2017 11:35 AM, Hans Holmberg wrote: >> From: Hans Holmberg >> >> Lockdep complains about being in atomic context while freeing line >> metadata - and rightly so as we take a

[PATCH 2/2] lightnvm: implement generic path for sync I/O

2017-10-06 Thread Javier González
Implement a generic path for sending sync I/O on LightNVM. This allows to reuse the standard synchronous path trough blk_execute_rq(), instead of implementing a wait_for_completion on the target side (e.g., pblk). Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/

[PATCH 0/2] lightnvm: patches for 4.15 on core

2017-10-06 Thread Javier González
wait_for_completion() constructions to implement sync. I/O, both on pblk and at the subsystem level. One of the main issues - besides code replication - is that we could not benefit from improvements on blk_execute_rq to prevent hangs. This should fix it. Javier González (2): lightnvm: fail fast

Re: [PATCH 2/6] lightnvm: pblk: protect line bitmap while submitting meta io

2017-10-04 Thread Javier González
> On 21 Sep 2017, at 13.26, Rakesh Pandit wrote: > > It seems pblk_dealloc_page would race against pblk_alloc_pages for > line bitmap for sector allocation. The chances are very low but might > as well protect the bitmap properly. It's not even in fast path. > >

Re: [PATCH] linux/types.h: Restore the ability to disable sparse endianness checks

2017-10-16 Thread Javier González
> On 6 Oct 2017, at 19.43, Bart Van Assche wrote: > > On Fri, 2017-10-06 at 19:35 +0200, Christoph Hellwig wrote: >> On Fri, Oct 06, 2017 at 10:23:53AM -0700, Bart Van Assche wrote: >>> The purpose of patch "linux/types.h: enable endian checks for all >>> sparse builds"

[PATCH 1/2] lightnvm: pblk: cleanup unused and static functions

2017-10-06 Thread Javier González
Cleanup up unused and static functions across the whole codebase. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 133 --- drivers/lightnvm/pblk-gc.c | 40 ++--- drivers/lightnvm/pblk-rl.c

[PATCH 2/2] lightnvm: pblk: avoid being reported as hung on rated GC

2017-10-06 Thread Javier González
balancing the outstanding read GC I/Os to be reported as "hung", though the behavior is normal. Solve this by allowing to schedule when we detect that the read GC path is not moving forward. Signed-off-by: Javier González <jav...@cnexlabs.com> --- drivers/lightnvm/pblk-gc.c | 8

[PATCH 0/2] lightnvm: pblk fixes

2017-10-06 Thread Javier González
Two small patches extra for 4.15 The first one is a general cleanup. The second one is an easy fix to avoid being reported as a hung task when GC is rate-limited Javier González (2): lightnvm: pblk: cleanup unused and static functions lightnvm: pblk: avoid being reported as hung on rated GC

Re: [GIT PULL 02/58] lightnvm: prevent bd removal if busy

2017-10-13 Thread Javier González
> On 13 Oct 2017, at 17.35, Rakesh Pandit wrote: > >> On Fri, Oct 13, 2017 at 07:58:09AM -0700, Christoph Hellwig wrote: >>> On Fri, Oct 13, 2017 at 02:45:51PM +0200, Matias Bjørling wrote: >>> From: Rakesh Pandit >>> >>> When a virtual block device is

Re: [GIT PULL 02/58] lightnvm: prevent bd removal if busy

2017-10-14 Thread Javier González
> On 13 Oct 2017, at 17.58, Javier González <javigon.naps...@gmail.com> wrote: > > >>> On 13 Oct 2017, at 17.35, Rakesh Pandit <rak...@tuxera.com> wrote: >>> >>>> On Fri, Oct 13, 2017 at 07:58:09AM -0700, Christoph Hellwig wrote: >>>

Re: [PATCH 10/18] lightnvm: pblk: use bio_copy_kern when possible

2017-09-07 Thread Javier González
> On 7 Sep 2017, at 13.08, Christoph Hellwig <h...@infradead.org> wrote: > > On Wed, Sep 06, 2017 at 04:00:56PM +0200, Javier González wrote: >>> Nope. You want to loop over vmalloc_to_page and call bio_add_page >>> for each page, >> >> Yes. This

[PATCH] block: export symbol for bio_copy_kern

2017-09-06 Thread Javier González
Export symbol for bio_copy_kern so that we can use it in modules. Reported-by: Andiry Xu <t-jia...@microsoft.com> Signed-off-by: Javier González <jav...@cnexlabs.com> --- block/bio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/bio.c b/block/bio.c index 6745759028da..

[PATCH 14/18] lightnvm: pblk: simplify path on REQ_PREFLUSH

2017-09-06 Thread Javier González
-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-cache.c | 4 +++- drivers/lightnvm/pblk-rb.c| 8 +--- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/lightnvm/pblk-cache.c b/driv

[PATCH 08/18] lightnvm: pblk: check lba sanity on read path

2017-09-06 Thread Javier González
is an extra copy on the DMA region on the device and an extra comparison in the host, given that (i) the OOB area is being read together with the data in the media, and (ii) the DMA region allocated for the ppa list can be reused for the metadata stored on the OOB area. Signed-off-by: Javier González

[PATCH 13/18] lightnvm: pblk: fix write I/O sync stat

2017-09-06 Thread Javier González
Fix stat counter to collect the right number of I/Os being synced on the completion path. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[PATCH 07/18] lightnvm: pblk: use constant for GC parameter

2017-09-06 Thread Javier González
Use a constant instead of using meaningless tuning parameters on the garbage collector algorithms. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-gc.c | 4 ++-- drivers/lightnvm/pblk.h| 2 +- 2 f

[PATCH 12/18] lightnvm: pblk: free padded entries in write buffer

2017-09-06 Thread Javier González
pages. A consequence of this bad free was that internal bios not containing data (only a flush) were not being completed. Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target") Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <

[PATCH] lightnvm: Add error code for bad write pointer

2017-09-06 Thread Javier González
Add new error code introduced on the OCSSD spec 2.0 for write pointer mismatch on the device side. This indicates to the host that a write on a block (chunk) is not respecting the required sequentiality. Signed-off-by: Javier González <jav...@cnexlabs.com> --- include/linux/lightnvm.h | 3

[PATCH 09/18] lightnvm: pblk: simplify data validity check on GC

2017-09-06 Thread Javier González
the invalid bitmap accessible even when the line is being recycled. When recycled data is being remapped, it is enough to check the invalid bitmap for the line before updating the L2P table. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cne

[PATCH 11/18] lightnvm: pblk: refactor read path on GC

2017-09-06 Thread Javier González
Simplify the part of the garbage collector where data is read from the line being recycled and moved into an internal queue before being copied to the memory buffer. This allows to get rid of a dedicated function, which introduces an unnecessary dependency on the code. Signed-off-by: Javier

[PATCH 10/18] lightnvm: pblk: use bio_copy_kern when possible

2017-09-06 Thread Javier González
on the completion path, where mapped pages need to be freed. Instead, use bio_copy_kern, which does the same and at the same time simplifies the completion path. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/l

[PATCH 01/18] lightnvm: pblk: improve naming for internal req.

2017-09-06 Thread Javier González
, create a new request type - internal write. This improves code readability. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-recovery.c | 6 +++--- drivers/lightnvm/pblk-write.c| 6 +++--- drivers/lig

[PATCH 00/18] lightnvm: pblk patches for 4.14

2017-09-06 Thread Javier González
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): lig

[PATCH 06/18] lightnvm: pblk: use right flag for GC allocation

2017-09-06 Thread Javier González
uffer") Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-read.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-rea

[PATCH 02/18] lightnvm: pblk: refactor read lba sanity check

2017-09-06 Thread Javier González
Refactor lba sanity check on read path to avoid code duplication. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-read.c | 29 ++--- 1 file changed, 10 insertions(+), 19 deleti

[PATCH 05/18] lightnvm: pblk: initialize debug stat counter

2017-09-06 Thread Javier González
Initialize the stat counter for garbage collected reads. Fixes: a4bd217b43268 ("lightnvm: physical block device (pblk) target") Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c |

[PATCH 04/18] lightnvm: pblk: check for failed mempool alloc.

2017-09-06 Thread Javier González
Check for failed mempool allocations and act accordingly. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/lightnvm/pblk-core

[PATCH 03/18] lightnvm: pblk: normalize ppa namings

2017-09-06 Thread Javier González
Normalize the way we name ppa variables to improve code readability. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 48 +++- 1 file changed, 25 inser

[PATCH 15/18] lightnvm: pblk: avoid deadlock on low LUN config

2017-09-06 Thread Javier González
On low LUN configurations, make sure not to send bios that are bigger than the buffer size. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 2 +- drivers/lightnvm/pblk-rl.c | 6 ++ driv

[PATCH 17/18] lightnvm: pblk: guarantee line integrity on reads

2017-09-06 Thread Javier González
the existing line reference to decide when a line is eligible for being freed after the recycle process. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 55 ++--- drivers/l

[PATCH 16/18] lightnvm: pblk: enable 1 LUN configuration

2017-09-06 Thread Javier González
tes in order to guarantee block sequentiality. Note that, since there is only one LUN, both I/Os will block each other by design. However, such configuration only pursues tight read latencies, not write bandwidth. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjør

[PATCH 18/18] lightnvm: pblk: remove unnecessary check

2017-09-06 Thread Javier González
A partial read I/O in pblk is an I/O where some sectors reside in the write buffer in main memory and some are persisted on the device. Such an I/O must at least contain 2 lbas, therefore checking for the case where a single lba is mapped is not necessary. Signed-off-by: Javier González <

Re: [PATCH 10/18] lightnvm: pblk: use bio_copy_kern when possible

2017-09-06 Thread Javier González
> On 6 Sep 2017, at 15.47, Christoph Hellwig <h...@infradead.org> wrote: > > On Wed, Sep 06, 2017 at 12:51:03PM +0200, Javier González wrote: >> In pblk, buffers forming bios can be allocated on physically contiguous >> or virtually contiguous memory. For physi

Re: [PATCH 01/18] lightnvm: pblk: improve naming for internal req.

2017-09-06 Thread Javier González
> On 6 Sep 2017, at 15.46, Christoph Hellwig 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, >

[PATCH 6/6] lightnvm: pblk: avoid deadlock on low LUN config

2017-09-06 Thread Javier González
On low LUN configurations, make sure not to send bios that are bigger than the buffer size. Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target") Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> ---

[PATCH 2/6] lightnvm: pblk: initialize debug stat counter

2017-09-06 Thread Javier González
Initialize the stat counter for garbage collected reads. Fixes: a4bd217b43268 ("lightnvm: physical block device (pblk) target") Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c |

[PATCH 3/6] lightnvm: pblk: use right flag for GC allocation

2017-09-06 Thread Javier González
uffer") Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-read.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-rea

[PATCH 0/6] lightnvm: pblk bug fixes for 4.14

2017-09-06 Thread Javier González
Hi Jens, Here are the pblk bug fixes for this window. 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 (6): lightnvm: pblk: check for failed mempool alloc. lightnvm: pblk

[PATCH 4/6] lightnvm: pblk: free padded entries in write buffer

2017-09-06 Thread Javier González
pages. A consequence of this bad free was that internal bios not containing data (only a flush) were not being completed. Fixes: a4bd217b4326 ("lightnvm: physical block device (pblk) target") Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <

[PATCH 5/6] lightnvm: pblk: fix write I/O sync stat

2017-09-06 Thread Javier González
Fix stat counter to collect the right number of I/Os being synced on the completion path. Fixes: 0880a9aa2d91f ("lightnvm: pblk: delete redundant buffer pointer") Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> ---

Re: [PATCH 1/6] lightnvm: pblk: check for failed mempool alloc.

2017-09-06 Thread Javier González
> On 6 Sep 2017, at 17.09, Jens Axboe <ax...@kernel.dk> wrote: > > On 09/06/2017 09:08 AM, Johannes Thumshirn wrote: >> On Wed, Sep 06, 2017 at 05:01:01PM +0200, Javier González wrote: >>> Check for failed mempool allocations and act accordingly. >> >&g

Re: [PATCH 00/18] lightnvm: pblk patches for 4.14

2017-09-06 Thread Javier González
> On 6 Sep 2017, at 16.04, Jens Axboe <ax...@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 mid

Re: [PATCH] lightnvm: Add error code for bad write pointer

2017-09-06 Thread Javier González
> On 6 Sep 2017, at 15.44, Christoph Hellwig <h...@infradead.org> wrote: > > On Wed, Sep 06, 2017 at 12:22:38PM +0200, Javier González wrote: >> Add new error code introduced on the OCSSD spec 2.0 for write pointer >> mismatch on the device side. This indicat

[PATCH 1/6] lightnvm: pblk: check for failed mempool alloc.

2017-09-06 Thread Javier González
Check for failed mempool allocations and act accordingly. Signed-off-by: Javier González <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/lightnvm/pblk-core

Re: [PATCH 1/6] lightnvm: pblk: check for failed mempool alloc.

2017-09-06 Thread Javier González
> On 6 Sep 2017, at 17.13, Jens Axboe <ax...@kernel.dk> wrote: > > On 09/06/2017 09:12 AM, Javier González wrote: >>> On 6 Sep 2017, at 17.09, Jens Axboe <ax...@kernel.dk> wrote: >>> >>> On 09/06/2017 09:08 AM, Johannes Thumshirn wrote: >&

Re: [PATCH 1/6] lightnvm: pblk: check for failed mempool alloc.

2017-09-06 Thread Javier González
> On 6 Sep 2017, at 17.20, Jens Axboe <ax...@kernel.dk> wrote: > > On 09/06/2017 09:13 AM, Jens Axboe wrote: >> On 09/06/2017 09:12 AM, Javier González wrote: >>>> On 6 Sep 2017, at 17.09, Jens Axboe <ax...@kernel.dk> wrote: >>>> &g

Re: [PATCH V2] lightnvm: prevent bd removal if busy

2017-09-12 Thread Javier González
t;nvm: removal failed, block device busy\n"); > + bdput(bdev); > + mutex_unlock(>mlock); > + return -EBUSY; > + } > + bdput(bdev); > __nvm_remove_target(t); > mutex_unlock(>mlock); > > -- > 2.7.4 Looks good. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 1/6] lightnvm: pblk: remove useless line

2017-10-02 Thread Javier González
We need to consider bad >* blocks to make sure that there are enough sectors to store emeta >*/ > - bit = lm->sec_per_line; > off = lm->sec_per_line - lm->emeta_sec[0]; > bitmap_set(line->invalid_bitmap, off, lm->emeta_sec[0]); >

Re: [PATCH 3/6] lightnvm: remove unused argument from nvm_set_tgt_bb_tbl

2017-10-02 Thread Javier González
ev *, u64, u32, nvm_l2p_update_fn > *, > void *); > -- > 2.7.4 This was used when using MLC media as SLC back in the days, when we had the host media manager (spec 1.2). We probably want to have a path to use NAND as SLC, but I agree that it should be separated in order to reduce the number of checks (considering that this is for a very specific purpose). Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH] lightnvm: pblk: fix changing GC group list for a line

2017-10-02 Thread Javier González
> On 2 Oct 2017, at 13.43, Rakesh Pandit <rak...@tuxera.com> wrote: > > On Mon, Oct 02, 2017 at 01:27:42PM +0200, Javier González wrote: >>> On 28 Sep 2017, at 16.40, Rakesh Pandit <rak...@tuxera.com> wrote: >>> >>> pblk_line_gc_list s

Re: [PATCH 2/6] lightnvm: pblk: reduce arguments in __pblk_rb_update_l2p

2017-10-02 Thread Javier González
sync_l2p(struct pblk_rb *rb) > sync = smp_load_acquire(>sync); > > to_update = pblk_rb_ring_count(sync, rb->l2p_update, rb->nr_entries); > - __pblk_rb_update_l2p(rb, >l2p_update, to_update); > + __pblk_rb_update_l2p(rb, to_update); > >

Re: [PATCH 4/6] lightnvm: remove stable extern and unused exported symbols

2017-10-02 Thread Javier González
t; extern int nvm_max_phys_sects(struct nvm_tgt_dev *); > extern int nvm_submit_io(struct nvm_tgt_dev *, struct nvm_rq *); > extern int nvm_erase_sync(struct nvm_tgt_dev *, struct ppa_addr *, int); > -extern int nvm_set_rqd_ppalist(struct nvm_tgt_dev *, struct nvm_rq *, > -

Re: [PATCH] lightnvm: pblk: fix changing GC group list for a line

2017-10-02 Thread Javier González
> On 28 Sep 2017, at 16.40, Rakesh Pandit wrote: > > pblk_line_gc_list seems to had a bug since the introduction of pblk in > getting GC list for a line. In b20ba1bc7 while redesigning GC > algorithm it was not fixed correctly. The problem is that even if > valid sector

Re: [PATCH 5/6] lightnvm: pblk: free up mempool allocation for erases correctly

2017-10-02 Thread Javier González
> On 1 Oct 2017, at 15.25, Rakesh Pandit wrote: > > While separating read and erase mempools in 22da65a1b pblk_g_rq_cache > was used two times to set aside memory both for erase and read > requests. Because same kmem cache is used repeatedly a single call to >

Re: [PATCH 6/6] lightnvm: pblk: fix releases of kmem cache in error path

2017-10-02 Thread Javier González
> On 1 Oct 2017, at 15.26, Rakesh Pandit wrote: > > If pblk_core_init fails lets destroy all global caches. > > Signed-off-by: Rakesh Pandit > --- > drivers/lightnvm/pblk-init.c | 8 +++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git

Re: [PATCH 2/6] lightnvm: pblk: reduce arguments in __pblk_rb_update_l2p

2017-10-02 Thread Javier González
> On 2 Oct 2017, at 13.32, Javier González <j...@lightnvm.io> wrote: > >> On 1 Oct 2017, at 15.23, Rakesh Pandit <rak...@tuxera.com> wrote: >> >> We already pass the structure pointer so no need to pass the member. >> >> Signed-off-by: Rak

Re: [PATCH 1/9] lightnvm: pblk: prevent gc kicks when gc is not operational

2017-10-03 Thread Javier González
--- a/drivers/lightnvm/pblk-init.c > +++ b/drivers/lightnvm/pblk-init.c > @@ -928,6 +928,7 @@ static void *pblk_init(struct nvm_tgt_dev *dev, struct > gendisk *tdisk, > pblk->dev = dev; > pblk->disk = tdisk; > pblk->state = PBLK_STATE_RUNNING; > + pblk->gc.gc_enabled = 0; > > spin_lock_init(>trans_lock); > spin_lock_init(>lock); > -- > 2.7.4 LGTM. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 8/9] lightnvm: pblk: gc all lines in the pipeline before exit

2017-10-03 Thread Javier González
c.read_inflight_gc)); > > sz += snprintf(page + sz, PAGE_SIZE - sz, > "data (%d) cur:%d, left:%d, vsc:%d, s:%d, map:%d/%d (%d)\n", > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index f76583b..03965da 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -238,7 +238,10 @@ struct pblk_gc { > struct timer_list gc_timer; > > struct semaphore gc_sem; > - atomic_t inflight_gc; > + atomic_t read_inflight_gc; /* Number of lines with inflight GC reads */ > + atomic_t pipeline_gc; /* Number of lines in the GC pipeline - > + * started reads to finished writes > + */ > int w_entries; > > struct list_head w_list; > -- > 2.7.4 LGTM. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 6/9] lightnvm: pblk: shut down gc gracefully during exit

2017-10-03 Thread Javier González
ader_wq) > destroy_workqueue(gc->gc_line_reader_wq); > > if (gc->gc_writer_ts) > kthread_stop(gc->gc_writer_ts); > - > - if (gc->gc_reader_ts) > - kthread_stop(gc->gc_reader_ts); > } > -- > 2.7.4 LGTM. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 5/9] lightnvm: pblk: consider bad sectors in emeta during recovery

2017-10-03 Thread Javier González
n the line bb */ > - off = lm->sec_per_line - lm->emeta_sec[0]; > - nr_bb = bitmap_weight(line->blk_bitmap, lm->blk_per_line); > - off -= nr_bb * geo->sec_per_pl; > > - line->emeta_ssec = off; > + line->emeta_ssec = pblk_line_emeta_start(pblk, line); > line->emeta = emeta; > memset(line->emeta->buf, 0, lm->emeta_len[0]); > > -- > 2.7.4 Apart from the commit message, it looks good. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 7/9] lightnvm: pblk: add l2p crc debug printouts

2017-10-03 Thread Javier González
l_lines(pblk); > > @@ -898,6 +922,11 @@ static void pblk_exit(void *private) > down_write(_lock); > pblk_gc_exit(pblk); > pblk_tear_down(pblk); > + > +#ifdef CONFIG_NVM_DEBUG > + pr_info("pblk exit: L2P CRC: %x\n", pblk_l2p_crc(pblk)); > +#endif > + > pblk_free(pblk); > up_write(_lock); > } > -- > 2.7.4 LGTM. Reviewed-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

Re: [PATCH 9/9] lightnvm: pblk: correct valid lba count calculation

2017-10-03 Thread Javier González
gt; + if (lba_list[paddr] != addr_empty) > + line->nr_valid_lbas++; > } else { > - __le64 addr_empty = cpu_to_le64(ADDR_EMPTY); > - > lba_list[paddr] = meta_list[i].lba = addr_empty; >

Re: [PATCH 0/9] recovery robustness improvements

2017-10-03 Thread Javier González
> On 3 Oct 2017, at 12.05, Hans Holmberg wrote: > > From: Hans Holmberg > > This patchset improves the robustness of recovery - fixing a bunch of > issues that occurs when removing and re-creating a pblk instance. > It also adds a

<    1   2   3   4   5   6   7   8   9   10   >