public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: Atlant Schmidt <aschmidt@dekaresearch.com>
Cc: "linux-mtd@lists.infradead.org" <linux-mtd@lists.infradead.org>
Subject: Re: Does UBI LEB-level access interlock happily with UBIfs access?
Date: Fri, 19 Sep 2014 18:27:29 +0300	[thread overview]
Message-ID: <1411140449.28850.152.camel@sauron.fi.intel.com> (raw)
In-Reply-To: <0A40042D85E7C84DB443060EC44B3FD36D986A3009@dekaexchange07.deka.local>

On Tue, 2014-09-16 at 10:04 -0400, Atlant Schmidt wrote:
> Folks:
> 
>   We use the ordinary MTD/UBI/UBIfs stack on our
>   Embedded Linux system.
> 
>   For the purposes of scrubbing-out single bit errors,
>   I'd like to read through all of the LEBs stored in the
>   UBI device and whenever the ECC information indicates
>   that any correctable errors occurred, I'd like to
>   *RE-WRITE* that LEB (thereby forcing it to be scrubbed).
>   (Note: I might do this page-by-page rather than LEB-
>   by-LEB.)

Well, you may do something like

dd if=/dev/ubiX_Y of=/dev/null

For all volumes, and this will make UBI real all pages from all volumes
and whenever there was a bit-flip, schedule the LEB for scrubbing.

The volume table LEBs wont'd be read, though. To cover even that, you
one could introduce a special ioctl.

In case of fastmap, this ioctl would cover all the fatmap special LEBs
too.

>   But I would expect that because I'd have a hard
>   (impossible?) time doing an atomic read/re-write of a
>   LEB (or page), the UBIfs and my scrubber would interact
>   badly with my scrubber eventually corrupting the UBIfs
>   file system. Is there any easy way to interlock these
>   accesses (from the UBIfs and from my UBI-level scrubber)?
>   A way to temporarily suspend activity from the UBIfs?
> 
>   One kludge that might work is that I'm operating in a
>   real-time environment. If I made my scrubbing requests
>   from a very high priority (higher than the "System"
>   tasks that run around Priority 50), could I be sure
>   my read + rewrite scrubbing requests would at least
>   enter the UBI's work queue immediately adjacent to
>   each other (and without UBIfs requests intermingled)?
> 
>   Alternatively, I could probably dismount the UBIfs
>   before doing scrubbing, but I'd rather not have to
>   do that.

You do not need to do unmount anything with the above technique. If,
say, UBI scheduled an LEB 0:1 (volume 0, LEB 1) for scrubbing, and UBIFS
(which has volume 0 mounted) writes to LEB 1, UBI will block the writer
until the scrubbing finishes, so you do not have to worry.

HTH.

-- 
Best Regards,
Artem Bityutskiy

  reply	other threads:[~2014-09-19 15:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 14:04 Does UBI LEB-level access interlock happily with UBIfs access? Atlant Schmidt
2014-09-19 15:27 ` Artem Bityutskiy [this message]
2014-09-19 16:58   ` Atlant Schmidt
2014-09-19 17:13     ` Artem Bityutskiy
2014-09-19 17:17       ` Atlant Schmidt
2014-09-19 17:24         ` Artem Bityutskiy
2014-09-20 12:54           ` Richard Weinberger
2014-09-22  8:34             ` Ricard Wanderlof
2014-09-22  8:42               ` Richard Weinberger
2014-09-19 17:06 ` Brian Norris

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=1411140449.28850.152.camel@sauron.fi.intel.com \
    --to=dedekind1@gmail.com \
    --cc=aschmidt@dekaresearch.com \
    --cc=linux-mtd@lists.infradead.org \
    /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