diff options
author | marcel <marcel@FreeBSD.org> | 2009-04-04 22:23:03 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2009-04-04 22:23:03 +0000 |
commit | 43f12bcbe6cd236c43a2796a77aca22e701d5f22 (patch) | |
tree | 4fe5eecd4ee27e21a5bbad1b607c9656e18d81c0 /sys/vm | |
parent | d8907d8b8a8f186d9cfdba6d2f970626a82d0d10 (diff) | |
download | FreeBSD-src-43f12bcbe6cd236c43a2796a77aca22e701d5f22.zip FreeBSD-src-43f12bcbe6cd236c43a2796a77aca22e701d5f22.tar.gz |
Perform a dummy stwcx. when we switch contexts. The context
being switched out may hold a reservation. The stwcx. will
clear the reservation. This is architecturally recommended.
The scenario this addresses is as follows:
1. Thread 1 performs a lwarx and as such holds a reservation.
2. Thread 1 gets switched out (before doing the matching
stwcx.) and thread 2 is switched in.
3. Thread 2 performs a stwcx. to the same reservation granule.
This will succeed because the processor has the reservation
even though thread 2 didn't do the lwarx.
Note that on some processors the address given the stwcx. is
not checked. On these processors the mere condition of having
a reservation would cause the stwcx. to succeed, irrespective
of whether the addresses are the same. The dummy stwcx. is
especially important for those processors.
Diffstat (limited to 'sys/vm')
0 files changed, 0 insertions, 0 deletions