Re: [PATCH] lightnvm: consider max hw sectors supported for max_write_pgs

2018-10-05 Thread Javier González
x_write_pgs, > + queue_max_hw_sectors(bqueue) / (geo->csecs >> 9)); > pblk_set_sec_per_write(pblk, pblk->min_write_pgs); > > pblk->pad_dist = kcalloc(pblk->min_write_pgs - 1, sizeof(atomic64_t), > -- > 1.9.1 Besides the comment above, it looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 2/4] introduce four macros for in-kernel hints

2019-01-23 Thread Javier González
> On 9 Jan 2019, at 16.30, Kanchan Joshi wrote: > > Exiting write-hints are exposed to user-mode. There is a possiblity > of conflict if kernel happens to use those. This patch introduces four > write-hints for exclusive kernel-mode use. > > Signed-off-by: Kanchan Joshi > --- > include/linux/f

Re: [PATCH v2 0/4] Write-hint for FS journal

2019-01-23 Thread Javier González
> On 9 Jan 2019, at 16.30, Kanchan Joshi wrote: > > Towards supporing write-hints/streams for filesystem journal. > > Here is the v1 patch for background - > https://marc.info/?l=linux-fsdevel&m=15637519020&w=2 > > Changes since v1: > - introduce four more hints for in-kernel use, as recom

Re: [PATCH] lightnvm: pblk: ignore bad block wp for pblk_line_wp_is_unbalanced

2019-01-24 Thread Javier González
> On 24 Jan 2019, at 01.55, Zhoujie Wu wrote: > > The write pointer of the bad block could be 0 or undefined, ignore > the checking of the bad block wp for pblk_line_wp_is_unbalanced to > avoid fake warning. > > Signed-off-by: Zhoujie Wu > --- > drivers/lightnvm/pblk-recovery.c | 12 +--

Re: [PATCH 2/4] introduce four macros for in-kernel hints

2019-01-24 Thread Javier González
> On 24 Jan 2019, at 09.35, Jan Kara wrote: > > On Wed 23-01-19 19:27:12, Javier González wrote: >>> On 9 Jan 2019, at 16.30, Kanchan Joshi wrote: >>> >>> Exiting write-hints are exposed to user-mode. There is a possiblity >>> of conflict if kerne

Re: [PATCH v1] : Switch to use new generic UUID API

2019-01-24 Thread Javier González
> On 24 Jan 2019, at 13.16, Andy Shevchenko > wrote: > > On Mon, Jan 21, 2019 at 09:47:32AM +0100, Christoph Hellwig wrote: >> On Thu, Jan 10, 2019 at 04:30:51PM +0200, Andy Shevchenko wrote: >>> There are new types and helpers that are supposed to be used in new code. >>> >>> As a preparation

Re: [PATCH] lightnvm: pblk: stop taking the free lock in in pblk_lines_free

2019-01-24 Thread Javier González
pblk_line_mg_free(pblk); > > -- > 2.17.1 Can you add a comment too indicating that this is only safe on a single threaded shutdown? Otherwise the patch looks good. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH v1] : Switch to use new generic UUID API

2019-01-24 Thread Javier González
> On 24 Jan 2019, at 14.36, Andy Shevchenko wrote: > > On Thu, Jan 24, 2019 at 3:19 PM Javier González wrote: >>> On 24 Jan 2019, at 13.16, Andy Shevchenko >>> wrote: >>> On Mon, Jan 21, 2019 at 09:47:32AM +0100, Christoph Hellwig wrote: >>>>

Re: [PATCH v1] : Switch to use new generic UUID API

2019-01-24 Thread Javier González
> On 24 Jan 2019, at 15.13, Andy Shevchenko wrote: > > On Thu, Jan 24, 2019 at 3:45 PM Javier González wrote: >>> On 24 Jan 2019, at 14.36, Andy Shevchenko wrote: >>> On Thu, Jan 24, 2019 at 3:19 PM Javier González wrote: >>>>> On 24 Jan 201

Re: [PATCH v1] lightnvm: Use u64 instead of __le64 for CPU visible side

2019-01-24 Thread Javier González
ad context */ > -- > 2.20.1 Looks good to me. At some point these mapped directly to the metadata stored in the device and the type remained when we change it. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH v2] lightnvm: pblk: Switch to use new generic UUID API

2019-01-24 Thread Javier González
1360,14 +1360,6 @@ static inline unsigned int pblk_get_secs(struct bio > *bio) > return bio->bi_iter.bi_size / PBLK_EXPOSED_PAGE_SIZE; > } > > -static inline void pblk_setup_uuid(struct pblk *pblk) > -{ > - uuid_le uuid; > - > - uuid_le_gen(&uuid); > - memcpy(pblk->instance_uuid, uuid.b, 16); > -} > - > static inline char *pblk_disk_name(struct pblk *pblk) > { > struct gendisk *disk = pblk->disk; > -- > 2.20.1 Looks good to me. Thanks Andy. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH v1] : Switch to use new generic UUID API

2019-01-24 Thread Javier González
> On 24 Jan 2019, at 17.38, Andy Shevchenko wrote: > > On Thu, Jan 24, 2019 at 4:36 PM Javier González wrote: > >> It is not pushed anywhere yet, but I have been working on a tool to make >> a pblk recovery tool to enable FTL repairs if something fails in the >>

Re: [PATCH] lightnvm: pblk: stop taking the free lock in in pblk_lines_free

