Message ID | 20190322144843.9602-5-igor.j.konopko@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | lightnvm: next set of improvements for 5.2 | expand |
> On 22 Mar 2019, at 22.48, Igor Konopko <igor.j.konopko@intel.com> 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 sectors in particular chunk. Based on > OCSSD 2.0 spec WP for closed chunks is equal to SLBA + NLB and here we > need only NLB (clba in code) value for calculation. This patch for such > a chunks takes clba field instead. > > Signed-off-by: Igor Konopko <igor.j.konopko@intel.com> > --- > drivers/lightnvm/pblk-recovery.c | 8 +++++++- > 1 file changed, 7 insertions(+), 1 deletion(-) > > diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c > index 83b467b..bcd3633 100644 > --- a/drivers/lightnvm/pblk-recovery.c > +++ b/drivers/lightnvm/pblk-recovery.c > @@ -101,6 +101,8 @@ static void pblk_update_line_wp(struct pblk *pblk, struct pblk_line *line, > > static u64 pblk_sec_in_open_line(struct pblk *pblk, struct pblk_line *line) > { > + struct nvm_tgt_dev *dev = pblk->dev; > + struct nvm_geo *geo = &dev->geo; > struct pblk_line_meta *lm = &pblk->lm; > int nr_bb = bitmap_weight(line->blk_bitmap, lm->blk_per_line); > u64 written_secs = 0; > @@ -113,7 +115,11 @@ static u64 pblk_sec_in_open_line(struct pblk *pblk, struct pblk_line *line) > if (chunk->state & NVM_CHK_ST_OFFLINE) > continue; > > - written_secs += chunk->wp; > + if (chunk->state & NVM_CHK_ST_OPEN) > + written_secs += chunk->wp; > + else if (chunk->state & NVM_CHK_ST_CLOSED) > + written_secs += geo->clba; > + > valid_chunks++; > } > > -- > 2.9.5 Didn’t we agree that the patch was not needed?
On 25.03.2019 07:02, Javier González wrote: >> On 22 Mar 2019, at 22.48, Igor Konopko <igor.j.konopko@intel.com> 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 sectors in particular chunk. Based on >> OCSSD 2.0 spec WP for closed chunks is equal to SLBA + NLB and here we >> need only NLB (clba in code) value for calculation. This patch for such >> a chunks takes clba field instead. >> >> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com> >> --- >> drivers/lightnvm/pblk-recovery.c | 8 +++++++- >> 1 file changed, 7 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c >> index 83b467b..bcd3633 100644 >> --- a/drivers/lightnvm/pblk-recovery.c >> +++ b/drivers/lightnvm/pblk-recovery.c >> @@ -101,6 +101,8 @@ static void pblk_update_line_wp(struct pblk *pblk, struct pblk_line *line, >> >> static u64 pblk_sec_in_open_line(struct pblk *pblk, struct pblk_line *line) >> { >> + struct nvm_tgt_dev *dev = pblk->dev; >> + struct nvm_geo *geo = &dev->geo; >> struct pblk_line_meta *lm = &pblk->lm; >> int nr_bb = bitmap_weight(line->blk_bitmap, lm->blk_per_line); >> u64 written_secs = 0; >> @@ -113,7 +115,11 @@ static u64 pblk_sec_in_open_line(struct pblk *pblk, struct pblk_line *line) >> if (chunk->state & NVM_CHK_ST_OFFLINE) >> continue; >> >> - written_secs += chunk->wp; >> + if (chunk->state & NVM_CHK_ST_OPEN) >> + written_secs += chunk->wp; >> + else if (chunk->state & NVM_CHK_ST_CLOSED) >> + written_secs += geo->clba; >> + >> valid_chunks++; >> } >> >> -- >> 2.9.5 > > Didn’t we agree that the patch was not needed? > I hope I explained what was my motivation for doing this changes. And don't know honestly if we should fix this here or in the spec, so that's why I send it with v2 too. Matias should decide. >
diff --git a/drivers/lightnvm/pblk-recovery.c b/drivers/lightnvm/pblk-recovery.c index 83b467b..bcd3633 100644 --- a/drivers/lightnvm/pblk-recovery.c +++ b/drivers/lightnvm/pblk-recovery.c @@ -101,6 +101,8 @@ static void pblk_update_line_wp(struct pblk *pblk, struct pblk_line *line, static u64 pblk_sec_in_open_line(struct pblk *pblk, struct pblk_line *line) { + struct nvm_tgt_dev *dev = pblk->dev; + struct nvm_geo *geo = &dev->geo; struct pblk_line_meta *lm = &pblk->lm; int nr_bb = bitmap_weight(line->blk_bitmap, lm->blk_per_line); u64 written_secs = 0; @@ -113,7 +115,11 @@ static u64 pblk_sec_in_open_line(struct pblk *pblk, struct pblk_line *line) if (chunk->state & NVM_CHK_ST_OFFLINE) continue; - written_secs += chunk->wp; + if (chunk->state & NVM_CHK_ST_OPEN) + written_secs += chunk->wp; + else if (chunk->state & NVM_CHK_ST_CLOSED) + written_secs += geo->clba; + valid_chunks++; }
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 sectors in particular chunk. Based on OCSSD 2.0 spec WP for closed chunks is equal to SLBA + NLB and here we need only NLB (clba in code) value for calculation. This patch for such a chunks takes clba field instead. Signed-off-by: Igor Konopko <igor.j.konopko@intel.com> --- drivers/lightnvm/pblk-recovery.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)