From: Artem Bityutskiy <dedekind@infradead.org>
To: Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: MTDML <linux-mtd@lists.infradead.org>
Subject: Re: [PATCH] UBI: introduce sequential counter
Date: Fri, 09 Feb 2007 11:12:19 +0200 [thread overview]
Message-ID: <1171012339.10670.33.camel@sauron> (raw)
In-Reply-To: <1170972968.4884.140.camel@zod.rchland.ibm.com>
Hello Josh,
On Thu, 2007-02-08 at 16:16 -0600, Josh Boyer wrote:
> Do image creation tools now how to understand how to increment the
> counter for each block in a binary image that would be flashed onto the
> card raw? Or do you leave the counter in all the VID headers as 0 for
> such images?
They don't and they should be updated. But yes, they write zeroes to the
sqnum and UBI is happy.
> If a new kernel is run with an older UBI image, will it automatically
> start using the field and increment the counter values? (If yes, that
> makes my first question go away I think.)
Yes. Both are used, incremented, etc.
> No you can't. You cannot determine time and rate from a simple counter
> number. All you can determine is that LEB N is older than LEB M. It
> could be older by 40 seconds, or older by 5 years.
Here is an example:
I know the number of PEBs on the media N and I may introduce an
empirical criteria of oldness M = F(N). For example, M=kN, k is a
natural number. Its a subject for an investigation.
I know the highest sqnum (= the current global sequence counter) H, and
any LEB with sqnum=S is treated it as old if S < H-M, and as "fresh"
otherwise.
When I move a PEB with low EC, and I need to pick the target PEB (T),
where I move the data to. I pick T with the highest EC if the data is
old, and I pick T with an average EC if the data is fresh.
>
> > is close to the current one, it was written recently. This provides us
> > an opportunity to distinguish between LEBs with static data vs. LEBs
> > with not really static data (e.g., we have just recently taken a LEB
> > with low erase counter and wrote data there). This is useful for WL.
>
> Yes, this might help wear-leveling. But if the data is used, I would
> recommend being very conservative about using the counter value to
> distinguish between "static" and "non-static" data.
Yes, this has to be carefully thought of.
> > + * eraseblocks P and P1. But P1 has greater sequence number, so UBI pick P1.
>
> "... so UBI picks P1"
Yup, Tx.
> > + * which PEB is the original (obviously P will have lower @ts) and the copy.
>
> What is @ts?
I first wanted to call it "time stamp", but store sequence number.
Leftovers, tx.
> > + * Note, there is an obsolete @leb_ver field which was used instead of @ts in
>
> Again with @ts... I think you mean @seqnum?
Yup, tx.
> > ubi32_t data_crc;
> > - uint8_t padding1[24];
> > + uint8_t padding1[4];
> > + ubi64_t sqnum;
> > + uint8_t padding2[12];
>
> Can't you add the field at the bottom before hdr_crc so you don't have
> split padding like that?
No, it is 64-bit and I want it to be aligned.
--
Best regards,
Artem Bityutskiy (Битюцкий Артём)
next prev parent reply other threads:[~2007-02-09 9:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-02-08 20:02 [PATCH] UBI: introduce sequential counter Artem Bityutskiy
2007-02-08 22:16 ` Josh Boyer
2007-02-09 5:50 ` Jörn Engel
2007-02-09 9:19 ` Artem Bityutskiy
2007-02-09 9:12 ` Artem Bityutskiy [this message]
2007-02-09 13:12 ` Josh Boyer
2007-02-09 14:40 ` Artem Bityutskiy
2007-02-09 14:50 ` Josh Boyer
2007-02-09 14:54 ` Artem Bityutskiy
2007-02-13 15:11 ` Frank Haverkamp
2007-02-13 15:40 ` 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=1171012339.10670.33.camel@sauron \
--to=dedekind@infradead.org \
--cc=jwboyer@linux.vnet.ibm.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