The problem that I didn't think out

Artem B. Bityutskiy dedekind at yandex.ru
Mon Nov 28 05:24:10 EST 2005


zhao, forrest wrote:
> I think keeping track of a list of 10 most worn out eraseblocks
> is hard to be O(1) since this list is changed dynamically.
> In particular, we need to recalculate the list after every update
> operation; in order to recalculate the list we need to keep the usage
> information of all erase blocks in RAM in sorted manner. So if this is
> the case, the RAM occupation is O(N).
> 
Hmm, I meant the following.

1. How to choose an eraseblock to garbage collect.

We split all the eraseblocks onto several (virtual) groups, N 
eraseblocks in each. For example, 30 eraseblocks in each group: 0-29. 
30-59, ... One of the groups is "current".

Suppose we have mounted JFFS3. Assign group 0 to be "current". GC asks 
us to choose an eraseblock to GC. We search for the "best" candidate 
only in the current group. And GC it. During search we also find out M 
"best" candidates. Then switch the current group to the next. Next time 
we'll search in the next group. We'll correct our "best" list. Etc.

Something like this. Not, this wont give us absolutely best candidates. 
But still.

The description is just an idea, don't take it as a serious description.

-- 
Best Regards,
Artem B. Bityutskiy,
St.-Petersburg, Russia.




More information about the linux-mtd mailing list