2019-01-25 Thread Javier González
> On 25 Jan 2019, at 10.15, Hans Holmberg > wrote: > > On Thu, Jan 24, 2019 at 2:19 PM Javier González wrote: >>> On 22 Jan 2019, at 11.15, h...@owltronix.com wrote: >>> >>> From: Hans Holmberg >>> >>> pblk_line_meta_free might sl

Re: [PATCH v3] lightnvm: pblk: ignore bad block wp for pblk_line_wp_is_unbalanced

2019-01-25 Thread Javier González
> On 25 Jan 2019, at 09.47, Hans Holmberg > wrote: > > On Thu, Jan 24, 2019 at 8:51 PM Zhoujie Wu wrote: >> The write pointer of the bad block could be 0 or undefined, ignore >> the checking of the bad block wp for pblk_line_wp_is_unbalanced to >> avoid fake warning. > > fake -> spurious? >

[PATCH] lightnvm: pblk: prevent stall due to wb threshold

2019-01-25 Thread Javier González
16fc ("lightnvm: pblk: guarantee that backpointer is respected on writer stall") Signed-off-by: Javier González --- drivers/lightnvm/pblk-rb.c | 25 +++-- drivers/lightnvm/pblk-rl.c | 5 ++--- drivers/lightnvm/pblk.h| 2 +- 3 files changed, 22 insertions(+), 10

Re: [PATCH v3] lightnvm: pblk: ignore bad block wp for pblk_line_wp_is_unbalanced

2019-01-25 Thread Javier González
> On 25 Jan 2019, at 13.59, Hans Holmberg > wrote: > > On Fri, Jan 25, 2019 at 10:41 AM Javier González wrote: >>> On 25 Jan 2019, at 09.47, Hans Holmberg >>> wrote: >>> >>> On Thu, Jan 24, 2019 at 8:51 PM Zhoujie Wu wrote: >>>>

Re: [PATCH v3] lightnvm: pblk: ignore bad block wp for pblk_line_wp_is_unbalanced

2019-01-25 Thread Javier González
> On 25 Jan 2019, at 17.46, Hans Holmberg > wrote: > >> On Fri, Jan 25, 2019 at 3:35 PM Matias Bjørling wrote: >> >>> On 1/25/19 3:21 PM, Hans Holmberg wrote: >>>> On Fri, Jan 25, 2019 at 2:33 PM Javier González wrote: >>>>

Re: [PATCH v3] lightnvm: pblk: ignore bad block wp for pblk_line_wp_is_unbalanced

2019-01-25 Thread Javier González
> On 25 Jan 2019, at 21.20, Hans Holmberg > wrote: > >> On Fri, Jan 25, 2019 at 7:33 PM Javier González wrote: >> >> >> >>>> On 25 Jan 2019, at 17.46, Hans Holmberg >>>> wrote: >>>> >>>>> On Fri, Ja

Re: [PATCH] lightnvm: pblk: fix race condition on GC

2019-01-29 Thread Javier González
> On 27 Jan 2019, at 07.54, Heiner Litz wrote: > > This patch fixes a race condition where a write is mapped to the last > sectors of a line. The write is synced to the device but the L2P is not > updated yet. When the line is garbage collected before the L2P update is > performed, the sectors ar

Re: [LSF/MM TOPIC] Zoned Block Devices

2019-01-29 Thread Javier González
> On 28 Jan 2019, at 13.56, Matias Bjorling wrote: > > Hi, > > Damien and I would like to propose a couple of topics centering around > zoned block devices: > > 1) Zoned block devices require that writes to a zone are sequential. If > the writes are dispatched to the device out of order, the dr

Re: [PATCH] lightnvm: pblk: prevent stall due to wb threshold

2019-01-29 Thread Javier González
> On 29 Jan 2019, at 11.15, Hans Holmberg > wrote: > > On Fri, Jan 25, 2019 at 2:08 PM Matias Bjørling wrote: >> On 1/25/19 11:09 AM, Javier González wrote: >>> In order to respect mw_cuinits, pblk's write buffer maintains a >>> backpointer to protec

Re: [PATCH] lightnvm: pblk: extend line wp balance check

2019-01-29 Thread Javier González
> On 29 Jan 2019, at 09.47, h...@owltronix.com wrote: > > From: Hans Holmberg > > pblk stripes writes of minimal write size across all non-offline chunks > in a line, which means that the maximum write pointer delta should not > exceed the minimal write size. Extend the line write pointer balan

Re: [PATCH] lightnvm: pblk: extend line wp balance check

2019-01-29 Thread Javier González
> On 29 Jan 2019, at 13.49, Hans Holmberg wrote: > > On Tue, Jan 29, 2019 at 12:19 PM Javier González wrote: >>> On 29 Jan 2019, at 09.47, h...@owltronix.com wrote: >>> >>> From: Hans Holmberg >>> >>> pblk stripes writes of minimal

Re: [PATCH] lightnvm: pblk: extend line wp balance check

2019-01-29 Thread Javier González
> On 29 Jan 2019, at 16.49, Hans Holmberg wrote: > > On Tue, Jan 29, 2019 at 4:03 PM Javier González wrote: >>> On 29 Jan 2019, at 13.49, Hans Holmberg wrote: >>> >>> On Tue, Jan 29, 2019 at 12:19 PM Javier González wrote: >>>>>

Re: [PATCH] lightnvm: pblk: fix race condition on GC

2019-01-29 Thread Javier González
> On 29 Jan 2019, at 17.36, Heiner Litz wrote: > > Javier, > > On Tue, Jan 29, 2019 at 12:13 AM Javier González wrote: > > On 27 Jan 2019, at 07.54, Heiner Litz wrote: > > > > This patch fixes a race condition where a write is mapped to the last > > se

