remove_mapping(9)
remove_mapping(9) π
π NAME π
okay so bestie, this is remove_mapping from the Kernel API Manual β attempt to remove a folio from its mapping. that's the mission. π
β¨ SYNOPSIS β¨
long remove_mapping (struct address_space *mapping , struct folio *folio
);
π ARGUMENTS π
mappingβ the address space. yes, that's the whole address-space situation. π«Άfolioβ the folio to remove. bye bestie, hopefully. π¦
π¦ DESCRIPTION π¦
here's the tea: if the folio is dirty, under writeback, or if someone else has a ref on it, removal will fail. periodt. it's giving "not right now" and honestly? valid. π
πΈ RETURN πΈ
you get back the number of pages removed from the mapping. if the folio could not be removed, it's 0 β literally zero, a tiny heartbreak. π
π₯ CONTEXT π₯
bestie, the caller should have a single refcount on the folio and hold its lock. that's the prerequisite, iykyk. π
π SEE ALSO π
go read these next, bestie:
- Kernel file
./mm/vmscan.c writeback_throttling_sane(9)lruvec_lru_size(9)folio_putback_lru(9)folio_isolate_lru(9)check_move_unevictable_folios(9)
xoxo, your kernel bestie π
β sourced from ./mm, dated October 2026, page remove_mapping(9). slay β¨
π¦ 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