folio_referenced(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 folio_referenced(9) β€” the kernel API manual, bestie edition 🌸

okay so this is folio_referenced(9) from the Kernel API Manual, and it's honestly such a little icon. it answers one very specific question: was this folio, like, touched? πŸ‘€ let's get into it.


✨ NAME ✨

folio_referenced β€” test if the folio was referenced. that's it. that's the whole vibe check. 🫢


πŸŽ€ SYNOPSIS πŸŽ€

int folio_referenced (struct folio *folio , int is_locked , struct
mem_cgroup *memcg , vma_flags_t *vma_flags );

πŸ’… ARGUMENTS πŸ’…

  • folio β€” the folio you're testing, bestie. the main character of this whole operation. πŸ‘‘
  • is_locked β€” says whether the caller holds the lock on the folio. caller-held lock energy.
  • memcg β€” the target memory cgroup.
  • vma_flags β€” a combination of all the vma->flags which referenced the folio. like a little receipt of who came by πŸ’–

πŸ¦‹ DESCRIPTION πŸ¦‹

quick test_and_clear_referenced for all mappings of a folio. lowkey a speedy little check across every mapping, ngl. ⭐


🧚 RETURN 🧚

it gives you back the number of mappings which referenced the folio. πŸ”₯

but heads up: it returns -1 if the function bailed out due to rmap lock contention 😭 β€” that's contention, not "no refs", so don't get it twisted.

🌈 SEE ALSO 🌈

so many siblings, fr fr. all of these live in the kernel file ./mm/rmap.c:


anyway that's the whole page, no notes πŸ’œ this one came to you from ./mm, dated October 2026 β€” mwah, go check your folios, ily, bye!! πŸŽ€βœ¨

πŸ“¦ where this page comes from