Re: [PATCH] lightnvm: pblk: fix bio leak on large sized io

2019-01-29 Thread Javier González
gt; bio_io_error(bio); > break; > -- > 2.7.4 Thanks for the fix Chansol. Matias: I see that checkpatch complains about the signed-ff, but it seems to be due to the name mismatch english / korean - not sure if there is a good fix for this. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH V2] lightnvm: pblk: extend line wp balance check

2019-01-30 Thread Javier González
ind_next_zero_bit(line->blk_bitmap, blk_in_line, i + 1); > } > > return 0; > @@ -356,7 +376,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct > pblk_line *line, > int ret; > u64 left_ppas = pblk_sec_in_open_line(pblk, line) - lm->smeta_sec; > > - if (pblk_line_wp_is_unbalanced(pblk, line)) > + if (pblk_line_wps_are_unbalanced(pblk, line)) > pblk_warn(pblk, "recovering unbalanced line (%d)\n", line->id); > > ppa_list = p.ppa_list; > -- > 2.17.1 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

[PATCH V2] lightnvm: pblk: prevent stall due to wb threshold

2019-01-30 Thread Javier González
16fc ("lightnvm: pblk: guarantee that backpointer is respected on writer stall") Signed-off-by: Javier González --- Changes since V1: - Fix a bad arithmetinc on the rate-limiter max_io calculation (from Hans) drivers/lightnvm/pblk-rb.c | 25 +++-- driver

Re: [PATCH] lightnvm: pblk: fix bio leak on large sized io

2019-01-30 Thread Javier González
> On 30 Jan 2019, at 15.06, Matias Bjørling wrote: > > On 1/30/19 2:53 AM, 김찬솔 wrote: >> Changes: >> 1. Function pblk_rw_io to get bio* as a reference >> 2. In pblk_rw_io bio_put call on read case removed >> A fix to address issue where >> 1. pblk_make_rq calls pblk_rw_io passes bio* pointer

Re: [PATCH V2] lightnvm: pblk: prevent stall due to wb threshold

2019-01-31 Thread Javier González
count=1 > 1+0 records in > 1+0 records out > 262144 bytes (262 kB, 256 KiB) copied, 0.000718515 s, 365 MB/s > # dd if=/dev/zero of=/dev/pblk0 oflag=direct bs=512k count=1 > > > >> On Wed, Jan 30, 2019 at 11:28 AM Javier González wrote: >> >> In order to respe

Re: [PATCH V2] lightnvm: pblk: prevent stall due to wb threshold

2019-02-04 Thread Javier González
> On 31 Jan 2019, at 21.10, Hans Holmberg wrote: > > On Thu, Jan 31, 2019 at 5:33 PM Javier González wrote: >>> On 31 Jan 2019, at 11.41, Hans Holmberg wrote: >>> >>> Hi Javier! >>> >>> How did you test this? I'm trying to add a tes

Re: [PATCH V2] lightnvm: pblk: fix race condition on GC

2019-02-04 Thread Javier González
->ref, pblk_line_put); > } > spin_unlock(&pblk->trans_lock); > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index a6386d5acd73..ac3ab778e976 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -487,6 +487,7 @@ struct pblk_line { > __le32 *vsc;/* Valid sector count in line */ > > struct kref ref;/* Write buffer L2P references */ > + atomic_t sec_to_update; /* Outstanding L2P updates to ppa */ > > struct pblk_w_err_gc *w_err_gc; /* Write error gc recovery metadata */ > > -- > 2.17.1 Looks good to me. Again, good marathon-catch! :) Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

[PATCH V3] lightnvm: pblk: prevent stall due to wb threshold

2019-02-04 Thread Javier González
16fc ("lightnvm: pblk: guarantee that backpointer is respected on writer stall") Signed-off-by: Javier González --- Changes since V1: - Fix a bad arithmetinc on the rate-limiter max_io calculation (from Hans) Changes since V2: - Address case where mw_cunits = 0 in the ne

Re: [PATCH] lightnvm: pblk: fix bio leak on large sized io

2019-02-05 Thread Javier González
> On 5 Feb 2019, at 10.23, Matias Bjørling wrote: > > On 2/1/19 9:22 AM, Chansol Kim wrote: >> On 01/31/19 22:14 PM, Matias Bjørling wrote: >>> On 1/30/19 2:53 AM, 김찬솔 wrote: Changes: 1. Function pblk_rw_io to get bio* as a reference 2. In pblk_rw_io bio_put call on read case

Re: [LSF/MM TOPIC] BPF for Block Devices

2019-02-07 Thread Javier González
+ Mailing lists > On 7 Feb 2019, at 18.48, Javier González wrote: > > > >> On 7 Feb 2019, at 18.12, Stephen Bates wrote: >> >> Hi All >> >>> A BPF track will join the annual LSF/MM Summit this year! Please read the >>> updated descri

Re: [PATCH 02/13] lightnvm: pblk: Gracefully handle GC data malloc fail

2019-02-28 Thread Javier González
> gc_rq_ws = kmalloc(sizeof(struct pblk_line_ws), GFP_KERNEL); > if (!gc_rq_ws) > - goto fail_free_gc_rq; > + goto fail_free_gc_data; > > gc_rq_ws->pblk = pblk; > gc_rq_ws->line = line; > @@ -281,6 +278,8 @@ static void pblk_gc_line_prepare_ws(struct work_struct > *work) > > return; > > +fail_free_gc_data: > + vfree(gc_rq->data); > fail_free_gc_rq: > kfree(gc_rq); > fail_free_lba_list: > -- > 2.17.1 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 00/13] lightnvm: bugfixes and improvements

