filemap_dont...ck_writeback(9)
π 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β theaddress_spacethat 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:
inode_io_list_move_locked(9)wb_wait_for_completion(9)inode_cgwb_move_to_attached(9)locked_inode_to_wb_and_lock_list(9)inode_to_wb_and_lock_list(9)inode_switch_wbs(9)cleanup_offline_cgwb(9)wbc_attach_and_unlock_inode(9)wbc_attach_fdatawrite_inode(9)wbc_detach_inode(9)wbc_account_cgroup_owner(9)wb_split_bdi_pages(9)bdi_split_work_to_wbs(9)cgroup_writeback_by_id(9)cgroup_writeback_umount(9)wb_start_background_writeback(9)__mark_inode_dirty(9)writeback_inodes_sb_nr(9)writeback_inodes_sb(9)try_to_writeback_inodes_sb(9)sync_inodes_sb(9)write_inode_now(9)sync_inode_metadata(9)
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
- 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