Lines Matching +full:a +full:- +full:9
1 .\"-
16 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 .Nd "SMP-friendly kernel counter implementation"
63 is a generic facility to create counters
66 A
74 .Xr atomic 9
76 can be used in any non-interrupt context.
84 is considered suitable for accounting in the performance-critical
86 .Bl -tag -width indent
88 Allocate a new 64-bit unsigned counter.
92 .Xr malloc 9
116 .Xr critical 9
117 section, while on other is a nop.
128 Take a snapshot of counter
137 The function is a multiprocessor-friendly version of
142 Returns non-negative value if the rate is not yet reached during the current
143 second, and a negative value otherwise.
149 Define a
150 .Xr SYSINIT 9
154 Define and initialize a global counter
160 .Xr SYSINIT 9
163 Declare a static
164 .Xr sysctl 9
165 oid that would represent a
169 argument should be a pointer to allocated
171 A read of the oid returns value obtained through
175 Create a
176 .Xr sysctl 9
177 oid that would represent a
181 argument should be a pointer to allocated
183 A read of the oid returns value obtained through
187 Declare a static
188 .Xr sysctl 9
193 argument should be a pointer to allocated array of
198 A read of the oid returns len-sized array of
204 Create a
205 .Xr sysctl 9
210 argument should be a pointer to allocated array of
215 A read of the oid returns len-sized array of
224 is implemented using per-CPU data fields that are specially aligned
225 in memory, to avoid inter-CPU bus traffic due to shared use
229 .Xr uma 9
232 Fetch operation loops through all per-CPU fields and obtains a snapshot
235 On amd64 a
237 update is implemented as a single instruction without lock semantics,
243 The multi-instruction sequence provides the same guarantees as the
244 amd64 single-instruction implementation.
246 On some architectures updating a counter require a
247 .Xr critical 9
250 The following example creates a static counter array exported to
251 userspace through a sysctl:
252 .Bd -literal -offset indent
259 .Xr atomic 9 ,
260 .Xr critical 9 ,
261 .Xr locking 9 ,
262 .Xr malloc 9 ,
263 .Xr ratecheck 9 ,
264 .Xr sysctl 9 ,
265 .Xr SYSINIT 9 ,
266 .Xr uma 9
273 .An -nosplit