prune_dcache_sb(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 prune_dcache_sb(9) β€” like, the Kernel API Manual page you actually wanna read πŸ’…

okay so bestie, welcome to the Kernel API Manual ✨ and today's main character is prune_dcache_sb(9) β€” the function that trims down the dcache when things get a little too full. no cap, she's lowkey important πŸŽ€


✨ NAME ✨

prune_dcache_sb β€” shrink the dcache πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

long prune_dcache_sb (struct super_block *sb , struct shrink_control *sc
);

πŸ’– ARGUMENTS πŸ’–

  • sb β€” the superblock, bestie. that's the thing you're pruning πŸ“
  • sc β€” the shrink control, and fr it gets passed along to list_lru_shrink_walk ✨

πŸ‘‘ DESCRIPTION πŸ‘‘

so what she does is attempt to shrink the superblock dcache LRU by sc->nr_to_scan entries πŸ’… this happens when we need more memory, and it's called from the superblock shrinker function. iykyk 🌈

and like β€” heads up β€” this function may fail to free any resources if all the dentries are in use 😭 that's just how it is, not a bug, don't come for her 🫢


🌸 SEE ALSO 🌸

Kernel file ./fs/dcache.c ✨ plus this whole squad right here:


okay that's the whole page, you ate that πŸ’… this one's from ./fs, dated October 2026 β€” go off, icon πŸ‘‘βœ¨πŸ«Ά

πŸ“¦ where this page comes from