page_cache_sync_readahead(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… page_cache_sync_readahead(9) β€” hey bestie, welcome to the Kernel API Manual πŸŽ€

okay so. this one is lowkey short but it's important, so pay attention bestie ✨


🌸 NAME 🌸

page_cache_sync_readahead β€” generic file readahead. that's it, that's the whole name. iconic brevity fr fr.


πŸ¦‹ SYNOPSIS πŸ¦‹

void page_cache_sync_readahead (struct address_space *mapping , struct
file_ra_state *ra , struct file *file , pgoff_t index , unsigned long
req_count );

like, look at those args. five of them. all lined up. main character energy honestly πŸ’…


πŸŽ€ ARGUMENTS πŸŽ€

  • mapping β€” the address_space that holds the pagecache and the I/O vectors. it's the whole vibe of the file's cached pages, okay?
  • ra β€” the file_ra_state, which is literally where the readahead state lives. this is the memory of "what has this file been doing lately" 🧠
  • file β€” used by the filesystem for authentication. yes, really, that's what the docs say, that's the whole job.
  • index β€” the index of the first page to be read. your starting point, your origin story 🌈
  • req_count β€” the total number of pages the caller is reading. so like, how much they ordered off the menu πŸ“

πŸ’– DESCRIPTION πŸ’–

okay so this is the thing you call when a cache miss just happened 😭 like you went looking for a page and it was NOT there, tragic, and now you need the actual read submitted.

page_cache_sync_readahead does that submit for you. that's the move. that's the whole assignment ✨

and here's the cute part β€” the readahead logic may decide to piggyback more pages onto your read request if the access patterns suggest it'll improve performance. like it saw you reading and went "oh we're doing this? bet, let me grab the neighbors too" πŸ‘‘ no cap, it's just reading the room and being generous.

bestie note: this is the sync one. there's an async sibling chilling in the SEE ALSO list below, so don't get it twisted πŸ™ˆ

🫢 SEE ALSO 🫢

kernel file ./include/linux/pagemap.h, and literally everyone from the function group chat:

the wb_err / mapping crew πŸ’€

the folio private-data babes πŸŽ€

the fgf situation πŸ¦‹

the "get me a folio/page" girlies πŸ’…

the index/position icons 🧚

the locking besties πŸ”₯

misc slay ⭐

the readahead family β€” your actual relatives πŸ‘‘

the stragglers, still valid, still loved πŸ“


okay that's the whole page bestie, you ate that πŸ’– stay hydrated, go read some pages ahead of time, and remember: ./include/linux, October 2026, straight from the Kernel API Manual β€” mwah πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from