2019-02-28 Thread Javier González
> On 28 Feb 2019, at 11.36, Matias Bjørling wrote: > > On 2/27/19 6:14 PM, Igor Konopko wrote: >> This series provides a group of the bugfixes >> or improvements for lightnvm and pblk device. >> Most of the patches are rather simple and covers >> some corner cases scenario, but we were able to hi

Re: [PATCH 01/13] lightnvm: pblk: Line reference fix in GC

2019-03-03 Thread Javier González
ight_gc); > > pblk_err(pblk, "failed to GC line %d\n", line->id); > -- > 2.17.1 Looks good to me Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 03/13] lightnvm: pblk: Fix put line back behaviour

2019-03-03 Thread Javier González
> } > > static void pblk_gc_line_ws(struct work_struct *work) > -- > 2.17.1 This comes back from the time where GC was single threaded - I left out this when reimplementing the locking. Good catch. Please, add a fixes tag for this to be back ported. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 04/13] lightnvm: pblk: Rollback in gc read

2019-03-03 Thread Javier González
spin_lock(&gc->r_lock); > + list_add_tail(&line->list, &gc->r_list); > + spin_unlock(&gc->r_lock); > + } > > return 0; > } > -- > 2.17.1 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 05/13] lightnvm: pblk: Count all read errors in stats

2019-03-03 Thread Javier González
his on SMART yet, let’s add this now (I assume that you are using it for something?) and we can separate the error stats in the future. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 06/13] lightnvm: pblk: Ensure that erase is chunk aligned

2019-03-03 Thread Javier González
se_ppa = pblk->luns[bit].bppa; /* set ch and lun */ > erase_ppa->a.blk = e_line->id; > + erase_ppa->a.reserved = 0; > } > > return 0; > -- > 2.17.1 I’m fine with adding this, but note that there is actually no requirement for the erase to be chunk aligned - the only bits that should be looked at are group, PU and chunk. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 07/13] lightnvm: pblk: Cleanly fail when there is not enough memory

2019-03-03 Thread Javier González
gt; > pblk_ppa_set_empty(&ppa); > > -- > 2.17.1 Is there any extra consideration we should take when enabling high memory for the L2P table? If not, looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 08/13] lightnvm: pblk: Set proper read stutus in bio

2019-03-04 Thread Javier González
> On 27 Feb 2019, at 18.14, Igor Konopko wrote: > > Currently in case of read errors, bi_status is not > set properly which leads to returning inproper data > to higher layer. This patch fix that by setting proper > status in case of read errors > > Patch also removes unnecessary warn_once(), wh

Re: [PATCH 09/13] lightnvm: pblk: Kick writer for flush requests

2019-03-04 Thread Javier González
> On 27 Feb 2019, at 18.14, Igor Konopko wrote: > > In case when there is no enough sector available in rwb > and there is flush request send we should kick write thread > which is not a case in current implementation. This patch > fixes that issue. > > Signed-off-by: Igor Konopko > --- > driv

Re: [PATCH 10/13] lightnvm: pblk: Reduce L2P DRAM footprint

2019-03-04 Thread Javier González
l.nr_secs) > + if (lba == ADDR_EMPTY || lba >= pblk->capacity) > continue; > > line->nr_valid_lbas++; > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index a6386d5acd73..a92377530930 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -305,7 +305,6 @@ struct pblk_rl { > > struct timer_list u_timer; > > - unsigned long long nr_secs; > unsigned long total_blocks; > > atomic_t free_blocks; /* Total number of free blocks (+ OP) */ > -- > 2.17.1 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 11/13] lightnvm: pblk: Remove unused smeta_ssec field

2019-03-04 Thread Javier González
ta starts */ > u64 emeta_ssec; /* Sector where emeta starts */ > > unsigned int sec_in_line; /* Number of usable secs in line */ > -- > 2.17.1 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 12/13] lightnvm: pblk: close opened chunks

2019-03-04 Thread Javier González
> On 27 Feb 2019, at 18.14, Igor Konopko wrote: > > When we creating pblk instance with factory > flag, there is a possibility that some chunks > are in open state, which does not allow to > issue erase request to them directly. Such a > chunk should be filled with some empty data in > order to a

Re: [PATCH 13/13] lightnvm: Inherit mdts from the parent nvme device

2019-03-04 Thread Javier González
> On 27 Feb 2019, at 18.14, Igor Konopko wrote: > > Current lightnvm and pblk implementation does not care > about NVMe max data transfer size, which can be smaller > than 64*K=256K. This patch fixes issues related to that. > > Signed-off-by: Igor Konopko > --- > drivers/lightnvm/core.c |

Re: [PATCH 06/13] lightnvm: pblk: Ensure that erase is chunk aligned

2019-03-04 Thread Javier González
sure who this is for - better not to top post. In any case, this is a spec grey zone. I’m ok with cleaning the bits as they mean nothing for the reset command. If you feel that strongly about this, you can take if with Igor. > > On Mon, Mar 4, 2019 at 8:48 AM Javier González wrote: >>

Re: [PATCH 05/13] lightnvm: pblk: Count all read errors in stats

2019-03-04 Thread Javier González
this from pblk? What's blocking that? Until now the spec. We added some new log information in Denali exactly for this. But since pblk supports OCSSD 1.2 and 2.0 I think it is needed to have it here, at least for debugging. > > Thanks, > Hans > > On Mon, Mar 4, 2019 at 8:

