linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Javier González" <javier@javigon.com>
To: "Matias Bjørling" <mb@lightnvm.io>
Cc: "Konopko, Igor J" <igor.j.konopko@intel.com>,
	Hans Holmberg <hans@owltronix.com>,
	Hans Holmberg <hans.holmberg@cnexlabs.com>,
	linux-block@vger.kernel.org
Subject: Re: [PATCH 08/13] lightnvm: pblk: Set proper read stutus in bio
Date: Tue, 5 Mar 2019 07:43:55 +0100	[thread overview]
Message-ID: <908ED41A-B313-4F61-985D-69A2B630FC85@javigon.com> (raw)
In-Reply-To: <afb2814c-dbda-1c4f-b30c-d7bda9c7bb29@lightnvm.io>

[-- Attachment #1: Type: text/plain, Size: 6125 bytes --]

> On 4 Mar 2019, at 16.12, Matias Bjørling <mb@lightnvm.io> wrote:
> 
> On 3/4/19 2:45 PM, Javier González wrote:
>>> On 4 Mar 2019, at 14.08, Matias Bjørling <mb@lightnvm.io> 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 <javier@javigon.com> wrote:
>>>>>>> On 4 Mar 2019, at 10.35, Hans Holmberg <hans.ml.holmberg@owltronix.com> wrote:
>>>>>>> 
>>>>>>> On Mon, Mar 4, 2019 at 9:03 AM Javier González <javier@javigon.com> wrote:
>>>>>>>>> On 27 Feb 2019, at 18.14, Igor Konopko <igor.j.konopko@intel.com> 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 does
>>>>>>>>> not make sense in that place, since user bio is not used
>>>>>>>>> for interation with drive and thus bi_status will not be
>>>>>>>>> set here.
>>>>>>>>> 
>>>>>>>>> Signed-off-by: Igor Konopko <igor.j.konopko@intel.com>
>>>>>>>>> ---
>>>>>>>>> drivers/lightnvm/pblk-read.c | 11 +++++------
>>>>>>>>> 1 file changed, 5 insertions(+), 6 deletions(-)
>>>>>>>>> 
>>>>>>>>> diff --git a/drivers/lightnvm/pblk-read.c b/drivers/lightnvm/pblk-read.c
>>>>>>>>> index 3789185144da..39c1d6ccaedb 100644
>>>>>>>>> --- a/drivers/lightnvm/pblk-read.c
>>>>>>>>> +++ b/drivers/lightnvm/pblk-read.c
>>>>>>>>> @@ -175,11 +175,10 @@ static void pblk_read_check_rand(struct pblk *pblk, struct nvm_rq *rqd,
>>>>>>>>>       WARN_ONCE(j != rqd->nr_ppas, "pblk: corrupted random request\n");
>>>>>>>>> }
>>>>>>>>> 
>>>>>>>>> -static void pblk_end_user_read(struct bio *bio)
>>>>>>>>> +static void pblk_end_user_read(struct bio *bio, int error)
>>>>>>>>> {
>>>>>>>>> -#ifdef CONFIG_NVM_PBLK_DEBUG
>>>>>>>>> -     WARN_ONCE(bio->bi_status, "pblk: corrupted read bio\n");
>>>>>>>>> -#endif
>>>>>>>>> +     if (error && error != NVM_RSP_WARN_HIGHECC)
>>>>>>>>> +             bio_io_error(bio);
>>>>>>>>>       bio_endio(bio);
>>>>>>>>> }
>>>>>>>>> 
>>>>>>>>> @@ -219,7 +218,7 @@ static void pblk_end_io_read(struct nvm_rq *rqd)
>>>>>>>>>       struct pblk_g_ctx *r_ctx = nvm_rq_to_pdu(rqd);
>>>>>>>>>       struct bio *bio = (struct bio *)r_ctx->private;
>>>>>>>>> 
>>>>>>>>> -     pblk_end_user_read(bio);
>>>>>>>>> +     pblk_end_user_read(bio, rqd->error);
>>>>>>>>>       __pblk_end_io_read(pblk, rqd, true);
>>>>>>>>> }
>>>>>>>>> 
>>>>>>>>> @@ -292,7 +291,7 @@ static void pblk_end_partial_read(struct nvm_rq *rqd)
>>>>>>>>>       rqd->bio = NULL;
>>>>>>>>>       rqd->nr_ppas = nr_secs;
>>>>>>>>> 
>>>>>>>>> -     bio_endio(bio);
>>>>>>>>> +     pblk_end_user_read(bio, rqd->error);
>>>>>>>>>       __pblk_end_io_read(pblk, rqd, false);
>>>>>>>>> }
>>>>>>>>> 
>>>>>>>>> --
>>>>>>>>> 2.17.1
>>>>>>>> 
>>>>>>>> This is by design. We do not report the read errors as in any other
>>>>>>>> block device - this is why we clone the read bio.
>>>>>>> 
>>>>>>> Could you elaborate on why not reporting read errors is a good thing in pblk?
>>>>>> 
>>>>>> Normal block devices do not report read errors on the completion path
>>>>>> unless it is a fatal error. This is actually not well understood by the
>>>>>> upper layers, which tend to assume that the device is completely broken.
>>>>> 
>>>>> So returning bogus data without even a warning is a preferred
>>>>> solution? You want to force "the upper layers" to do checksumming?
>>>>> 
>>>>> It's fine to mask out NVM_RSP_WARN_HIGHECC, since that is just a
>>>>> warning that OCSSD 2.0 adds. The data should still be good.
>>>>> All other errors (see 4.6.1.2.1 in the NVMe 1.3 spec), indicates that
>>>>> the command did not complete (As far as I can tell)
>>>> My approach was exactly like that. In all cases other than WARN_HIGHECC we don't have a valid data. Without setting a bio_io_error() we are creating the impression for other layers, that we read the data correctly, what is not a case then.
>>>> I'm also seeing that this patch is not the only user of bio_io_error() API, also other drivers such as md uses is commonly.
>>> 
>>> Yes agree. This is an actual error in pblk that lets it return bogus data.
>> I am not against returning an error, I am just saying that this is not
>> normal behavior on the read path.
>> The problem is that the upper layers might interpret that the device is
>> broken completely, which is not true for a spa failing. Think for
>> example of a host reading under mw_cunits - in reality this is not even
>> a device problem but a host bug that might result in a fatal error.
> 
> Agree, and the host should manage it. The drive shall return a fatal error when it is asked to return invalid data. E.g., mw_cunits.
> 
>> Matias: I am surprised to see you answer this way - when I tried to
>> define a sane read error path with meaningful errors starting in the
>> spec and all the way up the stack you were the first one to argue for
>> reads to always succeed no matter what. In fact, using ZBC/ZAC as an
>> example...
> 
> What I objected against was having error messages for each type of
> error that could happen. Instead of a single or few error types (that
> triggers the same set of recovery procedure at the host-side).

Ok. So just to agree on a good way to move forward: do you think it is a
good idea for the LightNVM subsystem to propagate errors for the read
path moving forward? This would include reading ahead the write pointer,
which _does not_ report errors in ZAC/ZBC either. Here, note that
currently in pblk, we do not prevent a read to go to the device in any
case, and it is the device’s responsibility to return an error. However,
since OCSSD 2.0 does not define a rich error model many errors are
masked under generic buckets.

If so, we need to define which errors are propagated and which are not.
Can you share some insights, using OCSSD 2.0 as a base?

Javier

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-03-05  6:44 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 [this message]
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
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=908ED41A-B313-4F61-985D-69A2B630FC85@javigon.com \
    --to=javier@javigon.com \
    --cc=hans.holmberg@cnexlabs.com \
    --cc=hans@owltronix.com \
    --cc=igor.j.konopko@intel.com \
    --cc=linux-block@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).