From: "Matias Bjørling" <mb@lightnvm.io>
To: "Javier González" <javier@javigon.com>
Cc: Hans Holmberg <hans@owltronix.com>,
"Konopko, Igor J" <igor.j.konopko@intel.com>,
Hans Holmberg <hans.holmberg@cnexlabs.com>,
linux-block@vger.kernel.org,
Simon Andreas Frimann Lund <slund@cnexlabs.com>,
Klaus Birkelund Jensen <klaus.jensen@cnexlabs.com>
Subject: Re: [PATCH 13/13] lightnvm: Inherit mdts from the parent nvme device
Date: Mon, 4 Mar 2019 15:58:03 +0100 [thread overview]
Message-ID: <d527f81c-69a6-7b97-d258-2acb18fbc95d@lightnvm.io> (raw)
In-Reply-To: <EA36DDD6-5A3D-4F5C-9B18-53E266EB676F@javigon.com>
On 3/4/19 2:44 PM, Javier González wrote:
>
>> On 4 Mar 2019, at 14.25, Matias Bjørling <mb@lightnvm.io> wrote:
>>
>> On 3/4/19 2:19 PM, Javier González wrote:
>>>> On 4 Mar 2019, at 13.22, Hans Holmberg <hans@owltronix.com> wrote:
>>>>
>>>> On Mon, Mar 4, 2019 at 12:44 PM Javier González <javier@javigon.com> wrote:
>>>>>> On 4 Mar 2019, at 12.30, Hans Holmberg <hans@owltronix.com> wrote:
>>>>>>
>>>>>> On Mon, Mar 4, 2019 at 10:05 AM Javier González <javier@javigon.com> wrote:
>>>>>>>> On 27 Feb 2019, at 18.14, Igor Konopko <igor.j.konopko@intel.com> 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.
>>>>>>
>>>>>> Could you describe *what* issues you are fixing?
>>>>>>
>>>>>>>> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
>>>>>>>> ---
>>>>>>>> drivers/lightnvm/core.c | 9 +++++++--
>>>>>>>> drivers/nvme/host/lightnvm.c | 1 +
>>>>>>>> include/linux/lightnvm.h | 1 +
>>>>>>>> 3 files changed, 9 insertions(+), 2 deletions(-)
>>>>>>>>
>>>>>>>> diff --git a/drivers/lightnvm/core.c b/drivers/lightnvm/core.c
>>>>>>>> index 5f82036fe322..c01f83b8fbaf 100644
>>>>>>>> --- a/drivers/lightnvm/core.c
>>>>>>>> +++ b/drivers/lightnvm/core.c
>>>>>>>> @@ -325,6 +325,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
>>>>>>>> struct nvm_target *t;
>>>>>>>> struct nvm_tgt_dev *tgt_dev;
>>>>>>>> void *targetdata;
>>>>>>>> + unsigned int mdts;
>>>>>>>> int ret;
>>>>>>>>
>>>>>>>> switch (create->conf.type) {
>>>>>>>> @@ -412,8 +413,12 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
>>>>>>>> tdisk->private_data = targetdata;
>>>>>>>> tqueue->queuedata = targetdata;
>>>>>>>>
>>>>>>>> - blk_queue_max_hw_sectors(tqueue,
>>>>>>>> - (dev->geo.csecs >> 9) * NVM_MAX_VLBA);
>>>>>>>> + mdts = (dev->geo.csecs >> 9) * NVM_MAX_VLBA;
>>>>>>>> + if (dev->geo.mdts) {
>>>>>>>> + mdts = min_t(u32, dev->geo.mdts,
>>>>>>>> + (dev->geo.csecs >> 9) * NVM_MAX_VLBA);
>>>>>>>> + }
>>>>>>>> + blk_queue_max_hw_sectors(tqueue, mdts);
>>>>>>>>
>>>>>>>> set_capacity(tdisk, tt->capacity(targetdata));
>>>>>>>> add_disk(tdisk);
>>>>>>>> diff --git a/drivers/nvme/host/lightnvm.c b/drivers/nvme/host/lightnvm.c
>>>>>>>> index b759c25c89c8..b88a39a3cbd1 100644
>>>>>>>> --- a/drivers/nvme/host/lightnvm.c
>>>>>>>> +++ b/drivers/nvme/host/lightnvm.c
>>>>>>>> @@ -991,6 +991,7 @@ int nvme_nvm_register(struct nvme_ns *ns, char *disk_name, int node)
>>>>>>>> geo->csecs = 1 << ns->lba_shift;
>>>>>>>> geo->sos = ns->ms;
>>>>>>>> geo->ext = ns->ext;
>>>>>>>> + geo->mdts = ns->ctrl->max_hw_sectors;
>>>>>>>>
>>>>>>>> dev->q = q;
>>>>>>>> memcpy(dev->name, disk_name, DISK_NAME_LEN);
>>>>>>>> diff --git a/include/linux/lightnvm.h b/include/linux/lightnvm.h
>>>>>>>> index 5d865a5d5cdc..d3b02708e5f0 100644
>>>>>>>> --- a/include/linux/lightnvm.h
>>>>>>>> +++ b/include/linux/lightnvm.h
>>>>>>>> @@ -358,6 +358,7 @@ struct nvm_geo {
>>>>>>>> u16 csecs; /* sector size */
>>>>>>>> u16 sos; /* out-of-band area size */
>>>>>>>> bool ext; /* metadata in extended data buffer */
>>>>>>>> + u32 mdts; /* Max data transfer size*/
>>>>>>>>
>>>>>>>> /* device write constrains */
>>>>>>>> u32 ws_min; /* minimum write size */
>>>>>>>> --
>>>>>>>> 2.17.1
>>>>>>>
>>>>>>> I see where you are going with this and I partially agree, but none of
>>>>>>> the OCSSD specs define a way to define this parameter. Thus, adding this
>>>>>>> behavior taken from NVMe in Linux can break current implementations. Is
>>>>>>> this a real life problem for you? Or this is just for NVMe “correctness”?
>>>>>>>
>>>>>>> Javier
>>>>>>
>>>>>> Hmm.Looking into the 2.0 spec what it says about vector reads:
>>>>>>
>>>>>> (figure 28):"The number of Logical Blocks (NLB): This field indicates
>>>>>> the number of logical blocks to be read. This is a 0’s based value.
>>>>>> Maximum of 64 LBAs is supported."
>>>>>>
>>>>>> You got the max limit covered, and the spec does not say anything
>>>>>> about the minimum number of LBAs to support.
>>>>>>
>>>>>> Matias: any thoughts on this?
>>>>>>
>>>>>> Javier: How would this patch break current implementations?
>>>>>
>>>>> Say an OCSSD controller that sets mdts to a value under 64 or does not
>>>>> set it at all (maybe garbage). Think you can get to one pretty quickly...
>>>>
>>>> So we cant make use of a perfectly good, standardized, parameter
>>>> because some hypothetical non-compliant device out there might not
>>>> provide a sane value?
>>> The OCSSD standard has never used NVMe parameters, so there is no
>>> compliant / non-compliant. In fact, until we changed OCSSD 2.0 to
>>> get the sector and OOB sizes from the standard identify
>>> command, we used to have them in the geometry.
>>
>> What the hell? Yes it has. The whole OCSSD spec is dependent on the
>> NVMe spec. It is using many commands from the NVMe specification,
>> which is not defined in the OCSSD specification.
>>
>
> First, lower the tone. >
> Second, no, it has not and never has, starting with all the write
> constrains, continuing with the vector commands, etc. > You cannot choose
> what you want to be compliant with and what you do not. OCSSD uses the
> NVMe protocol but it is self sufficient with its geometry for all the
> read / write / erase paths - it even depends on different PCIe class
> codes to be identified…
No. It does not.
To do this in the way the rest of the spec is
> defined, we either add a filed to the geometry or explicitly mention
> that MDTS is used, as we do with the sector and metadata sizes.
>
> Third, as a maintainer of this subsystem you should care about devices
> in the field that might break due to such a change (supported by the
> company you work for or not) - even if you can argue whether the change
> is compliant or not.
Same as Hans. If you worry about me doing my job, you need not to.
>
> And Hans, as a representative of a company that has such devices out
> there, you should care too.
>
> What if we add a quirk in the feature bits for this so that newer
> devices can implement this and older devices can still function?
>
>> The MDTS field should be respected in all case, similarly to how the
>> block layer respects it. Since the lightnvm subsystem are hooking in
>> on the side, this also be honoured by pblk (or the lightnvm subsystem
>> should fix it up)
>>
>
> This said, pblk does not care which value you give, it uses what the
> subsystem tells it - this is not arguing for this change not to be
> implemented.
>
> The only thing we should care about if implementing this is removing the
> constant defining 64 ppas and making allocations dynamic in the partial
> read and GC paths.
>
> Javier
>
next prev parent reply other threads:[~2019-03-04 14:58 UTC|newest]
Thread overview: 91+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-27 17:14 [PATCH 00/13] lightnvm: bugfixes and improvements Igor Konopko
2019-02-27 17:14 ` [PATCH 01/13] lightnvm: pblk: Line reference fix in GC Igor Konopko
2019-03-01 12:20 ` Hans Holmberg
2019-03-04 7:18 ` Javier González
2019-03-04 12:40 ` Matias Bjørling
2019-02-27 17:14 ` [PATCH 02/13] lightnvm: pblk: Gracefully handle GC data malloc fail Igor Konopko
2019-02-28 17:08 ` Javier González
2019-03-01 12:50 ` Hans Holmberg
2019-03-04 12:38 ` Igor Konopko
2019-02-27 17:14 ` [PATCH 03/13] lightnvm: pblk: Fix put line back behaviour Igor Konopko
2019-03-01 13:27 ` Hans Holmberg
2019-03-04 7:22 ` Javier González
2019-02-27 17:14 ` [PATCH 04/13] lightnvm: pblk: Rollback in gc read Igor Konopko
2019-03-04 7:38 ` Javier González
2019-03-04 8:44 ` Hans Holmberg
2019-03-04 12:39 ` Igor Konopko
2019-03-04 12:42 ` Hans Holmberg
2019-03-04 12:49 ` Matias Bjørling
2019-02-27 17:14 ` [PATCH 05/13] lightnvm: pblk: Count all read errors in stats Igor Konopko
2019-03-04 7:42 ` Javier González
2019-03-04 9:02 ` Hans Holmberg
2019-03-04 9:23 ` Javier González
2019-03-04 11:41 ` Hans Holmberg
2019-03-04 11:45 ` Javier González
2019-03-04 12:42 ` Igor Konopko
2019-03-04 12:48 ` Hans Holmberg
2019-02-27 17:14 ` [PATCH 06/13] lightnvm: pblk: Ensure that erase is chunk aligned Igor Konopko
2019-03-04 7:48 ` Javier González
2019-03-04 9:05 ` Hans Holmberg
2019-03-04 9:11 ` Javier González
2019-03-04 11:43 ` Hans Holmberg
2019-03-04 12:44 ` Igor Konopko
2019-03-04 12:57 ` Hans Holmberg
2019-03-04 13:00 ` Matias Bjørling
2019-03-05 8:20 ` Hans Holmberg
2019-03-05 8:26 ` Igor Konopko
2019-03-05 8:40 ` Hans Holmberg
[not found] ` <61b7e62a-d229-95b1-2572-336ab1bd67cb@intel.com>
2019-03-05 8:55 ` Hans Holmberg
2019-02-27 17:14 ` [PATCH 07/13] lightnvm: pblk: Cleanly fail when there is not enough memory Igor Konopko
2019-03-04 7:53 ` Javier González
2019-03-04 9:24 ` Hans Holmberg
2019-03-04 12:46 ` Igor Konopko
2019-02-27 17:14 ` [PATCH 08/13] lightnvm: pblk: Set proper read stutus in bio Igor Konopko
2019-03-04 8:03 ` Javier González
2019-03-04 9:35 ` Hans Holmberg
2019-03-04 9:48 ` Javier González
2019-03-04 12:14 ` Hans Holmberg
2019-03-04 12:51 ` Igor Konopko
2019-03-04 13:08 ` Matias Bjørling
2019-03-04 13:45 ` Javier González
2019-03-04 15:12 ` Matias Bjørling
2019-03-05 6:43 ` Javier González
2019-03-04 13:04 ` Matias Bjørling
2019-03-04 13:21 ` Javier González
2019-02-27 17:14 ` [PATCH 09/13] lightnvm: pblk: Kick writer for flush requests Igor Konopko
2019-03-04 8:08 ` Javier González
2019-03-04 9:39 ` Hans Holmberg
2019-03-04 12:52 ` Igor Konopko
2019-02-27 17:14 ` [PATCH 10/13] lightnvm: pblk: Reduce L2P DRAM footprint Igor Konopko
2019-03-04 8:17 ` Javier González
2019-03-04 9:29 ` Hans Holmberg
2019-03-04 13:11 ` Matias Bjørling
2019-02-27 17:14 ` [PATCH 11/13] lightnvm: pblk: Remove unused smeta_ssec field Igor Konopko
2019-03-04 8:21 ` Javier González
2019-03-04 9:40 ` Hans Holmberg
2019-02-27 17:14 ` [PATCH 12/13] lightnvm: pblk: close opened chunks Igor Konopko
2019-03-04 8:27 ` Javier González
2019-03-04 10:05 ` Hans Holmberg
2019-03-04 12:56 ` Igor Konopko
2019-03-04 13:03 ` Hans Holmberg
2019-03-04 13:19 ` Matias Bjørling
2019-03-04 13:48 ` Javier González
2019-03-04 13:18 ` Matias Bjørling
2019-03-04 13:47 ` Javier González
2019-02-27 17:14 ` [PATCH 13/13] lightnvm: Inherit mdts from the parent nvme device Igor Konopko
2019-03-04 9:05 ` Javier González
2019-03-04 11:30 ` Hans Holmberg
2019-03-04 11:44 ` Javier González
2019-03-04 12:22 ` Hans Holmberg
2019-03-04 13:04 ` Igor Konopko
2019-03-04 13:16 ` Hans Holmberg
2019-03-04 14:06 ` Javier González
2019-03-04 13:19 ` Javier González
2019-03-04 13:25 ` Matias Bjørling
2019-03-04 13:44 ` Javier González
2019-03-04 14:24 ` Hans Holmberg
2019-03-04 14:27 ` Javier González
2019-03-04 14:58 ` Matias Bjørling [this message]
2019-02-28 16:36 ` [PATCH 00/13] lightnvm: bugfixes and improvements Matias Bjørling
2019-02-28 17:15 ` Javier González
2019-03-01 10:23 ` Hans Holmberg
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=d527f81c-69a6-7b97-d258-2acb18fbc95d@lightnvm.io \
--to=mb@lightnvm.io \
--cc=hans.holmberg@cnexlabs.com \
--cc=hans@owltronix.com \
--cc=igor.j.konopko@intel.com \
--cc=javier@javigon.com \
--cc=klaus.jensen@cnexlabs.com \
--cc=linux-block@vger.kernel.org \
--cc=slund@cnexlabs.com \
/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).