folio_put_refs(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… folio_put_refs(9) β€” like, the Kernel API Manual page you didn't know you needed πŸŽ€

okay bestie, buckle up, because we're talking about folio_put_refs from the Kernel API Manual and honestly? she's giving "quietly important" and I'm obsessed. πŸ¦‹


✨ NAME ✨

folio_put_refs β€” Reduce the reference count on a folio. that's it. that's the whole job. πŸ’œ


🌸 SYNOPSIS 🌸

void folio_put_refs (struct folio *folio , int refs );

literally the whole signature, no notes, slay. ✨


πŸŽ€ ARGUMENTS πŸŽ€

  • folio β€” The folio. yes bestie, that's the entire description. she's a main character with no backstory. πŸ‘‘
  • refs β€” The amount to subtract from the folio's reference count. so like, how many refs we're dropping in one go, no cap. πŸ’…

πŸ”₯ DESCRIPTION πŸ”₯

so here's the tea: if the folio's reference count reaches zero, the memory will be released back to the page allocator and may be used by another allocation immediately. like, instantly, no grace period, no warning text, nothing. πŸ’€

⚠️ Do not access the memory or the struct folio after calling folio_put_refs unless you can be sure that these weren't the last references. fr fr, if you touch it after and it was the last ref, that's on you, bestie. 😭

🌈 CONTEXT 🌈

  • May be called in process or interrupt context, but not in NMI context. ngl, NMI is where she draws the line. πŸ™ˆ
  • May be called while holding a spinlock. yes she's flexible like that, we love a versatile icon. 🫢

πŸ’– SEE ALSO πŸ’–

Kernel file ./include/linux/mm.h, plus this whole entire friend group right here (yes, all of them, I'm not skipping a single one, that's disrespectful):


πŸ’Œ okay that's the page!! this cutie lives in ./include/linux and the version is dated October 2026 β€” so like, future icon behaviour, we love to see it. go forth and drop your refs responsibly, bestie. πŸ’…βœ¨πŸ¦‹
πŸ“¦ where this page comes from