[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/l

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/core.c | 8

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/nvme/host/lightnvm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)

[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 <jav...@cnexlabs.com> Sign

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com>

[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 <jav...@cnexlabs.com> Signed-off-by:

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 7 --- drivers/lightnvm/pblk-init.c | 39 ++- drivers/lightnvm/pblk-

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk

[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 <jav...@cnexlabs.com> Sign

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- driv

[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 <jav...@cnexlabs.com> Sign

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- 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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-map.c | 5 +++-- drivers/lightnvm/pblk-recovery.c | 4 ++-- 2 files changed, 5 insertions(+),

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com>

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-core.c | 1 - drivers/lightnvm/pblk-write.c | 6 -- 2 files changed, 7 deletions(-) diff --git a/driv

[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 <jav...@cnexlabs.com> Signed-off-by: Matias Bjørling <mat...@cnexlabs.com> --- drivers/lightnvm/pblk-init.c | 1 + drivers/lightnvm/pblk-read.c | 6 ++ drivers/lightnvm/pblk

[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 <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.c b/drivers/l

[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

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 <ax...@kernel.dk> 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

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

2017-05-02 Thread Javier González
truct bio *bio); > 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 <jav...@cnexlabs.com> Tested-by: Javier González <jav...@cnexlabs.com> signature.asc Description: Message signed with OpenPGP

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 <ax...@kernel.dk> 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 be

Re: Large latency on blk_queue_enter

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

Re: Large latency on blk_queue_enter

2017-05-08 Thread Javier González
> On 8 May 2017, at 18.06, Jens Axboe <ax...@kernel.dk> wrote: > > On 05/08/2017 09:49 AM, Javier González wrote: >>> On 8 May 2017, at 17.40, Jens Axboe <ax...@kernel.dk> wrote: >>> >>> On 05/08/2017 09:38 AM, Javier González wrote: >>&g

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

[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 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 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 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 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 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] 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: 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: 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: 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 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 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 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] 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 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

[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 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 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

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] 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

Circular locking dependency with pblk

2017-10-05 Thread Javier González
Hi, lockdep is reporting a circular dependency when using XFS and pblk, which I am a bit confused about. This happens when XFS sends a number of nested reads and (at least) one of them hits partially pblk's cache. In this case, pblk will retrieve the cached lbas and form a new bio, which is

[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] 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/

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: Circular locking dependency with pblk

2017-10-05 Thread Javier González
> On 5 Oct 2017, at 18.24, Jens Axboe <ax...@kernel.dk> wrote: > > On 10/05/2017 04:53 AM, Javier González wrote: >> Hi, >> >> lockdep is reporting a circular dependency when using XFS and pblk, >> which I am a bit confused about. >> >> T

Re: Circular locking dependency with pblk

2017-10-06 Thread Javier González
> On 6 Oct 2017, at 01.36, Dave Chinner <da...@fromorbit.com> wrote: > > On Thu, Oct 05, 2017 at 12:53:50PM +0200, Javier González wrote: >> Hi, >> >> lockdep is reporting a circular dependency when using XFS and pblk, >> which I am a bit confused ab

Why removing REQ_FAILFAST_DRIVER in LightNVM?

2017-10-06 Thread Javier González
Hi Christoph, I'm cleaning up lightnvm.c to use as much as possible the nvme helpers. I see that in Commit: d49187e97e94 "nvme: introduce struct nvme_request" you introduced: rq->cmd_flags &= ~REQ_FAILFAST_DRIVER on the lightnvm I/O path and that has propagated through the code as we added

[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: Why removing REQ_FAILFAST_DRIVER in LightNVM?

2017-10-06 Thread Javier González
> On 6 Oct 2017, at 13.59, Christoph Hellwig <h...@infradead.org> wrote: > > On Fri, Oct 06, 2017 at 11:19:09AM +0200, Javier González wrote: >> on the lightnvm I/O path and that has propagated through the code as we >> added more functionality. Can you explain why thi

Re: Why removing REQ_FAILFAST_DRIVER in LightNVM?

2017-10-06 Thread Javier González
> On 6 Oct 2017, at 14.06, Christoph Hellwig <h...@infradead.org> wrote: > > On Fri, Oct 06, 2017 at 02:01:46PM +0200, Javier González wrote: >> I think it is good to fail fast as any other nvme I/O command and then >> recover in pblk if necessary. > > Note

Re: Why removing REQ_FAILFAST_DRIVER in LightNVM?

2017-10-06 Thread Javier González
> On 6 Oct 2017, at 14.08, Javier González <j...@lightnvm.io> wrote: > >> On 6 Oct 2017, at 14.06, Christoph Hellwig <h...@infradead.org> wrote: >> >> On Fri, Oct 06, 2017 at 02:01:46PM +0200, Javier González wrote: >>> I think it is go

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 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 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 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 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] 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 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 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 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 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 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 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 |

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] 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

[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> ---

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

[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 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: 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

<    1   2   3   4   >