need_wear_leveling(9)
π need_wear_leveling(9) β a Kernel API Manual moment
okay so bestie, grab your matcha π΅ because we're talking about need_wear_leveling(9) β yes that's the manual name and yes it's giving "I have a very specific job and I do it well" energy.
β¨ NAME β¨
need_wear_leveling β checks whether to trigger a wear leveling work. UBI fetches free PEB from wl_pool, we check free PEBs from both 'wl_pool' and 'ubi->free', because free PEB in 'ubi->free' tree maybe moved into 'wl_pool' by ubi_refill_pools().
like literally that's the whole vibe: it's the little function that looks at your free PEBs in two places at once and goes "hmm, should we start a wear leveling work? π" because a free PEB sitting in 'ubi->free' might get scooted over into 'wl_pool' by ubi_refill_pools(), and you gotta check both or you're not seeing the whole picture, no cap. π¦
πΈ SYNOPSIS πΈ
bool need_wear_leveling (struct ubi_device *ubi );
π ARGUMENTS π
ubiβ UBI device description object (your main character, fr β the whole UBI device, described and handed over so we know what we're looking at π)
π₯ SEE ALSO π₯
the lore continues in the kernel file ./drivers/mtd/ubi/fastmap-wl.c β go read these besties, they're all linked and they all ate:
update_fastmap_work_fn(9)find_anchor_wl_entry(9)return_unused_pool_pebs(9)ubi_wl_get_fm_peb(9)ubi_refill_pools_and_lock(9)produce_free_peb(9)ubi_wl_get_peb(9)next_peb_for_wl(9)ubi_ensure_anchor_pebs(9)ubi_wl_put_fm_peb(9)ubi_is_erase_work(9)may_reserve_for_fm(9)
π reminder that this lives in ./drivers/mtd/ubi β that's the neighborhood, iykyk.
and that's the page!! mwah π«Ά this beauty comes from ./drivers/mtd/ubi, dated October 2026, and it's called need_wear_leveling(9) β iconic, no notes, periodt. ππ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms