Lines Matching +full:cpu +full:- +full:read
1 .\" SPDX-License-Identifier: BSD-2-Clause
34 .Nd safe memory reclamation for lock-free data structures
74 memory-safe lock-free data structures.
75 In typical usage, read accesses to an SMR-protected data structure, such as a
77 .Dq read section
85 In contrast with reader-writer locks such as
91 Readers can always enter a read section immediately
96 so mutations do not introduce read latency.
101 operate only on per-CPU data and thus avoid some of the performance problems
102 inherent in the implementation of traditional reader-writer mutexes.
106 Note that any SMR-protected data structure must be implemented carefully such
109 The data structure must be designed to be lock-free; SMR merely facilitates
117 This requirement results in a two-phase approach to the removal of items:
123 SMR provides this mechanism: readers may access a lock-free data structure in
128 functions, which together create a read section, and the
134 functions can be used to wait for threads in read sections to finish.
137 state block which holds both per-CPU and global state.
138 Readers load global state and modify per-CPU state, while writers must scan all
139 per-CPU states to detect active readers.
141 performance in write-heavy workloads.
143 Threads enter a read section by calling
145 Read sections should be short, and many operations are not permitted while in
146 a read section.
150 Another consequence of this is that the thread is pinned to the current CPU for
151 the duration of the read section.
152 Furthermore, read sections may not be nested: it is incorrect to call
156 state block when already in a read section for that state block.
160 kernel memory allocator provides some SMR-specified facilities.
171 To insert an item into an SMR-protected data structure, memory is allocated
179 Read-only lookup operations are performed in SMR read sections.
182 their read sections before recycling that item's memory.
184 If the zone has an associated per-item destructor, it will be invoked at some
198 However, an introduction to the write-side interface of SMR can be useful.
203 When entering a read section,
205 loads a copy of the write sequence and stores it in per-CPU memory, hence
208 To exit a read section, this per-CPU memory is overwritten with an invalid
209 value, making the CPU inactive.
231 is a non-blocking operation and returns true only if all active readers are
269 memory-safe read-only access to a data structure concurrent with modifications