From e0c5a895f10159ad75f2fdc76804a8eeb4298655 Mon Sep 17 00:00:00 2001 From: John Dyson Date: Thu, 28 Nov 1996 23:15:07 +0000 Subject: [PATCH] Make the kernel smaller with at worst a neutral effect on perf by de-inlining some VM calls. (Actually, I measured a small improvement.) --- sys/vm/vm_page.c | 22 +++++++++++++++++++++- sys/vm/vm_pageout.c | 11 ++++++++++- sys/vm/vm_pageout.h | 35 +++-------------------------------- 3 files changed, 34 insertions(+), 34 deletions(-) diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index ea0e13922a6b..b39660b74694 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)vm_page.c 7.4 (Berkeley) 5/7/91 - * $Id: vm_page.c,v 1.70 1996/11/05 04:19:08 dyson Exp $ + * $Id: vm_page.c,v 1.71 1996/11/17 02:38:31 dyson Exp $ */ /* @@ -874,6 +874,26 @@ vm_page_alloc(object, pindex, page_req) return (m); } +void +vm_wait() +{ + int s; + + s = splvm(); + if (curproc == pageproc) { + vm_pageout_pages_needed = 1; + tsleep(&vm_pageout_pages_needed, PSWP, "vmwait", 0); + } else { + if (!vm_pages_needed) { + vm_pages_needed++; + wakeup(&vm_pages_needed); + } + tsleep(&cnt.v_free_count, PVM, "vmwait", 0); + } + splx(s); +} + + /* * vm_page_activate: * diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 3e9ef335c2af..8b20f09c669a 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -65,7 +65,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pageout.c,v 1.85 1996/09/08 20:44:48 dyson Exp $ + * $Id: vm_pageout.c,v 1.86 1996/09/28 03:33:40 dyson Exp $ */ /* @@ -1015,6 +1015,15 @@ vm_pageout() } } +void +pagedaemon_wakeup() +{ + if (!vm_pages_needed && curproc != pageproc) { + vm_pages_needed++; + wakeup(&vm_pages_needed); + } +} + #if !defined(NO_SWAPPING) static void vm_req_vmdaemon() diff --git a/sys/vm/vm_pageout.h b/sys/vm/vm_pageout.h index f17720b778d1..469482910baa 100644 --- a/sys/vm/vm_pageout.h +++ b/sys/vm/vm_pageout.h @@ -61,7 +61,7 @@ * any improvements or extensions that they make and grant Carnegie the * rights to redistribute these changes. * - * $Id: vm_pageout.h,v 1.16 1995/11/20 12:19:22 phk Exp $ + * $Id: vm_pageout.h,v 1.17 1995/11/21 12:55:26 bde Exp $ */ #ifndef _VM_VM_PAGEOUT_H_ @@ -91,38 +91,9 @@ extern int vm_pageout_pages_needed; * Signal pageout-daemon and wait for it. */ -static void pagedaemon_wakeup __P((void)); -static inline void -pagedaemon_wakeup() -{ - if (!vm_pages_needed && curproc != pageproc) { - vm_pages_needed++; - wakeup(&vm_pages_needed); - } -} - +extern void pagedaemon_wakeup __P((void)); #define VM_WAIT vm_wait() - -static void vm_wait __P((void)); -static inline void -vm_wait() -{ - int s; - - s = splhigh(); - if (curproc == pageproc) { - vm_pageout_pages_needed = 1; - tsleep(&vm_pageout_pages_needed, PSWP, "vmwait", 0); - } else { - if (!vm_pages_needed) { - vm_pages_needed++; - wakeup(&vm_pages_needed); - } - tsleep(&cnt.v_free_count, PVM, "vmwait", 0); - } - splx(s); -} - +extern void vm_wait __P((void)); #ifdef KERNEL void vm_pageout_page __P((vm_page_t, vm_object_t));