diff options
author | Alan Cox <alc@FreeBSD.org> | 2004-06-12 20:01:48 +0000 |
---|---|---|
committer | Alan Cox <alc@FreeBSD.org> | 2004-06-12 20:01:48 +0000 |
commit | 2d0dc0fcd6b3153152856e0e6b4151faf8b79420 (patch) | |
tree | 2932c2aa045737086a3494b92d63233e95fbc8c1 /sys/amd64/amd64/pmap.c | |
parent | c8fd7c3227bc7b2d4ff3acae944eb1e9445a425b (diff) | |
download | src-2d0dc0fcd6b3153152856e0e6b4151faf8b79420.tar.gz src-2d0dc0fcd6b3153152856e0e6b4151faf8b79420.zip |
In a multiprocessor, the PG_W bit in the pte must be changed atomically.
Otherwise, the setting of the PG_M bit by one processor could be lost if
another processor is simultaneously changing the PG_W bit.
Reviewed by: tegge@
Notes
Notes:
svn path=/head/; revision=130386
Diffstat (limited to 'sys/amd64/amd64/pmap.c')
-rw-r--r-- | sys/amd64/amd64/pmap.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/amd64/amd64/pmap.c b/sys/amd64/amd64/pmap.c index d332045162eb..652698710c5b 100644 --- a/sys/amd64/amd64/pmap.c +++ b/sys/amd64/amd64/pmap.c @@ -2200,10 +2200,10 @@ pmap_change_wiring(pmap, va, wired) pte = pmap_pte(pmap, va); if (wired && (*pte & PG_W) == 0) { pmap->pm_stats.wired_count++; - *pte |= PG_W; + atomic_set_long(pte, PG_W); } else if (!wired && (*pte & PG_W) != 0) { pmap->pm_stats.wired_count--; - *pte &= ~PG_W; + atomic_clear_long(pte, PG_W); } } |