folio_lruvec_lock_irq(9)
β¨ folio_lruvec_lock_irq β¨
okay so bestie, we're in the Kernel API Manual today and this page is lowkey a lil baddie π it's giving "one job, does it flawlessly." let's get into it π
πΈ NAME πΈ
folio_lruvec_lock_irq β Lock the lruvec for a folio.
yes that's it. that's the whole name. short, iconic, no notes π
π¦ SYNOPSIS π¦
struct lruvec * folio_lruvec_lock_irq (struct folio *folio );
that's the whole signature fr fr β copy it exactly, don't be cute with it π
π ARGUMENTS π
folioβ Pointer to the folio. that's the whole thing, just a pointer to your folio, she's not complicated π«Ά
π DESCRIPTION π
okay so the important part: these functions are safe to use under any of the following conditions π (and yes, the page says "functions" plural, that's not a typo on my end, i'm just relaying the lore π)
- folio locked π
folio_test_lrufalse β- folio frozen (refcount of 0) π§
that's the vibe check β meet any one of those and you're golden. no cap.
π RETURN π
so what do you get back? you get the lruvec that this folio is on, and it comes with:
- its lock held π
- interrupts disabled β‘
- and the rcu read lock held π§
like, it returns the whole package deal, lock and all, main character energy fr π
π₯ SEE ALSO π₯
so there's a lot of lore here, and it all lives in the kernel file ./mm/memcontrol.c β go read up on your faves:
get_mem_cgroup_css_from_folio(9)page_cgroup_ino(9)lruvec_page_state_monotonic(9)mod_memcg_state(9)mod_lruvec_state(9)count_memcg_events(9)get_mem_cgroup_from_mm(9)get_mem_cgroup_from_current(9)get_mem_cgroup_from_folio(9)mem_cgroup_iter(9)mem_cgroup_iter_break(9)mem_cgroup_scan_tasks(9)folio_lruvec_lock(9)folio_lruvec_lock_irqsave(9)mem_cgroup_update_lru_size(9)mem_cgroup_margin(9)mem_cgroup_print_oom_context(9)mem_cgroup_print_oom_meminfo(9)mem_cgroup_get_oom_group(9)consume_stock(9)__memcg_kmem_charge_page(9)__memcg_kmem_uncharge_page(9)mem_cgroup_wb_stats(9)mem_cgroup_from_private_id(9)mem_cgroup_css_reset(9)mem_cgroup_calculate_protection(9)mem_cgroup_charge_hugetlb(9)mem_cgroup_swapin_charge_folio(9)mem_cgroup_replace_folio(9)mem_cgroup_migrate(9)mem_cgroup_sk_charge(9)mem_cgroup_sk_uncharge(9)__mem_cgroup_try_charge_swap(9)__mem_cgroup_uncharge_swap(9)obj_cgroup_may_zswap(9)obj_cgroup_charge_zswap(9)obj_cgroup_uncharge_zswap(9)
like i said. a LOT. but honestly? slay for her, she's connected π β¨
mwah, that's the whole page π this lil drop comes to you straight from ./mm and is dated October 2026 β go lock something safely, bestie, and remember: interrupts disabled means interrupts disabled ππ«Ά
π¦ 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