Re: [PATCH 08/13] lightnvm: pblk: Set proper read stutus in bio

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 10.35, Hans Holmberg wrote: > > On Mon, Mar 4, 2019 at 9:03 AM Javier González wrote: >>> On 27 Feb 2019, at 18.14, Igor Konopko wrote: >>> >>> Currently in case of read errors, bi_status is not >>> set properly which leads t

Re: [PATCH 13/13] lightnvm: Inherit mdts from the parent nvme device

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 12.30, Hans Holmberg wrote: > > On Mon, Mar 4, 2019 at 10:05 AM Javier González wrote: >>> On 27 Feb 2019, at 18.14, Igor Konopko wrote: >>> >>> Current lightnvm and pblk implementation does not care >>> about NVMe max data tr

Re: [PATCH 05/13] lightnvm: pblk: Count all read errors in stats

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 12.41, Hans Holmberg wrote: > > On Mon, Mar 4, 2019 at 10:23 AM Javier González wrote: >>> On 4 Mar 2019, at 10.02, Hans Holmberg >>> wrote: >>> >>> Igor: Have you seen this happening in real life? >>> >>>

Re: [PATCH 13/13] lightnvm: Inherit mdts from the parent nvme device

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 13.22, Hans Holmberg wrote: > > On Mon, Mar 4, 2019 at 12:44 PM Javier González wrote: >>> On 4 Mar 2019, at 12.30, Hans Holmberg wrote: >>> >>> On Mon, Mar 4, 2019 at 10:05 AM Javier González wrote: >>>>

Re: [PATCH 08/13] lightnvm: pblk: Set proper read stutus in bio

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 14.04, Matias Bjørling wrote: > > On 3/4/19 10:48 AM, Javier González wrote: >>> On 4 Mar 2019, at 10.35, Hans Holmberg >>> wrote: >>> >>> On Mon, Mar 4, 2019 at 9:03 AM Javier González wrote: >>>>> On 27 Feb 20

Re: [PATCH 13/13] lightnvm: Inherit mdts from the parent nvme device

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 14.25, Matias Bjørling wrote: > > On 3/4/19 2:19 PM, Javier González wrote: >>> On 4 Mar 2019, at 13.22, Hans Holmberg wrote: >>> >>> On Mon, Mar 4, 2019 at 12:44 PM Javier González wrote: >>>>> On 4 Mar 2019, at 12.3

Re: [PATCH 08/13] lightnvm: pblk: Set proper read stutus in bio

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 14.08, Matias Bjørling wrote: > > On 3/4/19 1:51 PM, Igor Konopko wrote: >> On 04.03.2019 13:14, Hans Holmberg wrote: >>> On Mon, Mar 4, 2019 at 10:48 AM Javier González wrote: >>>>> On 4 Mar 2019, at 10.35, Hans Holmberg >>>

Re: [PATCH 12/13] lightnvm: pblk: close opened chunks

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 14.18, Matias Bjørling wrote: > > On 3/4/19 9:27 AM, Javier González wrote: >>> On 27 Feb 2019, at 18.14, Igor Konopko wrote: >>> >>> When we creating pblk instance with factory >>> flag, there is a possibility that some chunks &

Re: [PATCH 12/13] lightnvm: pblk: close opened chunks

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 14.19, Matias Bjørling wrote: > >> + Klaus whom I discussed this with. >> Yeah, i think that "early reset" is a nice feature. It would be nice >> to extend the OCSSD spec with a new capabilities bit indicating if >> this is indeed supported or not. >> Matias: what do you think

Re: [PATCH 13/13] lightnvm: Inherit mdts from the parent nvme device

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 14.04, Igor Konopko wrote: > > > >> On 04.03.2019 13:22, Hans Holmberg wrote: >>> On Mon, Mar 4, 2019 at 12:44 PM Javier González wrote: >>> >>> >>> >>>> On 4 Mar 2019, at 12.30, Hans Holmberg wrote:

Re: [PATCH 13/13] lightnvm: Inherit mdts from the parent nvme device

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 15.24, Hans Holmberg wrote: > > On Mon, Mar 4, 2019 at 2:44 PM Javier González wrote: >>> On 4 Mar 2019, at 14.25, Matias Bjørling wrote: >>> >>> On 3/4/19 2:19 PM, Javier González wrote: >>>>> On 4 Mar 2019, at 13.2

Re: [PATCH 08/13] lightnvm: pblk: Set proper read stutus in bio

2019-03-04 Thread Javier González
> On 4 Mar 2019, at 16.12, Matias Bjørling wrote: > > On 3/4/19 2:45 PM, Javier González wrote: >>> On 4 Mar 2019, at 14.08, Matias Bjørling wrote: >>> >>> On 3/4/19 1:51 PM, Igor Konopko wrote: >>>> On 04.03.2019 13:14, Hans Holmberg wro

Re: [PATCH v2 3/8] lightnvm: pblk: Count all read errors in stats

2019-03-05 Thread Javier González
684,7 @@ struct pblk { > atomic_long_t read_empty; > atomic_long_t read_high_ecc; > atomic_long_t read_failed_gc; > + atomic_long_t read_ctrl_errors; > atomic_long_t write_failed; > atomic_long_t erase_failed; > > -- > 2.9.5 The only nitpick would be that if any user space script is relying on the syses output for the errors, this could break them. Maybe we could add a sysfs version file to mange this? Otherwise, it looks good. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH v2 4/8] lightnvm: pblk: Ensure that erase is chunk aligned

