| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: vm.c,v 1.124 2012/03/05 13:43:56 para Exp $ */ | | 1 | /* $NetBSD: vm.c,v 1.125 2012/03/17 17:58:38 hannken Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. | | 4 | * Copyright (c) 2007-2011 Antti Kantee. All Rights Reserved. |
5 | * | | 5 | * |
6 | * Development of this software was supported by | | 6 | * Development of this software was supported by |
7 | * The Finnish Cultural Foundation and the Research Foundation of | | 7 | * The Finnish Cultural Foundation and the Research Foundation of |
8 | * The Helsinki University of Technology. | | 8 | * The Helsinki University of Technology. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -31,27 +31,27 @@ | | | @@ -31,27 +31,27 @@ |
31 | | | 31 | |
32 | /* | | 32 | /* |
33 | * Virtual memory emulation routines. | | 33 | * Virtual memory emulation routines. |
34 | */ | | 34 | */ |
35 | | | 35 | |
36 | /* | | 36 | /* |
37 | * XXX: we abuse pg->uanon for the virtual address of the storage | | 37 | * XXX: we abuse pg->uanon for the virtual address of the storage |
38 | * for each page. phys_addr would fit the job description better, | | 38 | * for each page. phys_addr would fit the job description better, |
39 | * except that it will create unnecessary lossage on some platforms | | 39 | * except that it will create unnecessary lossage on some platforms |
40 | * due to not being a pointer type. | | 40 | * due to not being a pointer type. |
41 | */ | | 41 | */ |
42 | | | 42 | |
43 | #include <sys/cdefs.h> | | 43 | #include <sys/cdefs.h> |
44 | __KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.124 2012/03/05 13:43:56 para Exp $"); | | 44 | __KERNEL_RCSID(0, "$NetBSD: vm.c,v 1.125 2012/03/17 17:58:38 hannken Exp $"); |
45 | | | 45 | |
46 | #include <sys/param.h> | | 46 | #include <sys/param.h> |
47 | #include <sys/atomic.h> | | 47 | #include <sys/atomic.h> |
48 | #include <sys/buf.h> | | 48 | #include <sys/buf.h> |
49 | #include <sys/kernel.h> | | 49 | #include <sys/kernel.h> |
50 | #include <sys/kmem.h> | | 50 | #include <sys/kmem.h> |
51 | #include <sys/vmem.h> | | 51 | #include <sys/vmem.h> |
52 | #include <sys/mman.h> | | 52 | #include <sys/mman.h> |
53 | #include <sys/null.h> | | 53 | #include <sys/null.h> |
54 | #include <sys/vnode.h> | | 54 | #include <sys/vnode.h> |
55 | | | 55 | |
56 | #include <machine/pmap.h> | | 56 | #include <machine/pmap.h> |
57 | | | 57 | |
| @@ -1100,27 +1100,26 @@ uvm_pageout(void *arg) | | | @@ -1100,27 +1100,26 @@ uvm_pageout(void *arg) |
1100 | } | | 1100 | } |
1101 | | | 1101 | |
1102 | /* | | 1102 | /* |
1103 | * Need to use PYEC on our bag of tricks. | | 1103 | * Need to use PYEC on our bag of tricks. |
1104 | * Unfortunately, the wife just borrowed it. | | 1104 | * Unfortunately, the wife just borrowed it. |
1105 | */ | | 1105 | */ |
1106 | | | 1106 | |
1107 | mutex_enter(&pdaemonmtx); | | 1107 | mutex_enter(&pdaemonmtx); |
1108 | if (!succ && cleaned == 0 && pdaemon_waiters && | | 1108 | if (!succ && cleaned == 0 && pdaemon_waiters && |
1109 | uvmexp.paging == 0) { | | 1109 | uvmexp.paging == 0) { |
1110 | rumpuser_dprintf("pagedaemoness: failed to reclaim " | | 1110 | rumpuser_dprintf("pagedaemoness: failed to reclaim " |
1111 | "memory ... sleeping (deadlock?)\n"); | | 1111 | "memory ... sleeping (deadlock?)\n"); |
1112 | cv_timedwait(&pdaemoncv, &pdaemonmtx, hz); | | 1112 | cv_timedwait(&pdaemoncv, &pdaemonmtx, hz); |
1113 | mutex_enter(&pdaemonmtx); | | | |
1114 | } | | 1113 | } |
1115 | } | | 1114 | } |
1116 | | | 1115 | |
1117 | panic("you can swap out any time you like, but you can never leave"); | | 1116 | panic("you can swap out any time you like, but you can never leave"); |
1118 | } | | 1117 | } |
1119 | | | 1118 | |
1120 | void | | 1119 | void |
1121 | uvm_kick_pdaemon() | | 1120 | uvm_kick_pdaemon() |
1122 | { | | 1121 | { |
1123 | | | 1122 | |
1124 | /* | | 1123 | /* |
1125 | * Wake up the diabolical pagedaemon director if we are over | | 1124 | * Wake up the diabolical pagedaemon director if we are over |
1126 | * 90% of the memory limit. This is a complete and utter | | 1125 | * 90% of the memory limit. This is a complete and utter |