tag_pages_for_writeback(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 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 write
  • start β€” starting page index
  • end β€” 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: πŸ¦‹


source/version: ./mm Β· date: October 2026 Β· page: tag_pages_for_writeback(9) β€” bye bestie, go tag some pages responsibly! πŸ«ΆπŸ’–πŸŽ€

πŸ“¦ where this page comes from