2019-03-05 Thread Javier González
erase_ppa->a.reserved = 0; > > spin_unlock(&e_line->lock); > > -- > 2.9.5 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH v2 7/8] lightnvm: pblk: warn about opened chunk on factory init

2019-03-05 Thread Javier González
> On 5 Mar 2019, at 14.51, Igor Konopko wrote: > > When we creating pblk instance with factory flag, there is a > possibility that some chunks are in open state, which does not allow > to issue erase request to them directly, based on OCSSD 2.0 spec. > Still most of the controllers allows for su

Re: [PATCH v2 8/8] lightnvm: Inherit mdts from the parent nvme device

2019-03-05 Thread Javier González
ve the capabilities of such a controller. >> Signed-off-by: Igor Konopko >> Reviewed-by: Javier González >> --- >> drivers/lightnvm/core.c | 9 +++-- >> drivers/nvme/host/lightnvm.c | 1 + >> include/linux/lightnvm.h | 1 + >> 3 files change

Re: [PATCH v2 6/8] lightnvm: pblk: Set proper read stutus in bio

2019-03-06 Thread Javier González
> On 5 Mar 2019, at 14.51, Igor Konopko wrote: > > Currently in case of read errors, bi_status is not set properly which > leads to returning inproper data to higher layer. This patch fix that > by setting proper status in case of read errors > > Patch also removes unnecessary warn_once(), which

[PATCH] pblk: fix max_io calculation

2019-03-07 Thread Javier González
largest possible size is submitted. Fixes: f9f9d1ae2c66 ("lightnvm: pblk: prevent stall due to wb threshold") Signed-off-by: Javier González --- Matias: Can you apply this as a fix to 5.1. This is a case I missed when fixing the wb threshold, which is also scheduled for 5.1 Than

Re: [PATCH v2] lightnvm: pblk: fix bio leak on large sized io

2019-03-07 Thread Javier González
> + ret = pblk_submit_read(pblk, bio); > + } else { > + /* Prevent deadlock in the case of a modest LUN configuration > + * and large user I/Os. Unless stalled, the rate limiter > + * leaves at least 256KB available for user I/O. > + */ > + if (pblk_get_secs(bio) > pblk_rl_max_io(&pblk->rl)) > + blk_queue_split(q, &bio); > + > + ret = pblk_write_to_cache(pblk, bio, PBLK_IOTYPE_USER); > + } > + > + switch (ret) { > case NVM_IO_ERR: > bio_io_error(bio); > break; > -- > 2.7.4 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH] lightnvm: pblk: set write thread affinity to particular cpu

2019-03-14 Thread Javier González
> On 14 Mar 2019, at 07.17, Marcin Dziegielewski > wrote: > > In some cases write thread migration between cpus can cause > sending writes in improper order and in consequence a lot of > errors from device. > > Write thread affinity to particular cpu prevent before it. > > Signed-off-by: Marci

Re: [PATCH] lightnvm: pblk: set write thread affinity to particular cpu

2019-03-14 Thread Javier González
> On 14 Mar 2019, at 07.22, Javier González wrote: > >> On 14 Mar 2019, at 07.17, Marcin Dziegielewski >> wrote: >> >> In some cases write thread migration between cpus can cause >> sending writes in improper order and in consequence a lot of >&g

Re: [PATCH 03/18] lightnvm: pblk: simplify partial read path

2019-03-16 Thread Javier González
> On 15 Mar 2019, at 02.52, Igor Konopko wrote: > > > > On 14.03.2019 22:35, Heiner Litz wrote: >> On Thu, Mar 14, 2019 at 9:07 AM Igor Konopko >> wrote: >>> This patch changes the approach to handling partial read path. >>> >>> In old approach merging of data from round buffer and drive was

Re: [PATCH 01/18] lightnvm: pblk: fix warning in pblk_l2p_init()

2019-03-16 Thread Javier González
gt; - pblk_err(pblk, "failed to allocate L2P (need %ld of memory)\n", > + pblk_err(pblk, "failed to allocate L2P (need %zu of memory)\n", > map_size); > return -ENOMEM; > } > -- > 2.9.5 Looks food to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 02/18] lightnvm: pblk: warn when there are opened chunks

2019-03-16 Thread Javier González
ned_chks); > > trace_pblk_line_state(pblk_disk_name(pblk), line->id, > line->state); > @@ -1071,6 +1075,11 @@ static int pblk_lines_init(struct pblk *pblk) > goto fail_free_lines; > } > > + if (factory && nr_opened_chks) { > + pblk_warn(pblk, "%d opened chunks during factory creation\n", > + nr_opened_chks); > + } > + nip: no need for braces here. Otherwise it looks good. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 04/18] lightnvm: pblk: OOB recovery for closed chunks fix

2019-03-16 Thread Javier González
> On 14 Mar 2019, at 09.04, Igor Konopko wrote: > > In case of OOB recovery, when some of the chunks are in closed state, > we are calculating number of written sectors in line incorrectly, > because we are always counting chunk WP, which for closed chunks > does not longer reflects written secto

Re: [PATCH 05/18] lightnvm: pblk: propagate errors when reading meta

