folio_memcg_list_lru_alloc(9)
π folio_memcg_list_lru_alloc β the Kernel API Manual said "let's get this folio queued up"
okay so real talk, this one lives in the Kernel API Manual section (section 9, kernel girlies know π) and it's all about prepping the little queue-hooks a folio needs before it can actually be parked on a shrinker list later. no cap.
β¨ NAME β¨
folio_memcg_list_lru_alloc β allocate list_lru heads for a shrinkable folio π¦
πΈ SYNOPSIS πΈ
int folio_memcg_list_lru_alloc (struct folio *folio , struct list_lru
*lru , gfp_t gfp );
literally one function, three args, returns an int. that's her π
π«Ά ARGUMENTS π«Ά
folioβ the newly allocated & charged folio. she's fresh, she's accounted for, she's ready πlruβ thelist_lruthis might be queued on. it's giving "potential future home" energy πgfpβ thegfpmask. that's the allocation-vibes dial, yw β¨
π DESCRIPTION π
so what she actually does: she allocates the list_lru heads (per-memcg, per-node) that you're gonna need in order to queue this particular folio down the line. like, not right now, but future-you is gonna be so grateful π«Ά
this does memcg_list_lru_alloc, but on the memcg that the folio is associated with. iykyk β different memcg, different bookkeeping.
she also handles the folio_memcg access rules in the fast path (aka: list_lru heads already allocated, we're chilling π) and in the allocation slowpath (aka: we gotta go do actual work π). both covered, she's so thorough.
β¨ returns 0 on success, and a negative error value otherwise. so if your return value is < 0, that's your sign something did not slay. check it π
π§ SEE ALSO π§
kernel file ./include/linux/list_lru.h plus the whole list_lru friend group:
list_lru_lock(9)list_lru_unlock(9)list_lru_add(9)list_lru_add_obj(9)list_lru_del(9)list_lru_del_obj(9)list_lru_count_one(9)list_lru_walk_one(9)list_lru_walk_one_irq(9)
π and that's the page bestie! brought to you by./include/linux, dated October 2026, filed underfolio_memcg_list_lru_alloc(9)in the Kernel API Manual. go forth and allocate responsibly ππβ
π¦ 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