summaryrefslogtreecommitdiff
path: root/sys/uvm
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2013-05-30 16:39:27 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2013-05-30 16:39:27 +0000
commit5586745861b37857799b4d913397195318e28d15 (patch)
tree3c8ad68572838e0b93533eb46fb79a97e12bbe5f /sys/uvm
parentaf3070bdd7597a04785c2e13047f208c8cdac9af (diff)
UVM_UNLOCK_AND_WAIT no longer unlocks, so rename it to UVM_WAIT.
Diffstat (limited to 'sys/uvm')
-rw-r--r--sys/uvm/uvm.h7
-rw-r--r--sys/uvm/uvm_amap.c5
-rw-r--r--sys/uvm/uvm_aobj.c11
-rw-r--r--sys/uvm/uvm_fault.c9
-rw-r--r--sys/uvm/uvm_km.c5
-rw-r--r--sys/uvm/uvm_vnode.c23
6 files changed, 22 insertions, 38 deletions
diff --git a/sys/uvm/uvm.h b/sys/uvm/uvm.h
index 4f2810ae702..c51d8cabab0 100644
--- a/sys/uvm/uvm.h
+++ b/sys/uvm/uvm.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm.h,v 1.50 2013/05/30 16:29:46 tedu Exp $ */
+/* $OpenBSD: uvm.h,v 1.51 2013/05/30 16:39:26 tedu Exp $ */
/* $NetBSD: uvm.h,v 1.24 2000/11/27 08:40:02 chs Exp $ */
/*
@@ -130,11 +130,10 @@ struct uvm {
extern struct uvm uvm;
/*
- * UVM_UNLOCK_AND_WAIT: atomic unlock+wait... wrapper around the
- * interlocked tsleep() function.
+ * UVM_WAIT: wait... wrapper around the tsleep() function.
*/
-#define UVM_UNLOCK_AND_WAIT(event, slock, intr, msg, timo) \
+#define UVM_WAIT(event, intr, msg, timo) \
do { \
tsleep(event, PVM|PNORELOCK|(intr ? PCATCH : 0), msg, timo); \
} while (0)
diff --git a/sys/uvm/uvm_amap.c b/sys/uvm/uvm_amap.c
index 813cb06a9a9..dd525d73c7a 100644
--- a/sys/uvm/uvm_amap.c
+++ b/sys/uvm/uvm_amap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_amap.c,v 1.49 2013/05/30 16:29:46 tedu Exp $ */
+/* $OpenBSD: uvm_amap.c,v 1.50 2013/05/30 16:39:26 tedu Exp $ */
/* $NetBSD: uvm_amap.c,v 1.27 2000/11/25 06:27:59 chs Exp $ */
/*
@@ -714,8 +714,7 @@ ReStart:
*/
if (pg->pg_flags & PG_BUSY) {
atomic_setbits_int(&pg->pg_flags, PG_WANTED);
- UVM_UNLOCK_AND_WAIT(pg, &anon->an_lock, FALSE,
- "cownow", 0);
+ UVM_WAIT(pg, FALSE, "cownow", 0);
goto ReStart;
}
diff --git a/sys/uvm/uvm_aobj.c b/sys/uvm/uvm_aobj.c
index 824ac7b9445..dd8cb3ddc1e 100644
--- a/sys/uvm/uvm_aobj.c
+++ b/sys/uvm/uvm_aobj.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_aobj.c,v 1.57 2013/05/30 16:29:46 tedu Exp $ */
+/* $OpenBSD: uvm_aobj.c,v 1.58 2013/05/30 16:39:26 tedu Exp $ */
/* $NetBSD: uvm_aobj.c,v 1.39 2001/02/18 21:19:08 chs Exp $ */
/*
@@ -629,8 +629,7 @@ uao_detach_locked(struct uvm_object *uobj)
if (pg->pg_flags & PG_BUSY) {
atomic_setbits_int(&pg->pg_flags, PG_WANTED);
uvm_unlock_pageq();
- UVM_UNLOCK_AND_WAIT(pg, &uobj->vmobjlock, 0,
- "uao_det", 0);
+ UVM_WAIT(pg, 0, "uao_det", 0);
uvm_lock_pageq();
continue;
}
@@ -703,8 +702,7 @@ uao_flush(struct uvm_object *uobj, voff_t start, voff_t stop, int flags)
/* Make sure page is unbusy, else wait for it. */
if (pp->pg_flags & PG_BUSY) {
atomic_setbits_int(&pp->pg_flags, PG_WANTED);
- UVM_UNLOCK_AND_WAIT(pp, &uobj->vmobjlock, 0,
- "uaoflsh", 0);
+ UVM_WAIT(pp, 0, "uaoflsh", 0);
curoff -= PAGE_SIZE;
continue;
}
@@ -945,8 +943,7 @@ uao_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps,
/* page is there, see if we need to wait on it */
if ((ptmp->pg_flags & PG_BUSY) != 0) {
atomic_setbits_int(&ptmp->pg_flags, PG_WANTED);
- UVM_UNLOCK_AND_WAIT(ptmp, &uobj->vmobjlock,
- FALSE, "uao_get", 0);
+ UVM_WAIT(ptmp, FALSE, "uao_get", 0);
continue; /* goto top of pps while loop */
}
diff --git a/sys/uvm/uvm_fault.c b/sys/uvm/uvm_fault.c
index 2f802f99ab0..d36a3c95d64 100644
--- a/sys/uvm/uvm_fault.c
+++ b/sys/uvm/uvm_fault.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_fault.c,v 1.67 2013/05/30 16:29:46 tedu Exp $ */
+/* $OpenBSD: uvm_fault.c,v 1.68 2013/05/30 16:39:26 tedu Exp $ */
/* $NetBSD: uvm_fault.c,v 1.51 2000/08/06 00:22:53 thorpej Exp $ */
/*
@@ -341,14 +341,11 @@ uvmfault_anonget(struct uvm_faultinfo *ufi, struct vm_amap *amap,
*/
if (pg->uobject) { /* owner is uobject ? */
uvmfault_unlockall(ufi, amap, NULL, anon);
- UVM_UNLOCK_AND_WAIT(pg,
- &pg->uobject->vmobjlock,
- FALSE, "anonget1",0);
+ UVM_WAIT(pg, FALSE, "anonget1",0);
} else {
/* anon owns page */
uvmfault_unlockall(ufi, amap, NULL, NULL);
- UVM_UNLOCK_AND_WAIT(pg,&anon->an_lock,0,
- "anonget2",0);
+ UVM_WAIT(pg, 0, "anonget2", 0);
}
/* ready to relock and try again */
diff --git a/sys/uvm/uvm_km.c b/sys/uvm/uvm_km.c
index 2c8af0aa25d..31baf5ad44e 100644
--- a/sys/uvm/uvm_km.c
+++ b/sys/uvm/uvm_km.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_km.c,v 1.109 2013/05/30 15:17:59 tedu Exp $ */
+/* $OpenBSD: uvm_km.c,v 1.110 2013/05/30 16:39:26 tedu Exp $ */
/* $NetBSD: uvm_km.c,v 1.42 2001/01/14 02:10:01 thorpej Exp $ */
/*
@@ -280,8 +280,7 @@ uvm_km_pgremove(struct uvm_object *uobj, vaddr_t start, vaddr_t end)
pp = uvm_pagelookup(uobj, curoff);
if (pp && pp->pg_flags & PG_BUSY) {
atomic_setbits_int(&pp->pg_flags, PG_WANTED);
- UVM_UNLOCK_AND_WAIT(pp, &uobj->vmobjlock, 0,
- "km_pgrm", 0);
+ UVM_WAIT(pp, 0, "km_pgrm", 0);
curoff -= PAGE_SIZE; /* loop back to us */
continue;
}
diff --git a/sys/uvm/uvm_vnode.c b/sys/uvm/uvm_vnode.c
index 54d92263a86..53ac0c39c9f 100644
--- a/sys/uvm/uvm_vnode.c
+++ b/sys/uvm/uvm_vnode.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uvm_vnode.c,v 1.78 2013/05/30 16:29:46 tedu Exp $ */
+/* $OpenBSD: uvm_vnode.c,v 1.79 2013/05/30 16:39:26 tedu Exp $ */
/* $NetBSD: uvm_vnode.c,v 1.36 2000/11/24 20:34:01 chs Exp $ */
/*
@@ -160,8 +160,7 @@ uvn_attach(void *arg, vm_prot_t accessprot)
*/
while (uvn->u_flags & UVM_VNODE_BLOCKED) {
uvn->u_flags |= UVM_VNODE_WANTED;
- UVM_UNLOCK_AND_WAIT(uvn, &uvn->u_obj.vmobjlock, FALSE,
- "uvn_attach", 0);
+ UVM_WAIT(uvn, FALSE, "uvn_attach", 0);
}
/*
@@ -378,8 +377,7 @@ uvn_detach(struct uvm_object *uobj)
/* wait on any outstanding io */
while (uobj->uo_npages && uvn->u_flags & UVM_VNODE_RELKILL) {
uvn->u_flags |= UVM_VNODE_IOSYNC;
- UVM_UNLOCK_AND_WAIT(&uvn->u_nio, &uvn->u_obj.vmobjlock, FALSE,
- "uvn_term",0);
+ UVM_WAIT(&uvn->u_nio, FALSE, "uvn_term", 0);
}
if ((uvn->u_flags & UVM_VNODE_RELKILL) == 0)
@@ -513,8 +511,7 @@ uvm_vnp_terminate(struct vnode *vp)
*/
#endif
uvn->u_flags |= UVM_VNODE_IOSYNC;
- UVM_UNLOCK_AND_WAIT(&uvn->u_nio, &uvn->u_obj.vmobjlock, FALSE,
- "uvn_term",0);
+ UVM_WAIT(&uvn->u_nio, FALSE, "uvn_term", 0);
}
/*
@@ -721,8 +718,7 @@ uvn_flush(struct uvm_object *uobj, voff_t start, voff_t stop, int flags)
atomic_setbits_int(&pp->pg_flags,
PG_WANTED);
uvm_unlock_pageq();
- UVM_UNLOCK_AND_WAIT(pp,
- &uobj->vmobjlock, 0, "uvn_flsh", 0);
+ UVM_WAIT(pp, 0, "uvn_flsh", 0);
uvm_lock_pageq();
curoff -= PAGE_SIZE;
continue;
@@ -883,8 +879,7 @@ ReTry:
if (need_iosync) {
while (uvn->u_nio != 0) {
uvn->u_flags |= UVM_VNODE_IOSYNC;
- UVM_UNLOCK_AND_WAIT(&uvn->u_nio, &uvn->u_obj.vmobjlock,
- FALSE, "uvn_flush",0);
+ UVM_WAIT(&uvn->u_nio, FALSE, "uvn_flush", 0);
}
if (uvn->u_flags & UVM_VNODE_IOSYNCWANTED)
wakeup(&uvn->u_flags);
@@ -1100,8 +1095,7 @@ uvn_get(struct uvm_object *uobj, voff_t offset, struct vm_page **pps,
/* page is there, see if we need to wait on it */
if ((ptmp->pg_flags & PG_BUSY) != 0) {
atomic_setbits_int(&ptmp->pg_flags, PG_WANTED);
- UVM_UNLOCK_AND_WAIT(ptmp,
- &uobj->vmobjlock, FALSE, "uvn_get",0);
+ UVM_WAIT(ptmp, FALSE, "uvn_get", 0);
continue; /* goto top of pps while loop */
}
@@ -1209,8 +1203,7 @@ uvn_io(struct uvm_vnode *uvn, vm_page_t *pps, int npages, int flags, int rw)
return(VM_PAGER_AGAIN);
}
uvn->u_flags |= UVM_VNODE_IOSYNCWANTED;
- UVM_UNLOCK_AND_WAIT(&uvn->u_flags, &uvn->u_obj.vmobjlock,
- FALSE, "uvn_iosync",0);
+ UVM_WAIT(&uvn->u_flags, FALSE, "uvn_iosync", 0);
}
/*