tag_pages_for_writeback(9)
πΈ tag_pages_for_writeback(9) πΈ
okay so bestie, welcome to the Kernel API Manual β section 9, yes we are in our kernel era β and todayβs main character is tag_pages_for_writeback, the function that tags pages so writeback knows whatβs up. π
β¨
π NAME π
tag_pages_for_writeback β tag pages to be written by writeback π
π SYNOPSIS π
void tag_pages_for_writeback (struct address_space *mapping , pgoff_t
start , pgoff_t end );
π¦ ARGUMENTS π¦
mappingβ address space structure to writestartβ starting page indexendβ ending page index (inclusive)
β¨ DESCRIPTION β¨
So this function scans the page range from start to end (inclusive) and tags all pages that have the DIRTY tag set with a special TOWRITE tag. Thatβs the whole glow-up: DIRTY pages get the TOWRITE stamp. π«Ά
Then the caller can use the TOWRITE tag to identify pages eligible for writeback. Itβs giving βhandy little eligibility list.β π
This mechanism is used to avoid livelocking of writeback by a process steadily creating new dirty pages in the file. And because of that, it is important for this function to be quick β so that it can tag pages faster than a dirtying process can create them. no cap, the speed is literally the point. π₯
π SEE ALSO π
Kernel file: ./mm/page-writeback.c β go say hi to the neighbors: π¦
node_dirtyable_memory(9)global_dirtyable_memory(9)domain_dirty_limits(9)global_dirty_limits(9)node_dirty_limit(9)node_dirty_ok(9)__wb_calc_thresh(9)balance_dirty_pages_ratelimited_flags(9)balance_dirty_pages_ratelimited(9)wb_over_bg_thresh(9)writeback_iter(9)filemap_dirty_folio(9)folio_redirty_for_writepage(9)folio_mark_dirty(9)folio_wait_writeback(9)folio_wait_writeback_killable(9)folio_wait_stable(9)
source/version: ./mm Β· date: October 2026 Β· page: tag_pages_for_writeback(9) β bye bestie, go tag some pages responsibly! π«Άππ
π¦ 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