Skip to content

Archive

Memory Reclamation

2 articles
Tech 23 Sep 2026 5 min read

Linux RCU Grace Periods Separate Removal from Reclamation

Read-Copy Update, commonly called RCU, is a synchronization family used throughout the Linux kernel for data that is read frequently and changed less often. Its central move is to separate two events that ordinary locking often treats as one: removing an object from a shared structure and reclaiming the memory that stored it. A writer can publish a new state or unlink an old object while readers continue through read-side critical sections. The old storage remains valid until the kernel has established that every reader that could have observed the old reference has passed through a quiescent state. That interval is an RCU grace period.

Software Engineering 23 Sep 2026 6 min read

Hazard Pointers Delay Reclamation Until Readers Release References

Removing a node from a lock-free data structure does not make its memory immediately safe to reuse. Another thread may already hold the node’s address and may still dereference it. If the remover frees that allocation too early, an otherwise correct atomic update can be followed by a use-after-free. Hazard pointers separate logical removal from physical reclamation. A reader publishes the address it intends to access in a designated hazard slot. A remover can unlink a node and place it on a retired list, but reclamation waits until a scan confirms that no hazard slot protects that address.