diff options
author | attilio <attilio@FreeBSD.org> | 2012-10-29 01:35:17 +0000 |
---|---|---|
committer | attilio <attilio@FreeBSD.org> | 2012-10-29 01:35:17 +0000 |
commit | f3a86755d7de2bdf589cf6125b2960ab6b66bb48 (patch) | |
tree | 7150f24090cbf237b554cb551a0613d376ae789b /libexec/pppoed | |
parent | d209784979f373b07125e835f0b92652c65044a8 (diff) | |
download | FreeBSD-src-f3a86755d7de2bdf589cf6125b2960ab6b66bb48.zip FreeBSD-src-f3a86755d7de2bdf589cf6125b2960ab6b66bb48.tar.gz |
Compiler have a precise knowledge of the content of sched_pin() and
sched_unpin() as they are functions static and inline. This way it
can do two dangerous things:
- Reorder instructions around both of them, taking out from the safe
path operations that are supposed to be (ie. per-cpu accesses)
- Cache the value of td_pinned in CPU registers not making visible
in kernel context to the scheduler once it is scanning the runqueue,
as td_pinned is not marked volatile.
In order to avoid both possible bugs explicitly, protect the safe path
with compiler memory barriers. This will prevent reordering and caching
by the compiler about td_pinned operations.
Generally this could lead to suboptimal code traversing the pinnings
but this is not the case as can be easilly verified:
http://lists.freebsd.org/pipermail/svn-src-projects/2012-October/005797.html
Discussed with: jeff, jhb
MFC after: 2 weeks
Diffstat (limited to 'libexec/pppoed')
0 files changed, 0 insertions, 0 deletions