summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2009-04-28 16:06:08 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2009-04-28 16:06:08 +0000
commit3168eb0685ed134373290b73c721520a6f17b12f (patch)
tree205ba3c49d5e5a2c189d96c221554f6c896973d7
parentcaf9d3935f6517a1e524920e1d841d80a4b1cc5a (diff)
Revert pageqlock back from a mutex to a simple_lock, as it needs to be
recursive in some cases (mostly involving swapping). A proper fix is in the works, but this will unbreak kernels for now.
-rw-r--r--sys/uvm/uvm.h4
-rw-r--r--sys/uvm/uvm_page.c4
-rw-r--r--sys/uvm/uvm_page.h6
3 files changed, 7 insertions, 7 deletions
diff --git a/sys/uvm/uvm.h b/sys/uvm/uvm.h
index cb447f87f88..9ee29c513d0 100644
--- a/sys/uvm/uvm.h
+++ b/sys/uvm/uvm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm.h,v 1.30 2009/04/14 20:12:05 oga Exp $ */
+/* $OpenBSD: uvm.h,v 1.31 2009/04/28 16:06:07 miod Exp $ */
/* $NetBSD: uvm.h,v 1.24 2000/11/27 08:40:02 chs Exp $ */
/*
@@ -81,7 +81,7 @@ struct uvm {
struct pglist page_inactive_swp;/* pages inactive (reclaim or free) */
struct pglist page_inactive_obj;/* pages inactive (reclaim or free) */
/* Lock order: object lock, pageqlock, then fpageqlock. */
- struct mutex pageqlock; /* lock for active/inactive page q */
+ simple_lock_data_t pageqlock; /* lock for active/inactive page q */
struct mutex fpageqlock; /* lock for free page q + pdaemon */
boolean_t page_init_done; /* TRUE if uvm_page_init() finished */
boolean_t page_idle_zero; /* TRUE if we should try to zero
diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c
index d00119383b7..7d5e8957126 100644
--- a/sys/uvm/uvm_page.c
+++ b/sys/uvm/uvm_page.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_page.c,v 1.75 2009/04/14 20:12:05 oga Exp $ */
+/* $OpenBSD: uvm_page.c,v 1.76 2009/04/28 16:06:07 miod Exp $ */
/* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */
/*
@@ -233,7 +233,7 @@ uvm_page_init(vaddr_t *kvm_startp, vaddr_t *kvm_endp)
TAILQ_INIT(&uvm.page_active);
TAILQ_INIT(&uvm.page_inactive_swp);
TAILQ_INIT(&uvm.page_inactive_obj);
- mtx_init(&uvm.pageqlock, IPL_NONE);
+ simple_lock_init(&uvm.pageqlock);
mtx_init(&uvm.fpageqlock, IPL_VM);
/*
diff --git a/sys/uvm/uvm_page.h b/sys/uvm/uvm_page.h
index b06f464d7ce..e21562cd030 100644
--- a/sys/uvm/uvm_page.h
+++ b/sys/uvm/uvm_page.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_page.h,v 1.31 2009/04/13 22:17:54 oga Exp $ */
+/* $OpenBSD: uvm_page.h,v 1.32 2009/04/28 16:06:07 miod Exp $ */
/* $NetBSD: uvm_page.h,v 1.19 2000/12/28 08:24:55 chs Exp $ */
/*
@@ -304,8 +304,8 @@ int vm_physseg_find(paddr_t, int *);
* macros
*/
-#define uvm_lock_pageq() mtx_enter(&uvm.pageqlock)
-#define uvm_unlock_pageq() mtx_leave(&uvm.pageqlock)
+#define uvm_lock_pageq() simple_lock(&uvm.pageqlock)
+#define uvm_unlock_pageq() simple_unlock(&uvm.pageqlock)
#define uvm_lock_fpageq() mtx_enter(&uvm.fpageqlock);
#define uvm_unlock_fpageq() mtx_leave(&uvm.fpageqlock);