filemap_dont...ck_writeback(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… filemap_dontcache_kick_writeback β€” from the Kernel API Manual, bestie

okay so welcome to the glow-up edition of the Kernel API Manual, and today's main character is filemap_dontcache_kick_writeback(9). she's a tiny void function with a big job and honestly? she ate. let's get into it πŸŽ€


✨ NAME ✨

filemap_dontcache_kick_writeback β€” the girl who kicks the flusher for IOCB_DONTCACHE writes πŸ’…

like literally, that's her whole thing. kicking. flushers. for dontcache writes. iconic behavior, no notes.


🌸 SYNOPSIS 🌸

void filemap_dontcache_kick_writeback (struct address_space *mapping );

that's it. that's the whole signature. one argument, returns nothing, serves looks. periodt. ✨


πŸ¦‹ ARGUMENTS πŸ¦‹

  • mapping β€” the address_space that was just written to. like, just just. she's fresh out of the write path and needs a lil nudge, and this is that nudge 🫢

πŸ”₯ DESCRIPTION πŸ”₯

so here's the vibe check: you call this and it kicks the writeback flusher thread to expedite writeback of the dontcache dirty pages. not me saying "expedite" in a manpage, but fr fr that's the word. ⚑

the way it works is kinda clever β€” it queues writeback for the inode's wb for as many pages as there are dontcache pages, BUT (and this is the important part, bestie, don't skip it) it does not restrict writeback to dontcache pages only. so it's like, "hey, do roughly this much work," not "hey, only touch these specific pages." big difference. πŸ‘‘

and why does this slay? because it significantly improves performance over either of the two goofy alternatives:

  • writing all of wb's pages (overkill 😭), or
  • writing only dontcache pages (too precious, too slow πŸ™ˆ)

so she's the middle path. the main character path. the reasonable amount of work path. 🌈

⚠️ real talk though: this doesn't guarantee quick writeback and reclaim of dontcache pages. it's a heuristic, not a promise. don't come for her if your pages are still chilling.

but β€” and this is the slay β€” it keeps the amount of dirty pages in check. long term? over the longer term, dontcache pages do get written and reclaimed by background writeback, even with this rough heuristic doing its lil thing in the foreground. she's not carrying the whole team, she's just keeping the vibes manageable 🧚


πŸ’œ SEE ALSO πŸ’œ

okay this is the friend group. the whole ./fs/fs-writeback.c crew. Kernel file ./fs/fs-writeback.c is where they all live, and here's every single one of them, no cap, none skipped:

that's 23 besties. the whole squad. go say hi 🫢✨


and that's the page!! πŸ’– this little gem comes out of ./fs and is dated October 2026 β€” so yeah, she's from the future and she's still kicking flushers. obsessed. byeeee πŸ‘‘πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from