SMR_PTR_GET(9)

πŸ“¦ in nixpkgs unstable

πŸ’– SMR_PTR_GET(9) β€” safe memory reclamation pointer API πŸ’–

okay bestie, this is the SMR_PTR_GET(9) page from the Kernel Developer's Manual, and it’s giving safe memory reclamation pointer API realness. no cap, we’re about to get into the pointer macros. πŸ’…

✨ NAME ✨

SMR_PTR_GET, SMR_PTR_GET_LOCKED, SMR_PTR_SET_LOCKED β€” safe memory reclamation pointer API. three macros, one cute lil family. 🫢

🌸 SYNOPSIS 🌸

TYPE
SMR_PTR_GET(TYPE *pptr);

TYPE
SMR_PTR_GET_LOCKED(TYPE *pptr);

void
SMR_PTR_SET_LOCKED(TYPE *pptr, TYPE v);

πŸ¦‹ DESCRIPTION πŸ¦‹

The SMR_PTR macros are used for accessing SMR-protected pointers. that’s the whole assignment, and they ate. πŸ’…

  • SMR_PTR_GET() β€” reads the pointer referenced by pptr for dereferencing inside SMR read-side critical section. read-side bestie behavior, literally.
  • SMR_PTR_GET_LOCKED() β€” reads the pointer referenced by pptr for dereferencing inside writer context. writer-context energy only. πŸ‘‘
  • SMR_PTR_SET_LOCKED() β€” writes value v to the pointer referenced by pptr. The operation issues a write-write memory barrier with membar_producer(9) before the pointer write. barrier first, then the write, periodt. πŸ”₯

πŸŽ€ CONTEXT πŸŽ€

SMR_PTR_GET(), SMR_PTR_GET_LOCKED() and SMR_PTR_SET_LOCKED() can be called during autoconf, from process context, or from interrupt context. yes, all three, no cap.

  • SMR_PTR_GET() can be used from SMR read-side critical section.
  • SMR_PTR_GET_LOCKED() and SMR_PTR_SET_LOCKED() can be used from writer context.

🌈 SEE ALSO 🌈

go read these next, bestie, iykyk. πŸ’œ

⭐ HISTORY ⭐

The SMR_PTR macros first appeared in OpenBSD 6.5. iconic origin story, fr fr. πŸŽ€


okay that’s the page! πŸ’– this one is from Debian, dated July 5, 2019, for SMR_PTR_GET(9) β€” mwah, bestie. πŸ’‹βœ¨

πŸ“¦ where this page comes from