diff options
author | Matt Macy <mmacy@FreeBSD.org> | 2018-05-10 17:55:24 +0000 |
---|---|---|
committer | Matt Macy <mmacy@FreeBSD.org> | 2018-05-10 17:55:24 +0000 |
commit | 06bf2a6aefbf98f0717954368a8791cd70bfba30 (patch) | |
tree | 1da1c21da6bb2700c9d8dcf0a8eaebb5f492c38a /sys/kern/subr_trap.c | |
parent | 137c41d763307e201d12dece785cebe729ae7d73 (diff) | |
download | src-06bf2a6aefbf98f0717954368a8791cd70bfba30.tar.gz src-06bf2a6aefbf98f0717954368a8791cd70bfba30.zip |
Add simple preempt safe epoch API
Read locking is over used in the kernel to guarantee liveness. This API makes
it easy to provide livenes guarantees without atomics.
Includes epoch_test kernel module to stress test the API.
Documentation will follow initial use case.
Test case and improvements to preemption handling in response to discussion
with mjg@
Reviewed by: imp@, shurd@
Approved by: sbruno@
Notes
Notes:
svn path=/head/; revision=333466
Diffstat (limited to 'sys/kern/subr_trap.c')
-rw-r--r-- | sys/kern/subr_trap.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/subr_trap.c b/sys/kern/subr_trap.c index 9a8b9828737f..12488e6fdb92 100644 --- a/sys/kern/subr_trap.c +++ b/sys/kern/subr_trap.c @@ -161,6 +161,8 @@ userret(struct thread *td, struct trapframe *frame) WITNESS_WARN(WARN_PANIC, NULL, "userret: returning"); KASSERT(td->td_critnest == 0, ("userret: Returning in a critical section")); + KASSERT(td->td_epochnest == 0, + ("userret: Returning in an epoch section")); KASSERT(td->td_locks == 0, ("userret: Returning with %d locks held", td->td_locks)); KASSERT(td->td_rw_rlocks == 0, |