invalidate_...pages2_range(9)
π NAME π
okay so bestie, this is invalidate_inode_pages2_range β and what it does is literally remove a range of pages from an address_space. that's the whole gig. main character energy for pagecache cleanup π
β¨ SYNOPSIS β¨
int invalidate_inode_pages2_range (struct address_space *mapping ,
pgoff_t start , pgoff_t end );
π ARGUMENTS π
mappingβ theaddress_spacein question. yes. that one. the space of addresses. π¦startβ the page offset 'from' which to invalidate. this is where the chaos begins, bestie.endβ the page offset 'to' which to invalidate β and heads up, it's inclusive, so this one's invited to the party too π«Ά
πΈ DESCRIPTION πΈ
so here's the tea β: any pages that get found mapped into pagetables? they get unmapped prior to invalidation. like, eviction notice first, then the actual yeeting. no page left hanging in a pagetable thinking it still has a home π it's giving responsible cleanup, honestly. iconic behavior.
β RETURN β
returns -EBUSY if any pages could not be invalidated. that's it. that's the number. if it's all good, no -EBUSY for you, slay π₯
π SEE ALSO π
the whole friend group, in the kernel file ./mm/truncate.c:
folio_invalidate(9)mapping_evict_folio(9)truncate_inode_pages_range(9)truncate_inode_pages(9)truncate_inode_pages_final(9)mapping_try_invalidate(9)invalidate_mapping_pages(9)invalidate_inode_pages2(9)truncate_pagecache(9)truncate_setsize(9)pagecache_isize_extended(9)truncate_pagecache_range(9)
and that's the post π this little masterpiece lives in ./mm, dated October 2026, and it's filed under invalidate_...pages2_range(9) β go off, pagecache queen πβ¨
π¦ 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