2019-03-16 Thread Javier González
7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct > pblk_line *line, > atomic_dec(&pblk->inflight_io); > > /* If a read fails, do a best effort by padding the line and retrying */ > - if (rqd->error) { > + if (rqd->error && rqd->error != NVM_RSP_WARN_HIGHECC) { > int pad_distance, ret; > > if (padded) { > -- > 2.9.5 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 06/18] lightnvm: pblk: recover only written metadata

2019-03-16 Thread Javier González
> On 14 Mar 2019, at 09.04, Igor Konopko wrote: > > This patch ensures that smeta/emeta was written properly before even > trying to read it based on chunk table state and write pointer. > > Signed-off-by: Igor Konopko > --- > drivers/lightnvm/pblk-recovery.c | 43 ++

Re: [PATCH 08/18] lightnvm: pblk: fix spin_unlock order

2019-03-16 Thread Javier González
} > > out: > - spin_unlock(&rb->w_lock); > spin_unlock_irq(&rb->s_lock); > + spin_unlock(&rb->w_lock); > > return ret; > } > -- > 2.9.5 Ups. Thanks for fixing this... Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 09/18] lightnvm: pblk: kick writer on write recovery path

2019-03-16 Thread Javier González
k_struct *work) > mempool_free(recovery, &pblk->rec_pool); > > atomic_dec(&pblk->inflight_io); > + pblk_write_kick(pblk); > } > > > -- > 2.9.5 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 11/18] lightnvm: pblk: fix update line wp in OOB recovery

2019-03-17 Thread Javier González
*/ > + line->left_msecs = 0; > + } else { > + /* We have only some data sectors written. */ > + line->left_msecs -= written_secs; > + } > + spin_unlock(&l_mg->free_lock); > } > > static u64 pblk_sec_in_open_line(struct pblk *pblk, struct pblk_line *line) > -- > 2.9.5 Otherwise, it looks good. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

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

2019-03-18 Thread Javier González
> On 14 Mar 2019, at 17.04, Igor Konopko wrote: > > Currently there is only one copy of emeta stored per line in pblk. This ^^ smeta? > is risky, because in case of read error on such a chunk, we are losing > all the data from whole

Re: [PATCH 14/18] lightnvm: pblk: GC error handling

2019-03-18 Thread Javier González
; > }; > > @@ -909,6 +910,7 @@ void pblk_gc_free_full_lines(struct pblk *pblk); > void pblk_gc_sysfs_state_show(struct pblk *pblk, int *gc_enabled, > int *gc_active); > int pblk_gc_sysfs_force(struct pblk *pblk, int force); > +void pblk_put_line_back(struct pblk *pblk, struct pblk_line *line); > > /* > * pblk rate limiter > -- > 2.9.5 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 15/18] lightnvm: pblk: fix in case of lack of lines

2019-03-18 Thread Javier González
> On 14 Mar 2019, at 17.04, Igor Konopko wrote: > > In case when mapping fails (called from writer thread) due to lack of > lines, currently we are calling pblk_pipeline_stop(), which waits > for pending write IOs, so it will lead to the deadlock. Switching > to __pblk_pipeline_stop() in that cas

Re: [PATCH 10/18] lightnvm: pblk: ensure that emeta is written

2019-03-18 Thread Javier González
> On 14 Mar 2019, at 17.04, Igor Konopko wrote: > > When we are trying to switch to the new line, we need to ensure that > emeta for n-2 line is already written. In other case we can end with > deadlock scenario, when the writer has no more requests to write and > thus there is no way to trigger

Re: [PATCH 16/18] lightnvm: pblk: use nvm_rq_to_ppa_list()

2019-03-18 Thread Javier González
*line, > rqd->ppa_list = ppa_list; > rqd->dma_ppa_list = dma_ppa_list; > rqd->dma_meta_list = dma_meta_list; > + ppa_list = nvm_rq_to_ppa_list(rqd); > > if (pblk_io_aligned(pblk, rq_ppas)) > rqd->is_seq = 1; > @@ -444,7 +447,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct > pblk_line *line, > } > > for (j = 0; j < pblk->min_write_pgs; j++, i++) > - rqd->ppa_list[i] = > + ppa_list[i] = > addr_to_gen_ppa(pblk, paddr + j, line->id); > } > > @@ -500,7 +503,7 @@ static int pblk_recov_scan_oob(struct pblk *pblk, struct > pblk_line *line, > continue; > > line->nr_valid_lbas++; > - pblk_update_map(pblk, lba, rqd->ppa_list[i]); > + pblk_update_map(pblk, lba, ppa_list[i]); > } > > left_ppas -= rq_ppas; > -- > 2.9.5 This is a good fix. Thanks! Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH 17/18] lightnvm: allow to use full device path

2019-03-18 Thread Javier González
> if (remove.flags != 0) { > pr_err("nvm: no flags supported\n"); > @@ -1373,8 +1388,6 @@ static long nvm_ioctl_dev_factory(struct file *file, > void __user *arg) > if (copy_from_user(&fact, arg, sizeof(struct nvm_ioctl_dev_factory))) > return -EFAULT; > > - fact.dev[DISK_NAME_LEN - 1] = '\0'; > - > if (fact.flags & ~(NVM_FACTORY_NR_BITS - 1)) > return -EINVAL; > > -- > 2.9.5 Looks good to me. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH] lightnvm: pblk: set write thread affinity to particular cpu

2019-03-18 Thread Javier González
> On 18 Mar 2019, at 13.22, Hans Holmberg wrote: > > On Mon, Mar 18, 2019 at 10:44 AM Marcin Dziegielewski > wrote: >> On 3/14/19 3:22 PM, Javier González wrote: >>>> On 14 Mar 2019, at 07.22, Javier González wrote: >>>> >>>>> On

Re: [PATCH 10/18] lightnvm: pblk: ensure that emeta is written

2019-03-18 Thread Javier González
> On 18 Mar 2019, at 14.02, Igor Konopko wrote: > > > > On 17.03.2019 20:44, Matias Bjørling wrote: >> On 3/14/19 9:04 AM, Igor Konopko wrote: >>> When we are trying to switch to the new line, we need to ensure that >>> emeta for n-2 line is already written. In other case we can end with >>> de

Re: [PATCH] lightnvm: pblk: set propper line as data_line after gc

2019-03-18 Thread Javier González
else { > spin_lock(&l_mg->free_lock); > + l_mg->data_line = data_line; > /* Allocate next line for preparation */ > l_mg->data_next = pblk_line_get(pblk); > if (l_mg->data_next) { > -- > 1.8.3.1 I

Re: [PATCH 15/18] lightnvm: pblk: fix in case of lack of lines

2019-03-18 Thread Javier González
> On 18 Mar 2019, at 14.28, Igor Konopko wrote: > > > > On 18.03.2019 08:42, Javier González wrote: >>> On 14 Mar 2019, at 17.04, Igor Konopko wrote: >>> >>> In case when mapping fails (called from writer thread) due to lack of >>> lines, c

Re: [PATCH 04/18] lightnvm: pblk: OOB recovery for closed chunks fix

2019-03-18 Thread Javier González
> On 18 Mar 2019, at 13.50, Igor Konopko wrote: > > > > On 17.03.2019 20:24, Matias Bjørling wrote: >> On 3/16/19 3:43 PM, Javier González wrote: >>>> On 14 Mar 2019, at 09.04, Igor Konopko wrote: >>>> >>>> In case of OOB recovery,

Re: [PATCH] lightnvm: pblk: set write thread affinity to particular cpu

2019-03-19 Thread Javier González
> On 19 Mar 2019, at 14.33, Marcin Dziegielewski > wrote: > > > > On 3/18/19 7:22 PM, Javier González wrote: >>> On 18 Mar 2019, at 13.22, Hans Holmberg wrote: >>> >>> On Mon, Mar 18, 2019 at 10:44 AM Marcin Dziegielewski >>> wrote: >

Re: [PATCH] lightnvm: add a lock to prevent before the race condition on pblk remove

2019-03-21 Thread Javier González
} > > + down_read(&nvm_lock); > list_for_each_entry(dev, &nvm_devices, devices) { > ret = nvm_remove_tgt(dev, &remove); > if (!ret) > break; > } > + up_read(&nvm_lock); > > r

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

