folio_add_lru(9)
π folio_add_lru β from the Kernel API Manual, bestie
okay so real talk, this one's a kernel-function page (folio_add_lru(9)) and it's short but it's mighty, so let's get into it π«Ά
β¨ NAME β¨
folio_add_lru β literally just: add a folio to an LRU list. that's the whole vibe. π
πΈ SYNOPSIS πΈ
void folio_add_lru (struct folio *folio );
no return value, it's a void girlie β she does the thing and dips π
π¦ ARGUMENTS π¦
folioβ the folio that's getting added to the LRU. that's it, that's the whole argument, she's low maintenance β¨
π₯ DESCRIPTION π₯
so what's actually happening: you queue the folio for addition to the LRU. not "add it right now" β queue. subtle but iconic π
the whole decision on whether the page goes on the [in]active [file|anon] list? highkey deferred until the folio_batch is drained. she's not rushing, she's strategising β
and the reason for that little delay is genuinely cute: it gives the caller of folio_add_lru a chance to have the folio added to the active list instead, by using folio_mark_accessed. it's giving main character energy for the caller, fr fr π§
π SEE ALSO π
- Kernel file
./mm/folio.c folio_mark_accessed(9)folio_add_lru_vma(9)deactivate_file_folio(9)folio_mark_lazyfree(9)lru_cache_drain_for_folio(9)folios_put_refs(9)release_pages(9)folio_batch_remove_exceptionals(9)
okay that's the whole page, no cap π she lives in ./mm, and the fine humans of the kernel docs stamped her October 2026 β so go forth and queue those folios responsibly, bestie π πΈ
π¦ 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