summaryrefslogtreecommitdiffstats
path: root/sys/vm
diff options
context:
space:
mode:
authoralc <alc@FreeBSD.org>2003-01-05 01:31:45 +0000
committeralc <alc@FreeBSD.org>2003-01-05 01:31:45 +0000
commite9e799ad843693e3f3c1652d0ae0a7d302999fbf (patch)
tree12ffec2c7b6a2bdada66325e011ad13e9af5fe2d /sys/vm
parent41e4abf4cc5c8ea394b16e090e3efbd4078cf53b (diff)
downloadFreeBSD-src-e9e799ad843693e3f3c1652d0ae0a7d302999fbf.zip
FreeBSD-src-e9e799ad843693e3f3c1652d0ae0a7d302999fbf.tar.gz
Use atomic add and subtract to update the global wired page count,
cnt.v_wire_count.
Diffstat (limited to 'sys/vm')
-rw-r--r--sys/vm/vm_page.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c
index e7ffb47..bc34dc6 100644
--- a/sys/vm/vm_page.c
+++ b/sys/vm/vm_page.c
@@ -863,7 +863,7 @@ loop:
m->flags = PG_BUSY;
}
if (req & VM_ALLOC_WIRED) {
- cnt.v_wire_count++;
+ atomic_add_int(&cnt.v_wire_count, 1);
m->wire_count = 1;
} else
m->wire_count = 0;
@@ -1183,7 +1183,7 @@ vm_page_wire(vm_page_t m)
if (m->wire_count == 0) {
if ((m->flags & PG_UNMANAGED) == 0)
vm_pageq_remove(m);
- cnt.v_wire_count++;
+ atomic_add_int(&cnt.v_wire_count, 1);
}
m->wire_count++;
KASSERT(m->wire_count != 0, ("vm_page_wire: wire_count overflow m=%p", m));
@@ -1228,7 +1228,7 @@ vm_page_unwire(vm_page_t m, int activate)
if (m->wire_count > 0) {
m->wire_count--;
if (m->wire_count == 0) {
- cnt.v_wire_count--;
+ atomic_subtract_int(&cnt.v_wire_count, 1);
if (m->flags & PG_UNMANAGED) {
;
} else if (activate)
OpenPOWER on IntegriCloud