Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1265980

Re: [PATCH 0/4] dm verity: add support for error correction

From Mike Snitzer <snitzer@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0/4] dm verity: add support for error correction
Date 2015-11-09 21:00 +0100
Message-ID <qt0LG-2nj-37@gated-at.bofh.it> (permalink)
References <qri9Y-iH-3@gated-at.bofh.it> <qrnjk-3AO-13@gated-at.bofh.it> <qrwFX-1gt-3@gated-at.bofh.it> <qsXE6-pE-15@gated-at.bofh.it> <qt08V-29B-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Nov 09 2015 at  2:19pm -0500,
Sami Tolvanen <samitolvanen@google.com> wrote:

> On Mon, Nov 09, 2015 at 11:37:35AM -0500, Mike Snitzer wrote:
> > I'm left wondering: can the new error correction code be made an
> > optional feature that is off by default? -- so as to preserve some
> > isolation of this new code from the old dm-verity behaviour.
> 
> It's optional in the sense that you must specify error correction
> parameters in the table to turn it on. Otherwise, verity_dec_decode
> returns -1 and dm-verity handles errors as before.
> 
> > might be good to add a wrapper like verity_fec_is_enabled().
> 
> Sure. I can do this in v2 and address the other feedback and build
> issues as well.

Thanks.

> > Also, the 2 other big questions from Mikulas need answering:
> > 1) why aren't you actually adjustng error codes, returning success, if
> >    dm-verity was able to trap/correct the corruption?
> 
> We don't see actual I/O errors very often. Most corruption we've seen
> is caused by flaky hardware that doesn't return errors. However, I can
> certainly change to code to attempt recovery in this case too.

OK, might be worthwhile to simulate underlying storage errors using the
dm-flakey target underneath dm-verity just to validate your changes work
as expected.

> > 2) please fix the code to preallocate all required memory -- so that
> >    verity_fec_alloc_buffers() isn't called in map.
> 
> I tried to avoid preallocating the buffers because they are relatively
> large (up to 1 MiB depending on the Reed-Solomon parameters) and not
> required unless we have errors to correct. I suppose there's no way to
> safely do this in the middle of I/O?

Basically you want to be able to ensure forward progress of dm-verity
IO even in the face of no system memory being generally available.

Hopefully this doesn't seem like make-work for you.  This one of the
design considerations imposed on DM targets because otherwise you run
the risk of failing IO in the face of low memory.  Which results in
users experiencing failures.

1MB is quite large, especially if it is unlikely to be used.  dm-cache
does cope with the need for memory in the IO path, see 'struct
prealloc', prealloc_data_structs() and other related functions in
drivers/md/dm-cache-target.c

But in the dm-cache case a worker thread is processing work and needs
memory for each work item.  So it isn't the .map function that directly
needs the memory.

DM-thinp also pre-allocates memory using a mempool, e.g. see
drivers/md/dm-thin.c:bio_detain().  But again, this portion of dm-thinp
is being run from a worker thread and _not_ the .map functons.

Could you architect the FEC code such that it punts IO to a worker
thread only if errors need correcting?  And have that worker thread's
additional memory allocations be backed by a mempool?
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 0/4] dm verity: add support for error correction Sami Tolvanen <samitolvanen@google.com> - 2015-11-05 03:10 +0100
  [PATCH 1/4] dm verity: clean up duplicate hashing code Sami Tolvanen <samitolvanen@google.com> - 2015-11-05 03:10 +0100
  [PATCH 4/4] dm verity: ignore zero blocks Sami Tolvanen <samitolvanen@google.com> - 2015-11-05 03:10 +0100
  [PATCH 3/4] dm verity: add support for forward error correction Sami Tolvanen <samitolvanen@google.com> - 2015-11-05 03:10 +0100
    Re: [PATCH 3/4] dm verity: add support for forward error correction kbuild test robot <lkp@intel.com> - 2015-11-05 06:40 +0100
  [PATCH 2/4] dm verity: separate function for parsing opt args Sami Tolvanen <samitolvanen@google.com> - 2015-11-05 03:10 +0100
  Re: [PATCH 0/4] dm verity: add support for error correction Milan Broz <mbroz@redhat.com> - 2015-11-05 08:40 +0100
    Re: [PATCH 0/4] dm verity: add support for error correction Sami Tolvanen <samitolvanen@google.com> - 2015-11-05 18:40 +0100
      Re: [PATCH 0/4] dm verity: add support for error correction Mike Snitzer <snitzer@redhat.com> - 2015-11-09 17:40 +0100
        Re: [PATCH 0/4] dm verity: add support for error correction Sami Tolvanen <samitolvanen@google.com> - 2015-11-09 20:20 +0100
          Re: [PATCH 0/4] dm verity: add support for error correction Mike Snitzer <snitzer@redhat.com> - 2015-11-09 21:00 +0100
          Re: [PATCH 0/4] dm verity: add support for error correction Milan Broz <mbroz@redhat.com> - 2015-11-12 11:40 +0100
          Re: [PATCH 0/4] dm verity: add support for error correction Mikulas Patocka <mpatocka@redhat.com> - 2015-11-12 20:00 +0100
    Re: [PATCH 0/4] dm verity: add support for error correction Mikulas Patocka <mpatocka@redhat.com> - 2015-11-06 18:30 +0100
      Re: [PATCH 0/4] dm verity: add support for error correction Sami Tolvanen <samitolvanen@google.com> - 2015-11-06 20:10 +0100
        Re: [dm-devel] [PATCH 0/4] dm verity: add support for error  correction Zdenek Kabelac <zkabelac@redhat.com> - 2015-11-06 20:30 +0100
          Re: [dm-devel] [PATCH 0/4] dm verity: add support for error  correction Sami Tolvanen <samitolvanen@google.com> - 2015-11-06 21:30 +0100
            Re: [dm-devel] [PATCH 0/4] dm verity: add support for error  correction Zdenek Kabelac <zkabelac@redhat.com> - 2015-11-06 22:10 +0100
              Re: [dm-devel] [PATCH 0/4] dm verity: add support for error  correction Sami Tolvanen <samitolvanen@google.com> - 2015-11-06 22:30 +0100
                Re: [dm-devel] [PATCH 0/4] dm verity: add support for error  correction Mikulas Patocka <mpatocka@redhat.com> - 2015-11-07 16:30 +0100
            Re: [dm-devel] [PATCH 0/4] dm verity: add support for error  correction Mikulas Patocka <mpatocka@redhat.com> - 2015-11-07 16:30 +0100
        Re: [PATCH 0/4] dm verity: add support for error correction Mikulas Patocka <mpatocka@redhat.com> - 2015-11-07 16:20 +0100
          Re: [PATCH 0/4] dm verity: add support for error correction Austin S Hemmelgarn <ahferroin7@gmail.com> - 2015-11-09 16:10 +0100

csiph-web