| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: uvm_page.c,v 1.186 2014/09/05 05:36:21 matt Exp $ */ | | 1 | /* $NetBSD: uvm_page.c,v 1.187 2015/04/11 19:24:13 joerg Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright (c) 1997 Charles D. Cranor and Washington University. | | 4 | * Copyright (c) 1997 Charles D. Cranor and Washington University. |
5 | * Copyright (c) 1991, 1993, The Regents of the University of California. | | 5 | * Copyright (c) 1991, 1993, The Regents of the University of California. |
6 | * | | 6 | * |
7 | * All rights reserved. | | 7 | * All rights reserved. |
8 | * | | 8 | * |
9 | * This code is derived from software contributed to Berkeley by | | 9 | * This code is derived from software contributed to Berkeley by |
10 | * The Mach Operating System project at Carnegie-Mellon University. | | 10 | * The Mach Operating System project at Carnegie-Mellon University. |
11 | * | | 11 | * |
12 | * Redistribution and use in source and binary forms, with or without | | 12 | * Redistribution and use in source and binary forms, with or without |
13 | * modification, are permitted provided that the following conditions | | 13 | * modification, are permitted provided that the following conditions |
14 | * are met: | | 14 | * are met: |
| @@ -56,29 +56,30 @@ | | | @@ -56,29 +56,30 @@ |
56 | * School of Computer Science | | 56 | * School of Computer Science |
57 | * Carnegie Mellon University | | 57 | * Carnegie Mellon University |
58 | * Pittsburgh PA 15213-3890 | | 58 | * Pittsburgh PA 15213-3890 |
59 | * | | 59 | * |
60 | * any improvements or extensions that they make and grant Carnegie the | | 60 | * any improvements or extensions that they make and grant Carnegie the |
61 | * rights to redistribute these changes. | | 61 | * rights to redistribute these changes. |
62 | */ | | 62 | */ |
63 | | | 63 | |
64 | /* | | 64 | /* |
65 | * uvm_page.c: page ops. | | 65 | * uvm_page.c: page ops. |
66 | */ | | 66 | */ |
67 | | | 67 | |
68 | #include <sys/cdefs.h> | | 68 | #include <sys/cdefs.h> |
69 | __KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.186 2014/09/05 05:36:21 matt Exp $"); | | 69 | __KERNEL_RCSID(0, "$NetBSD: uvm_page.c,v 1.187 2015/04/11 19:24:13 joerg Exp $"); |
70 | | | 70 | |
71 | #include "opt_ddb.h" | | 71 | #include "opt_ddb.h" |
| | | 72 | #include "opt_uvm.h" |
72 | #include "opt_uvmhist.h" | | 73 | #include "opt_uvmhist.h" |
73 | #include "opt_readahead.h" | | 74 | #include "opt_readahead.h" |
74 | | | 75 | |
75 | #include <sys/param.h> | | 76 | #include <sys/param.h> |
76 | #include <sys/systm.h> | | 77 | #include <sys/systm.h> |
77 | #include <sys/sched.h> | | 78 | #include <sys/sched.h> |
78 | #include <sys/kernel.h> | | 79 | #include <sys/kernel.h> |
79 | #include <sys/vnode.h> | | 80 | #include <sys/vnode.h> |
80 | #include <sys/proc.h> | | 81 | #include <sys/proc.h> |
81 | #include <sys/atomic.h> | | 82 | #include <sys/atomic.h> |
82 | #include <sys/cpu.h> | | 83 | #include <sys/cpu.h> |
83 | | | 84 | |
84 | #include <uvm/uvm.h> | | 85 | #include <uvm/uvm.h> |
| @@ -97,27 +98,30 @@ struct vm_physseg vm_physmem[VM_PHYSSEG_ | | | @@ -97,27 +98,30 @@ struct vm_physseg vm_physmem[VM_PHYSSEG_ |
97 | int vm_nphysseg = 0; /* XXXCDC: uvm.nphysseg */ | | 98 | int vm_nphysseg = 0; /* XXXCDC: uvm.nphysseg */ |
98 | #define vm_nphysmem vm_nphysseg | | 99 | #define vm_nphysmem vm_nphysseg |
99 | | | 100 | |
100 | /* | | 101 | /* |
101 | * Some supported CPUs in a given architecture don't support all | | 102 | * Some supported CPUs in a given architecture don't support all |
102 | * of the things necessary to do idle page zero'ing efficiently. | | 103 | * of the things necessary to do idle page zero'ing efficiently. |
103 | * We therefore provide a way to enable it from machdep code here. | | 104 | * We therefore provide a way to enable it from machdep code here. |
104 | */ | | 105 | */ |
105 | bool vm_page_zero_enable = false; | | 106 | bool vm_page_zero_enable = false; |
106 | | | 107 | |
107 | /* | | 108 | /* |
108 | * number of pages per-CPU to reserve for the kernel. | | 109 | * number of pages per-CPU to reserve for the kernel. |
109 | */ | | 110 | */ |
110 | int vm_page_reserve_kernel = 5; | | 111 | #ifndef UVM_RESERVED_PAGES_PER_CPU |
| | | 112 | #define UVM_RESERVED_PAGES_PER_CPU 5 |
| | | 113 | #endif |
| | | 114 | int vm_page_reserve_kernel = UVM_RESERVED_PAGES_PER_CPU; |
111 | | | 115 | |
112 | /* | | 116 | /* |
113 | * physical memory size; | | 117 | * physical memory size; |
114 | */ | | 118 | */ |
115 | int physmem; | | 119 | int physmem; |
116 | | | 120 | |
117 | /* | | 121 | /* |
118 | * local variables | | 122 | * local variables |
119 | */ | | 123 | */ |
120 | | | 124 | |
121 | /* | | 125 | /* |
122 | * these variables record the values returned by vm_page_bootstrap, | | 126 | * these variables record the values returned by vm_page_bootstrap, |
123 | * for debugging purposes. The implementation of uvm_pageboot_alloc | | 127 | * for debugging purposes. The implementation of uvm_pageboot_alloc |