page_cache_ra_unbounded(9)
π 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_lockmust 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 π
- Kernel file
./mm/readahead.c Readahead Overview(9)read_pages(9)readahead_expand(9)
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
- 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