summaryrefslogtreecommitdiff
path: root/sys/uvm/uvm_swap.c
diff options
context:
space:
mode:
authorArtur Grabowski <art@cvs.openbsd.org>2007-04-13 18:57:50 +0000
committerArtur Grabowski <art@cvs.openbsd.org>2007-04-13 18:57:50 +0000
commit8dcbe71580f80a022d075e6454486bc9d964c765 (patch)
treea758a75bd2f6e39d8ea45545b501abbee0430ef1 /sys/uvm/uvm_swap.c
parent977eb8538189c8e232f80c85b5a0416ec6cd3670 (diff)
While splitting flags and pqflags might have been a good idea in theory
to separate locking, on most modern machines this is not enough since operations on short types touch other short types that share the same word in memory. Merge pg_flags and pqflags again and now use atomic operations to change the flags. Also bump wire_count to an int and pg_version might go int as well, just for alignment. tested by many, many. ok miod@
Diffstat (limited to 'sys/uvm/uvm_swap.c')
-rw-r--r--sys/uvm/uvm_swap.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/uvm/uvm_swap.c b/sys/uvm/uvm_swap.c
index ffdaf3b2025..6834f89a462 100644
--- a/sys/uvm/uvm_swap.c
+++ b/sys/uvm/uvm_swap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_swap.c,v 1.67 2007/01/12 07:41:31 art Exp $ */
+/* $OpenBSD: uvm_swap.c,v 1.68 2007/04/13 18:57:49 art Exp $ */
/* $NetBSD: uvm_swap.c,v 1.40 2000/11/17 11:39:39 mrg Exp $ */
/*
@@ -1899,7 +1899,7 @@ uvm_swap_io(pps, startslot, npages, flags)
SWAP_KEY_GET(sdp, key); /* add reference */
/* mark for async writes */
- tpps[i]->pqflags |= PQ_ENCRYPT;
+ atomic_setbits_int(&tpps[i]->pg_flags, PQ_ENCRYPT);
swap_encrypt(key, src, dst, block, 1 << PAGE_SHIFT);
src += 1 << PAGE_SHIFT;
dst += 1 << PAGE_SHIFT;