invalidate_mapping_pages(9)
π¦ invalidate_mapping_pages(9) π¦
hiii bestie!! welcome to the Kernel API Manual page for invalidate_mapping_pages(9) π this one is lowkey iconic if youβre messing with page cache and need to yeet only the chill stuff. Letβs get into it β¨
π NAME π
invalidate_mapping_pages - Invalidate all clean, unlocked cache of one inode π§
πΈ SYNOPSIS πΈ
unsigned long invalidate_mapping_pages (struct address_space *mapping , pgoff_t start , pgoff_t end );
π ARGUMENTS π
mappingβ theaddress_spacewhich holds the cache to invalidate πstartβ the offset 'from' which to invalidate π«Άendβ the offset 'to' which to invalidate (inclusive) β
π₯ DESCRIPTION π₯
okay so hereβs the tea β: this function removes pages that are clean, unmapped and unlocked, as well as shadow entries. It will not block on IO activity β no waiting around for IO, bestie π
if you want to remove all the pages of one inode, regardless of their use and writeback state, use truncate_inode_pages instead π thatβs the one for the full send.
β RETURN β
the number of indices that had their contents invalidated β¨ (yes, a count, not a vibe check π)
π SEE ALSO π
all from the kernel file ./mm/truncate.c β go say hi to these besties π¦:
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_inode_pages2_range(9)invalidate_inode_pages2(9)truncate_pagecache(9)truncate_setsize(9)pagecache_isize_extended(9)truncate_pagecache_range(9)
xoxo, signed off from the ./mm source/version, dated October 2026 β catch u later, bestie π«Άπ
π¦ 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