linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Artem Bityutskiy <dedekind1@gmail.com>
To: "Matthew L. Creech" <mlcreech@gmail.com>
Cc: JamesLNute@eaton.com, linux-mtd@lists.infradead.org,
	Adrian.Hunter@nokia.com
Subject: Re: ubi_eba_init_scan: cannot reserve enough PEBs
Date: Mon, 06 Sep 2010 12:17:36 +0300	[thread overview]
Message-ID: <1283764656.11066.22.camel@localhost> (raw)
In-Reply-To: <1283367468.2209.33.camel@brekeke>

On Wed, 2010-09-01 at 21:57 +0300, Artem Bityutskiy wrote:
> > Please let me know if there are any other tests you'd like run on this
> > device.  Otherwise, we'll probably try booting 2.6.35 and see what
> > happens.
> 
> I need to take some time and carefully look at this. And think. Please,
> make a copy of the contents of your flash, if you can. 
> 
> From your side what would be helpful is if you tried to figure out how
> to reproduce this. Since I do not have your HW I cannot reproduce this,
> so the only thing I can do is to ask you to reproduce the problem with
> various debugging patches.

Matthew, I've sent a series of UBI patches which may help us to find out
the root cause of your issues.

The other idea which would definitely help is to create a debugging
patch which will track all erasures of PEBs and store them somewhere. I
do not know which tracing debugging tools you have, if you have some
fast tracing you can just send this info via your tracing interface. But
if you don't, you can use other flash or another partition on your flash
and store the info.

Here is my thinking:

UBIFS index points to an unmapped LEB. There are 2 possibilities: either
the index is incorrect or someone - UBI or UBIFS mistakenly unmapped an
needed LEB.

I personally think this is most probably the latter.

So we need to gather information about all unmap operations:

1. which LEB and which PEB is unmapped. The best place to get this info
is the 'do_sync_erase()' function. But it does not lave LEB. But we need
to add an 'int lnum' parameter there, and amend the callers as well. It
is some work, but should not be too difficult.

2. Then we need to know who unmapped the LEB - we need the stackdump.
Normally, we use 'dump_stack()' function to print stack dump - but it
prints to the log buffer. So we need a function which gives us an array
of addresses which we then can save and later transform to symbols. Or
we need a func which gives us a string containing an array of addresses.

We probably need to implement it. But I think kmemleak is doing
something like that - we can look there.

But also, make sure no-one in UBI use mtd->erase directly, just in case.
I think all erases should go via 'do_sync_erase()'

3. Most erasures are done in the background thread, so the stackdump
will point to the background thread, which is not informative at all.
This means we should also print PEB/LEB/stackdump in 'schedule_erase()'
to track all places where the erasure is initiated.

So, for each PEB erase / LEB unmap we store 1, 2 and 3 somewhere. When
we hit the UBIFS bug, we can see how the LEB was unmapped and how the
PEB was erased - this should give use idea what happened.

Do you think you can do something like this? I do not think I have time
in near future for this. What do you think?

But of course, if you learn how to reproduce this - this would be great.

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)

  reply	other threads:[~2010-09-06  9:19 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-22 18:37 ubi_eba_init_scan: cannot reserve enough PEBs Matthew L. Creech
2010-07-26  5:21 ` Artem Bityutskiy
2010-07-26 21:13   ` Matthew L. Creech
2010-07-27 15:12     ` Artem Bityutskiy
2010-07-27 15:21       ` Artem Bityutskiy
2010-07-28  5:46         ` Stefani Seibold
2010-08-22 15:04           ` Artem Bityutskiy
2010-08-31 12:09             ` Stefani Seibold
2010-09-01 15:47               ` Artem Bityutskiy
2010-09-02  6:47                 ` Stefani Seibold
2010-09-02  9:45                   ` Artem Bityutskiy
2010-08-22 15:02         ` Artem Bityutskiy
2010-07-27 20:47       ` Matthew L. Creech
2010-07-30 16:12         ` Artem Bityutskiy
2010-07-30 17:51           ` Matthew L. Creech
2010-08-02  4:22             ` Artem Bityutskiy
2010-08-22 18:30       ` Artem Bityutskiy
2010-08-24 22:38         ` Matthew L. Creech
2010-08-25  3:51           ` Artem Bityutskiy
2010-08-31 15:36           ` Matthew L. Creech
2010-09-01 18:57             ` Artem Bityutskiy
2010-09-06  9:17               ` Artem Bityutskiy [this message]
2010-09-07 15:59                 ` Matthew L. Creech
2010-09-07 17:17                   ` Artem Bityutskiy
2010-09-07 17:48                     ` Artem Bityutskiy

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=1283764656.11066.22.camel@localhost \
    --to=dedekind1@gmail.com \
    --cc=Adrian.Hunter@nokia.com \
    --cc=JamesLNute@eaton.com \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mlcreech@gmail.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).