epoch.9 (320686674b3c8ce3ffe135c421a22d063917ee46) epoch.9 (8965b3033ea1750f2e064a130cf2f2158c6fc795)
1.\"
2.\" Copyright (C) 2018 Matthew Macy <mmacy@FreeBSD.org>.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice(s), this list of conditions and the following disclaimer as

--- 253 unchanged lines hidden (view full) ---

262More general mutation or a synchronous
263free would have to follow a call to
264.Fn epoch_wait .
265.Sh NOTES
266The
267.Nm
268kernel programming interface is under development and is subject to change.
269.Sh SEE ALSO
1.\"
2.\" Copyright (C) 2018 Matthew Macy <mmacy@FreeBSD.org>.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\" notice(s), this list of conditions and the following disclaimer as

--- 253 unchanged lines hidden (view full) ---

262More general mutation or a synchronous
263free would have to follow a call to
264.Fn epoch_wait .
265.Sh NOTES
266The
267.Nm
268kernel programming interface is under development and is subject to change.
269.Sh SEE ALSO
270.Xr callout 9 ,
270.Xr locking 9 ,
271.Xr mtx_pool 9 ,
272.Xr mutex 9 ,
273.Xr rwlock 9 ,
274.Xr sema 9 ,
275.Xr sleep 9 ,
271.Xr locking 9 ,
272.Xr mtx_pool 9 ,
273.Xr mutex 9 ,
274.Xr rwlock 9 ,
275.Xr sema 9 ,
276.Xr sleep 9 ,
276.Xr sx 9 ,
277.Xr timeout 9
277.Xr sx 9
278.Sh HISTORY
279The
280.Nm
281framework first appeared in
282.Fx 11.0 .
283.Sh CAVEATS
284One must be cautious when using
285.Fn epoch_wait_preempt .
286Threads are pinned during epoch sections, so if a thread in a section is then
287preempted by a higher priority compute bound thread on that CPU, it can be
288prevented from leaving the section indefinitely.
289.Pp
290Epochs are not a straight replacement for read locks.
291Callers must use safe list and tailq traversal routines in an epoch (see ck_queue).
292When modifying a list referenced from an epoch section safe removal
293routines must be used and the caller can no longer modify a list entry
294in place.
295An item to be modified must be handled with copy on write
296and frees must be deferred until after a grace period has elapsed.
278.Sh HISTORY
279The
280.Nm
281framework first appeared in
282.Fx 11.0 .
283.Sh CAVEATS
284One must be cautious when using
285.Fn epoch_wait_preempt .
286Threads are pinned during epoch sections, so if a thread in a section is then
287preempted by a higher priority compute bound thread on that CPU, it can be
288prevented from leaving the section indefinitely.
289.Pp
290Epochs are not a straight replacement for read locks.
291Callers must use safe list and tailq traversal routines in an epoch (see ck_queue).
292When modifying a list referenced from an epoch section safe removal
293routines must be used and the caller can no longer modify a list entry
294in place.
295An item to be modified must be handled with copy on write
296and frees must be deferred until after a grace period has elapsed.