From: Javier Gonzalez <javier@cnexlabs.com>
To: "Matias Bjørling" <mb@lightnvm.io>
Cc: Hans Holmberg <hans.holmberg@cnexlabs.com>,
"linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] lightnvm: pblk: recover chunk state on 1.2 devices
Date: Fri, 3 Aug 2018 12:37:45 +0000 [thread overview]
Message-ID: <F7B041D7-4E55-4B26-A263-9289C4616223@cnexlabs.com> (raw)
In-Reply-To: <423c5d4b-6d9a-d233-d3da-f2cb8b10f880@lightnvm.io>
[-- Attachment #1: Type: text/plain, Size: 4327 bytes --]
> On 3 Aug 2018, at 14.30, Matias Bjørling <mb@lightnvm.io> wrote:
>
> On 08/03/2018 02:02 PM, Javier Gonzalez wrote:
>>> On 3 Aug 2018, at 13.57, Matias Bjørling <mb@lightnvm.io> wrote:
>>>
>>> On 07/24/2018 09:54 AM, Javier Gonzalez wrote:
>>>>> On 29 Jun 2018, at 13.28, Matias Bjørling <mb@lightnvm.io> wrote:
>>>>>
>>>>> On 06/29/2018 01:22 PM, Javier Gonzalez wrote:
>>>>>>> On 29 Jun 2018, at 13.14, Matias Bjørling <mb@lightnvm.io> wrote:
>>>>>>>
>>>>>>> On 06/28/2018 11:12 AM, Javier González wrote:
>>>>>>>> The Open-Channel 1.2 spec does not define a mechanism for the host to
>>>>>>>> recover the block (chunk) state. As a consequence, a newly format device
>>>>>>>> will need to reconstruct the state. Currently, pblk assumes that blocks
>>>>>>>> are not erased, which might cause double-erases in case that the device
>>>>>>>> does not protect itself against them (which is not specified in the spec
>>>>>>>> either).
>>>>>>>
>>>>>>> It should not be specified in the spec. It is up to the device to handle
>>>>>>> double erases and not do it.
>>>>>>>
>>>>>>>> This patch, reconstructs the state based on read errors. If the first
>>>>>>>> sector of a block returns and empty page (NVM_RSP_ERR_EMPTYPAGE), then
>>>>>>>> the block s marked free, i.e., erased and ready to be used
>>>>>>>> (NVM_CHK_ST_FREE). Otherwise, the block is marked as closed
>>>>>>>> (NVM_CHK_ST_CLOSED). Note that even if a block is open and not fully
>>>>>>>> written, it has to be erased in order to be used again.
>>>>>>>
>>>>>>> Should we extend it to do the scan, and update the write pointer as
>>>>>>> well? I think this kind of feature already is baked into pblk?
>>>>>> This is already in place: we scan until empty page and take it from
>>>>>> there. This patch is only for the case in which we start a pblk instance
>>>>>> form scratch. On a device already owned by pblk, we would not have the
>>>>>> problem we are trying to solve here because we know the state.
>>>>>
>>>>> Agree. What I meant was that when we anyway are recovering the state,
>>>>> we could just as well update ->wp and set to NVM_CHK_ST_OPEN and so
>>>>> forth for the initialization phase.
>>>> In 1.2 the use of chunk metadata is purely fictional. We respect the
>>>> chunk state machine as we transition lines, but all the write pointers
>>>> are ignored. Instead, we use the line bitmap to point to the next
>>>> writable entry. This is BTW the same way we it in open lines on 2.0 too.
>>>
>>> Now I understand where you are coming from. I had the understanding
>>> that we where using the write pointer now that we moved to 2.0,
>>> looking through the code, that wasn't the case. :) Which means that
>>> pblk doesn't work with a devices that implements 2.0. Yikes... I knew
>>> I had forgot a detail when support was added into pblk.
>> I think you misunderstood; pblk does support 2.0 devices. What happens
>> is that we transform the per chunk WP in 2.0 into the line bitmap to
>> simplify the lookup. The point being that we do not need to create a
>> fictional chunk for 1.2 devices since we do the translation to the
>> bitmap directly. Does this make sense?
>
> The chunk->wp isn't used anywhere. So it can't take wp into account.
> It uses the EMPTYPAGE marker from 1.2 instead. See pblk-core and
> pblk-recovery.
>
I see that the patches for this are still internal. Will post for 4.20
>>> There are no empty sector marker in the 2.0 spec, since it uses the
>>> write pointer to know where it is in the chunk. So there is a bit of
>>> work to do there.
>> Yes. And for 2.0 devices we go and look at the WP, but for 1.2 devices we
>> need to scan.
>>> Since this properly is a bit more work to do, I'll look into it after FMS.
>> Look the comments above. All we need for 2.0 support is in place. We can
>> talk about it f2f.
>>> I'm also moving the explicit coding of 1.2/2.0 chunk / bad block
>>> fixing into core, so pblk can be simplfied, and doesn't have to think
>>> to manage each version separately.
>> Good. I have a patch I was expecting to send after FMS for moving chunk
>> / bad block out of pblk for the same reason. If you're doing the same
>> thing I can stop looking into it...
>
> I am, will post when done.
Cool!
Javier
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2018-08-03 12:37 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-28 9:12 [PATCH] lightnvm: pblk: recover chunk state on 1.2 devices Javier González
2018-06-28 9:12 ` Javier González
2018-06-29 11:14 ` Matias Bjørling
2018-06-29 11:22 ` Javier Gonzalez
2018-06-29 11:28 ` Matias Bjørling
2018-07-24 7:54 ` Javier Gonzalez
2018-08-03 11:57 ` Matias Bjørling
2018-08-03 12:02 ` Javier Gonzalez
2018-08-03 12:30 ` Matias Bjørling
2018-08-03 12:37 ` Javier Gonzalez [this message]
2018-08-03 12:46 ` Matias Bjørling
2018-08-03 12:53 ` Javier Gonzalez
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=F7B041D7-4E55-4B26-A263-9289C4616223@cnexlabs.com \
--to=javier@cnexlabs.com \
--cc=hans.holmberg@cnexlabs.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mb@lightnvm.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).