aboutsummaryrefslogtreecommitdiff
path: root/sys/vm/vm_page.h
diff options
context:
space:
mode:
authorAlan Cox <alc@FreeBSD.org>2009-10-04 18:53:10 +0000
committerAlan Cox <alc@FreeBSD.org>2009-10-04 18:53:10 +0000
commite67e0775e6f7f349bb1dca6b821a265499b9def8 (patch)
treebe275d228074caa6157dd1b24163b60d48a2a2c5 /sys/vm/vm_page.h
parenta7835d55789d1100d12c2940f57430e5d22df9b5 (diff)
downloadsrc-e67e0775e6f7f349bb1dca6b821a265499b9def8.tar.gz
src-e67e0775e6f7f349bb1dca6b821a265499b9def8.zip
Align and pad the page queue and free page queue locks so that the linker
can't possibly place them together within the same cache line. MFC after: 3 weeks
Notes
Notes: svn path=/head/; revision=197750
Diffstat (limited to 'sys/vm/vm_page.h')
-rw-r--r--sys/vm/vm_page.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h
index b1b1070ae48d..662af98be83a 100644
--- a/sys/vm/vm_page.h
+++ b/sys/vm/vm_page.h
@@ -170,7 +170,15 @@ struct vpgqueues {
};
extern struct vpgqueues vm_page_queues[PQ_COUNT];
-extern struct mtx vm_page_queue_free_mtx;
+
+struct vpglocks {
+ struct mtx data;
+ char pad[CACHE_LINE_SIZE - sizeof(struct mtx)];
+} __aligned(CACHE_LINE_SIZE);
+
+extern struct vpglocks vm_page_queue_free_lock;
+
+#define vm_page_queue_free_mtx vm_page_queue_free_lock.data
/*
* These are the flags defined for vm_page.
@@ -258,7 +266,9 @@ PHYS_TO_VM_PAGE(vm_paddr_t pa)
#endif
}
-extern struct mtx vm_page_queue_mtx;
+extern struct vpglocks vm_page_queue_lock;
+
+#define vm_page_queue_mtx vm_page_queue_lock.data
#define vm_page_lock_queues() mtx_lock(&vm_page_queue_mtx)
#define vm_page_unlock_queues() mtx_unlock(&vm_page_queue_mtx)