diff options
Diffstat (limited to 'sys/vm')
-rw-r--r-- | sys/vm/vm_page.c | 4 | ||||
-rw-r--r-- | sys/vm/vm_page.h | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ac363b7..c6bcfa0 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -135,8 +135,8 @@ __FBSDID("$FreeBSD$"); */ struct vpgqueues vm_page_queues[PQ_COUNT]; -struct mtx vm_page_queue_mtx; -struct mtx vm_page_queue_free_mtx; +struct vpglocks vm_page_queue_lock; +struct vpglocks vm_page_queue_free_lock; vm_page_t vm_page_array = 0; int vm_page_array_size = 0; diff --git a/sys/vm/vm_page.h b/sys/vm/vm_page.h index b1b1070..662af98 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) |