aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/kpilite.h
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2021-02-26 23:54:17 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2021-02-27 23:27:29 +0000
commitb5449c92b489445635c7962875ce73b2c9211bba (patch)
tree771a00d70995838bf3047dc79cdbe6f212a0fc5a /sys/sys/kpilite.h
parent1d9ba697f99a88b321a7d8b96fa142ea774cd3be (diff)
downloadsrc-b5449c92b489445635c7962875ce73b2c9211bba.tar.gz
src-b5449c92b489445635c7962875ce73b2c9211bba.zip
Use atomic_interrupt_fence() instead of bare __compiler_membar()
for the which which definitely use membar to sync with interrupt handlers. libc and rtld uses of __compiler_membar() seems to want compiler barriers proper. The barrier in sched_unpin_lite() after td_pinned decrement seems to be not needed and removed, instead of convertion. Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28956
Diffstat (limited to 'sys/sys/kpilite.h')
-rw-r--r--sys/sys/kpilite.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/sys/kpilite.h b/sys/sys/kpilite.h
index 8742ef5cfbe8..2a7e9743f799 100644
--- a/sys/sys/kpilite.h
+++ b/sys/sys/kpilite.h
@@ -38,7 +38,7 @@ sched_pin_lite(struct thread_lite *td)
KASSERT((struct thread *)td == curthread, ("sched_pin called on non curthread"));
td->td_pinned++;
- __compiler_membar();
+ atomic_interrupt_fence();
}
static __inline void
@@ -47,9 +47,8 @@ sched_unpin_lite(struct thread_lite *td)
KASSERT((struct thread *)td == curthread, ("sched_unpin called on non curthread"));
KASSERT(td->td_pinned > 0, ("sched_unpin called on non pinned thread"));
- __compiler_membar();
+ atomic_interrupt_fence();
td->td_pinned--;
- __compiler_membar();
}
#endif
#endif