page_cache_ra_unbounded(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… page_cache_ra_unbounded β€” a kernel API manual moment (section 9, bestie)

okay so this is page_cache_ra_unbounded from the Kernel API Manual, and honestly? the name alone is giving "I do my own thing and I don't ask permission." let's get into it πŸ¦‹


✨ NAME ✨

page_cache_ra_unbounded β€” Start unchecked readahead. no cap, that's literally the whole vibe. unchecked. unbothered. unbounded. πŸ‘‘


🌸 SYNOPSIS 🌸

void page_cache_ra_unbounded (struct readahead_control *ractl , unsigned
long nr_to_read , unsigned long lookahead_size );

that's the whole signature. she takes three things and returns nothing (void), which is so main character of her honestly πŸŽ€


πŸ’– ARGUMENTS πŸ’–

  • ractl β€” the Readahead control. the little control center for the whole operation, iykyk.
  • nr_to_read β€” the number of pages to read. literally how many pages we're doing here.
  • lookahead_size β€” where to start the next readahead. the little pointer-to-the-future of it all ✨

πŸ”₯ DESCRIPTION πŸ”₯

so this function is for filesystems to call when they wanna start readahead beyond a file's stated i_size. yep, past the edge, past the boundary, past what the file said it was. that's the "unbounded" in the name, bestie πŸ’…

but here's the thing, and I need you to hear me on this one: this is almost certainly not the function you want to call. fr fr. it's the risky little shortcut, the "I know what I'm doing" function. if you're just out here living your life, use page_cache_async_readahead or page_cache_sync_readahead instead. those are the ones for you. 🫢

like, imagine being at a party and there's a door labeled "do not enter unless you're the filesystem" and you're not the filesystem. yeah. that's this. 😭

πŸ‘‘ CONTEXT πŸ‘‘

okay the rules, and there are rules: πŸŽ€

  • the file is referenced by caller β€” you gotta be holding a reference.
  • ractl->mapping->invalidate_lock must be held by the caller, at least in shared mode. at least. shared is the minimum, not the goal.
  • Mutexes may be held by caller. yes you read that right, mutexes are allowed here, she's chill like that.
  • May sleep, but will not reenter filesystem to reclaim memory. important distinction, don't get it twisted πŸ’€

🌈 SEE ALSO 🌈

all the readahead girlies, linked up πŸ’œ


okay that's the page!! this one came to you from ./mm, October 2026, and it's the page_cache_ra_unbounded(9) doc β€” go be careful out there with your unbounded readahead, bestie, and remember: use the async or sync version unless you really mean it πŸŒΈβœ¨πŸŽ€

πŸ“¦ where this page comes from