Hi Artem,
On Thu, 24 May 2012 11:17:52 +0300 Artem Bityutskiy<dedekind1@xxxxxxxxx> wrote:On Tue, 2012-05-22 at 18:55 +0200, Richard Weinberger wrote:a+ e = find_early_wl_entry(&ubi->free, max_pnum);
This picks the eb with the lowest pnum within 'ubi->free'.
When called with INT_MAX (for the FM_DATA), why do you need to pickfree eb with the minimal pnum? The FM_DATA EBs may reside everywhere(asthe FM_SB holds their location).
So why not pick the eb with a medium EC value (as done for standard
get_peb calls)? That might be better wear-leveling wise.
Fair point.
I'll fix that.
Artem, any comments on that?
The 'find_early_wl_entry()' function is used (currently) only at early
stages. At these stages the we do not have the PEBs sorted by EC. We
have just a list. This function should not be use after the WL subsystem
is initialized.
'find_early_wl_entry' is only called from 'ubi_wl_get_fm_peb'.
'ubi_wl_get_fm_peb' is called twice from within 'ubi_update_fastmap':
First call, to get the FM_SB, with 'max_pnum' set as UBI_FM_MAX_START.
Second, to get FM_DATA pebs, with 'max_pnum' as -1, do indicate "no
matter the location, give me pebs from the free pool".
'ubi_update_fastmap' is called from 'ubi_volume_notify' and from
'ubi_wl_get_peb' - at both points, I assume ubi->free rbtree is properly
populated. Am I mistaken?