2019-03-21 Thread Javier González
> On 20 Mar 2019, at 16.38, Marcin Dziegielewski > wrote: > > Currently if we issue reboot to the system pblk will close > ungracefully and in consequence it will need recovery on load. > > This patch propose utilize of reboot notifier feature to trigger > gracefull pblk shutdown on reboot. >

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

2019-03-22 Thread Javier González
> On 22 Mar 2019, at 13.01, Marcin Dziegielewski > wrote: > > > > On 3/21/19 10:32 AM, Javier González wrote: >>> On 20 Mar 2019, at 16.38, Marcin Dziegielewski >>> wrote: >>> >>> Currently if we issue reboot to the system pblk will

Re: [PATCH v2 02/16] lightnvm: pblk: IO path reorganization

2019-03-24 Thread Javier González
> diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index 381f074..a3c925d 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -868,7 +868,7 @@ void pblk_get_packed_meta(struct pblk *pblk, struct > nvm_rq *rqd); > /* > * pblk user I/O write path > */ > -int pblk_write_to_cache(struct pblk *pblk, struct bio *bio, > +void pblk_write_to_cache(struct pblk *pblk, struct bio *bio, > unsigned long flags); > int pblk_write_gc_to_cache(struct pblk *pblk, struct pblk_gc_rq *gc_rq); > > @@ -894,7 +894,7 @@ void pblk_write_kick(struct pblk *pblk); > * pblk read path > */ > extern struct bio_set pblk_bio_set; > -int pblk_submit_read(struct pblk *pblk, struct bio *bio); > +void pblk_submit_read(struct pblk *pblk, struct bio *bio); > int pblk_submit_read_gc(struct pblk *pblk, struct pblk_gc_rq *gc_rq); > /* > * pblk recovery > -- > 2.9.5 The patch looks sane. Reviewed-by: Javier González signature.asc Description: Message signed with OpenPGP

Re: [PATCH v2 04/16] lightnvm: pblk: OOB recovery for closed chunks fix

2019-03-24 Thread Javier González
> On 22 Mar 2019, at 22.48, Igor Konopko wrote: > > In case of OOB recovery, when some of the chunks are in closed state, > we are calculating number of written sectors in line incorrectly, > because we are always counting chunk WP, which for closed chunks > does not longer reflects written secto

Re: [PATCH v2 07/16] lightnvm: pblk: wait for inflight IOs in recovery

2019-03-24 Thread Javier González
> On 22 Mar 2019, at 22.48, Igor Konopko wrote: > > This patch changes the behaviour of recovery padding in order to > support a case, when some IOs were already submitted to the drive and > some next one are not submitted due to error returned. > > Currently in case of errors we simply exit th

Re: [PATCH v2 12/16] lightnvm: pblk: do not read OOB from emeta region

2019-03-24 Thread Javier González
> On 22 Mar 2019, at 22.48, Igor Konopko wrote: > > Emeta does not have corresponding OOB metadata mapping valid, so there > is no need to try to recover L2P mapping from it. > > Signed-off-by: Igor Konopko > --- > drivers/lightnvm/pblk-recovery.c | 10 ++ > 1 file changed, 10 insertions

  1   2   3   4   5   6   >