diff options
author | kib <kib@FreeBSD.org> | 2015-07-10 08:54:12 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2015-07-10 08:54:12 +0000 |
commit | 8b3d38af034be8c0ee00735582dbe625ce9ba195 (patch) | |
tree | 8f17856cd3981537e5a0423265875258bb115ff5 /sys/kern/sched_ule.c | |
parent | 87fffd8ba1ca37d07c8be4894762ecb810711361 (diff) | |
download | FreeBSD-src-8b3d38af034be8c0ee00735582dbe625ce9ba195.zip FreeBSD-src-8b3d38af034be8c0ee00735582dbe625ce9ba195.tar.gz |
Change the mb() use in the sched_ult tdq_notify() and sched_idletd()
to more C11-ish atomic_thread_fence_seq_cst().
Note that on PowerPC, which currently uses lwsync for mb(), the change
actually fixes the missed store/load barrier, intended by r271604 [*].
Reviewed by: alc
Noted by: alc [*]
Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks
Diffstat (limited to 'sys/kern/sched_ule.c')
-rw-r--r-- | sys/kern/sched_ule.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/sched_ule.c b/sys/kern/sched_ule.c index 4727852..74ae85f 100644 --- a/sys/kern/sched_ule.c +++ b/sys/kern/sched_ule.c @@ -1057,7 +1057,7 @@ tdq_notify(struct tdq *tdq, struct thread *td) * globally visible before we read tdq_cpu_idle. Idle thread * accesses both of them without locks, and the order is important. */ - mb(); + atomic_thread_fence_seq_cst(); if (TD_IS_IDLETHREAD(ctd)) { /* @@ -2667,7 +2667,7 @@ sched_idletd(void *dummy) * before cpu_idle() read tdq_load. The order is important * to avoid race with tdq_notify. */ - mb(); + atomic_thread_fence_seq_cst(); cpu_idle(switchcnt * 4 > sched_idlespinthresh); tdq->tdq_cpu_idle = 0; |