summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_malloc_debug.c
diff options
context:
space:
mode:
authorart <art@openbsd.org>2007-04-13 18:57:49 +0000
committerart <art@openbsd.org>2007-04-13 18:57:49 +0000
commit65d6360cb5c0772769017c581ffa58e5b47fe546 (patch)
tree2a903d1e3ddc3a09bebc4b82a04c078670e5331d /sys/kern/kern_malloc_debug.c
parentIf a removable device refuses to process PREVENT_ALLOW to lock the (diff)
downloadwireguard-openbsd-65d6360cb5c0772769017c581ffa58e5b47fe546.tar.xz
wireguard-openbsd-65d6360cb5c0772769017c581ffa58e5b47fe546.zip
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/kern/kern_malloc_debug.c')
-rw-r--r--sys/kern/kern_malloc_debug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_malloc_debug.c b/sys/kern/kern_malloc_debug.c
index f5a2bb48f1c..4f29840ee10 100644
--- a/sys/kern/kern_malloc_debug.c
+++ b/sys/kern/kern_malloc_debug.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_malloc_debug.c,v 1.25 2007/04/11 12:10:42 art Exp $ */
+/* $OpenBSD: kern_malloc_debug.c,v 1.26 2007/04/13 18:57:49 art Exp $ */
/*
* Copyright (c) 1999, 2000 Artur Grabowski <art@openbsd.org>
@@ -251,7 +251,7 @@ debug_malloc_allocate_free(int wait)
for (;;) {
pg = uvm_pagealloc(NULL, 0, NULL, 0);
if (pg) {
- pg->pg_flags &= ~PG_BUSY; /* new page */
+ atomic_clearbits_int(&pg->pg_flags, PG_BUSY);
UVM_PAGE_OWN(pg, NULL);
}