Sat Apr 11 19:24:13 2015 UTC ()
Allow changing the per-cpu emergency page reservation via kernel config.


(joerg)
diff -r1.22 -r1.23 src/sys/uvm/files.uvm
diff -r1.186 -r1.187 src/sys/uvm/uvm_page.c

cvs diff -r1.22 -r1.23 src/sys/uvm/files.uvm (expand / switch to unified diff)

--- src/sys/uvm/files.uvm 2014/10/10 09:01:01 1.22
+++ src/sys/uvm/files.uvm 2015/04/11 19:24:13 1.23
@@ -1,20 +1,20 @@ @@ -1,20 +1,20 @@
1# $NetBSD: files.uvm,v 1.22 2014/10/10 09:01:01 uebayasi Exp $ 1# $NetBSD: files.uvm,v 1.23 2015/04/11 19:24:13 joerg Exp $
2 2
3# 3#
4# UVM options 4# UVM options
5#  5#
6defflag opt_uvmhist.h UVMHIST UVMHIST_PRINT: KERNHIST 6defflag opt_uvmhist.h UVMHIST UVMHIST_PRINT: KERNHIST
7defflag opt_uvm.h USE_TOPDOWN_VM UVMMAP_COUNTERS 7defflag opt_uvm.h USE_TOPDOWN_VM UVMMAP_COUNTERS UVM_RESERVED_PAGES_PER_CPU
8defflag opt_vmswap.h VMSWAP 8defflag opt_vmswap.h VMSWAP
9defflag opt_readahead.h READAHEAD_STATS 9defflag opt_readahead.h READAHEAD_STATS
10defflag opt_ubc.h UBC_STATS 10defflag opt_ubc.h UBC_STATS
11defparam opt_pagermap.h PAGER_MAP_SIZE 11defparam opt_pagermap.h PAGER_MAP_SIZE
12defflag PDPOLICY_CLOCKPRO 12defflag PDPOLICY_CLOCKPRO
13defparam USER_VA0_DISABLE_DEFAULT 13defparam USER_VA0_DISABLE_DEFAULT
14defflag opt_uvm_page_trkown.h UVM_PAGE_TRKOWN 14defflag opt_uvm_page_trkown.h UVM_PAGE_TRKOWN
15 15
16define uvm 16define uvm
17defflag opt_uvm.h UVM 17defflag opt_uvm.h UVM
18file uvm/uvm_amap.c uvm 18file uvm/uvm_amap.c uvm
19file uvm/uvm_anon.c uvm 19file uvm/uvm_anon.c uvm
20file uvm/uvm_aobj.c uvm 20file uvm/uvm_aobj.c uvm

cvs diff -r1.186 -r1.187 src/sys/uvm/uvm_page.c (expand / switch to unified diff)

--- src/sys/uvm/uvm_page.c 2014/09/05 05:36:21 1.186
+++ src/sys/uvm/uvm_page.c 2015/04/11 19:24:13 1.187
@@ -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_
97int vm_nphysseg = 0; /* XXXCDC: uvm.nphysseg */ 98int 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 */
105bool vm_page_zero_enable = false; 106bool 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 */
110int vm_page_reserve_kernel = 5; 111#ifndef UVM_RESERVED_PAGES_PER_CPU
 112#define UVM_RESERVED_PAGES_PER_CPU 5
 113#endif
 114int vm_page_reserve_kernel = UVM_RESERVED_PAGES_PER_CPU;
111 115
112/* 116/*
113 * physical memory size; 117 * physical memory size;
114 */ 118 */
115int physmem; 119int 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