folio_lruvec_lock_irqsave(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… folio_lruvec_lock_irqsave(9) β€” from the Kernel API Manual, bestie ✨

okay so this is folio_lruvec_lock_irqsave, and it's giving "grab the lruvec lock but also be super polite about interrupts" energy. come sit with me 🫢


🌸 NAME 🌸

folio_lruvec_lock_irqsave β€” lock the lruvec for a folio. that's it. that's the whole vibe. πŸŽ€


✨ SYNOPSIS ✨

struct lruvec * folio_lruvec_lock_irqsave (struct folio *folio ,
unsigned long *flags );

like, literally the whole signature. returning a struct lruvec *, taking a struct folio * and a pointer to unsigned long flags. no notes πŸ’…


πŸ¦‹ ARGUMENTS πŸ¦‹

  • folio β€” pointer to the folio. the main character of this whole operation, ngl πŸ‘‘
  • flags β€” pointer to irqsave flags. this is where the interrupt-saving state gets stashed, so don't lose track of it, fr fr πŸ™ˆ

πŸ’– DESCRIPTION πŸ’–

so these functions are safe to use under any of the following conditions β€” and like, pay attention to the "any", bestie, because that's the whole point:

  • folio locked πŸ”’
  • folio_test_lru false
  • folio frozen (refcount of 0) 🧊

that's the list. all three, any one of them, you're chillin' ✨


🌈 RETURN 🌈

it returns the lruvec this folio is on β€” and the way that it comes back is fully locked down: lock held, interrupts disabled, and the rcu read lock held. three for the price of one, we love a generous king πŸ˜­πŸ’œ


πŸŽ€ SEE ALSO πŸŽ€

okay this list is long but every single one of these is invited to the party, no cutoffs, periodt:

Kernel file ./mm/memcontrol.c β€” 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_irq(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)


πŸ’€ reminder bestie: this is kernel land. the conditions in DESCRIPTION aren't suggestions, they're the whole safety net. respect them or the vibe check will be brutal.

and that's the page!! sourced from ./mm, dated October 2026, and yeah it's the folio_lruvec_lock_irqsave(9) page β€” go lock something responsibly, mwah πŸ’‹πŸŒΈβœ¨

πŸ“¦ where this page comes from