Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/kpilite.h
Show All 32 Lines | |||||
#include "offset.inc" | #include "offset.inc" | ||||
static __inline void | static __inline void | ||||
sched_pin_lite(struct thread_lite *td) | sched_pin_lite(struct thread_lite *td) | ||||
{ | { | ||||
KASSERT((struct thread *)td == curthread, ("sched_pin called on non curthread")); | KASSERT((struct thread *)td == curthread, ("sched_pin called on non curthread")); | ||||
td->td_pinned++; | td->td_pinned++; | ||||
__compiler_membar(); | atomic_interrupt_fence(); | ||||
} | } | ||||
static __inline void | static __inline void | ||||
sched_unpin_lite(struct thread_lite *td) | sched_unpin_lite(struct thread_lite *td) | ||||
{ | { | ||||
KASSERT((struct thread *)td == curthread, ("sched_unpin called on non curthread")); | KASSERT((struct thread *)td == curthread, ("sched_unpin called on non curthread")); | ||||
KASSERT(td->td_pinned > 0, ("sched_unpin called on non pinned thread")); | KASSERT(td->td_pinned > 0, ("sched_unpin called on non pinned thread")); | ||||
__compiler_membar(); | atomic_interrupt_fence(); | ||||
td->td_pinned--; | td->td_pinned--; | ||||
__compiler_membar(); | |||||
} | } | ||||
markj: I suspect it is duplicated from critical_exit(). The same commit that added kpilite.h also… | |||||
#endif | #endif | ||||
#endif | #endif |
I suspect it is duplicated from critical_exit(). The same commit that added kpilite.h also added an inline critical_exit() to systm.h, and there the second fence is indeed required. I think you can just drop it here.