diff options
| author | 2009-05-04 18:08:06 +0000 | |
|---|---|---|
| committer | 2009-05-04 18:08:06 +0000 | |
| commit | ae4e7dc1930a627c966c69c4bddb97289c8cc9f6 (patch) | |
| tree | c106fab7bd429c02f5f82323eca2fd4c86a2c129 | |
| parent | in IPSEC BRIDGE: (diff) | |
| download | wireguard-openbsd-ae4e7dc1930a627c966c69c4bddb97289c8cc9f6.tar.xz wireguard-openbsd-ae4e7dc1930a627c966c69c4bddb97289c8cc9f6.zip | |
Instead of keeping two ints in the uvm structure specifically just to
sleep on them (and otherwise ignore them) sleep on the pointer to the
{aiodoned,pagedaemon}_proc members, and nuke the two extra words.
"no objections" art@, ok beck@.
| -rw-r--r-- | sys/uvm/uvm.h | 12 | ||||
| -rw-r--r-- | sys/uvm/uvm_page.c | 4 | ||||
| -rw-r--r-- | sys/uvm/uvm_pager.c | 4 | ||||
| -rw-r--r-- | sys/uvm/uvm_pdaemon.c | 12 | ||||
| -rw-r--r-- | sys/uvm/uvm_pglist.c | 6 |
5 files changed, 18 insertions, 20 deletions
diff --git a/sys/uvm/uvm.h b/sys/uvm/uvm.h index 9ee29c513d0..3efcf89044c 100644 --- a/sys/uvm/uvm.h +++ b/sys/uvm/uvm.h @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm.h,v 1.31 2009/04/28 16:06:07 miod Exp $ */ +/* $OpenBSD: uvm.h,v 1.32 2009/05/04 18:08:06 oga Exp $ */ /* $NetBSD: uvm.h,v 1.24 2000/11/27 08:40:02 chs Exp $ */ /* @@ -87,13 +87,11 @@ struct uvm { boolean_t page_idle_zero; /* TRUE if we should try to zero pages in the idle loop */ - /* page daemon trigger */ - int pagedaemon; /* daemon sleeps on this */ - struct proc *pagedaemon_proc; /* daemon's pid */ + /* page daemon's pid, we sleep on the pointer to this. */ + struct proc *pagedaemon_proc; - /* aiodone daemon trigger */ - int aiodoned; /* daemon sleeps on this */ - struct proc *aiodoned_proc; /* daemon's pid */ + /* aiodone daemon's pid, we sleep on the pointer to this. */ + struct proc *aiodoned_proc; struct mutex aiodoned_lock; /* page hash */ diff --git a/sys/uvm/uvm_page.c b/sys/uvm/uvm_page.c index 470209cf8e8..961dc193cb1 100644 --- a/sys/uvm/uvm_page.c +++ b/sys/uvm/uvm_page.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_page.c,v 1.77 2009/05/01 20:44:22 oga Exp $ */ +/* $OpenBSD: uvm_page.c,v 1.78 2009/05/04 18:08:06 oga Exp $ */ /* $NetBSD: uvm_page.c,v 1.44 2000/11/27 08:40:04 chs Exp $ */ /* @@ -911,7 +911,7 @@ uvm_pagealloc_strat(struct uvm_object *obj, voff_t off, struct vm_anon *anon, if ((uvmexp.free - BUFPAGES_DEFICIT) < uvmexp.freemin || ((uvmexp.free - BUFPAGES_DEFICIT) < uvmexp.freetarg && uvmexp.inactive < uvmexp.inactarg)) - wakeup(&uvm.pagedaemon); + wakeup(&uvm.pagedaemon_proc); /* * fail if any of these conditions is true: diff --git a/sys/uvm/uvm_pager.c b/sys/uvm/uvm_pager.c index 5d66c693740..70afe2ffa8b 100644 --- a/sys/uvm/uvm_pager.c +++ b/sys/uvm/uvm_pager.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pager.c,v 1.49 2009/04/06 12:02:52 oga Exp $ */ +/* $OpenBSD: uvm_pager.c,v 1.50 2009/05/04 18:08:06 oga Exp $ */ /* $NetBSD: uvm_pager.c,v 1.36 2000/11/27 18:26:41 chs Exp $ */ /* @@ -856,7 +856,7 @@ uvm_aio_biodone(struct buf *bp) mtx_enter(&uvm.aiodoned_lock); /* locks uvm.aio_done */ TAILQ_INSERT_TAIL(&uvm.aio_done, bp, b_freelist); - wakeup(&uvm.aiodoned); + wakeup(&uvm.aiodoned_proc); mtx_leave(&uvm.aiodoned_lock); } diff --git a/sys/uvm/uvm_pdaemon.c b/sys/uvm/uvm_pdaemon.c index 499c28454ee..e5b88326899 100644 --- a/sys/uvm/uvm_pdaemon.c +++ b/sys/uvm/uvm_pdaemon.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pdaemon.c,v 1.42 2009/04/17 07:14:04 oga Exp $ */ +/* $OpenBSD: uvm_pdaemon.c,v 1.43 2009/05/04 18:08:06 oga Exp $ */ /* $NetBSD: uvm_pdaemon.c,v 1.23 2000/08/20 10:24:14 bjh21 Exp $ */ /* @@ -143,7 +143,7 @@ uvm_wait(const char *wmsg) } uvm_lock_fpageq(); - wakeup(&uvm.pagedaemon); /* wake the daemon! */ + wakeup(&uvm.pagedaemon_proc); /* wake the daemon! */ msleep(&uvmexp.free, &uvm.fpageqlock, PVM | PNORELOCK, wmsg, timo); } @@ -214,7 +214,7 @@ uvm_pageout(void *arg) for (;;) { uvm_lock_fpageq(); UVMHIST_LOG(pdhist," <<SLEEPING>>",0,0,0,0); - msleep(&uvm.pagedaemon, &uvm.fpageqlock, PVM | PNORELOCK, + msleep(&uvm.pagedaemon_proc, &uvm.fpageqlock, PVM | PNORELOCK, "pgdaemon", 0); uvmexp.pdwoke++; UVMHIST_LOG(pdhist," <<WOKE UP>>",0,0,0,0); @@ -288,7 +288,7 @@ uvm_aiodone_daemon(void *arg) */ mtx_enter(&uvm.aiodoned_lock); while ((bp = TAILQ_FIRST(&uvm.aio_done)) == NULL) - msleep(&uvm.aiodoned, &uvm.aiodoned_lock, + msleep(&uvm.aiodoned_proc, &uvm.aiodoned_lock, PVM, "aiodoned", 0); /* Take the list for ourselves. */ TAILQ_INIT(&uvm.aio_done); @@ -310,8 +310,8 @@ uvm_aiodone_daemon(void *arg) bp = nbp; } uvm_lock_fpageq(); - wakeup(free <= uvmexp.reserve_kernel ? &uvm.pagedaemon : - &uvmexp.free); + wakeup(free <= uvmexp.reserve_kernel ? + (void *)&uvm.pagedaemon_proc : (void *)&uvmexp.free); uvm_unlock_fpageq(); } } diff --git a/sys/uvm/uvm_pglist.c b/sys/uvm/uvm_pglist.c index d48f85c5552..093cd134b7f 100644 --- a/sys/uvm/uvm_pglist.c +++ b/sys/uvm/uvm_pglist.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uvm_pglist.c,v 1.28 2009/04/30 09:06:01 oga Exp $ */ +/* $OpenBSD: uvm_pglist.c,v 1.29 2009/05/04 18:08:06 oga Exp $ */ /* $NetBSD: uvm_pglist.c,v 1.13 2001/02/18 21:19:08 chs Exp $ */ /*- @@ -151,7 +151,7 @@ out: if (!error && (uvmexp.free + uvmexp.paging < uvmexp.freemin || (uvmexp.free + uvmexp.paging < uvmexp.freetarg && uvmexp.inactive < uvmexp.inactarg))) { - wakeup(&uvm.pagedaemon); + wakeup(&uvm.pagedaemon_proc); } uvm_unlock_fpageq(); @@ -358,7 +358,7 @@ out: if (uvmexp.free + uvmexp.paging < uvmexp.freemin || (uvmexp.free + uvmexp.paging < uvmexp.freetarg && uvmexp.inactive < uvmexp.inactarg)) { - wakeup(&uvm.pagedaemon); + wakeup(&uvm.pagedaemon_proc); } uvm_unlock_fpageq(); |
