subr_param.c (59588a546f55523d6fd37ab42eb08b719311d7d6) | subr_param.c (9d6ae1e3c26a0c3334a268b587f17dccb9a503d7) |
---|---|
1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 1980, 1986, 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * (c) UNIX System Laboratories, Inc. 7 * All or some portions of this file are derived from material licensed 8 * to the University of California by American Telephone and Telegraph --- 157 unchanged lines hidden (view full) --- 166 167/* 168 * Boot time overrides that are not scaled against main memory 169 */ 170void 171init_param1(void) 172{ 173 | 1/*- 2 * SPDX-License-Identifier: BSD-3-Clause 3 * 4 * Copyright (c) 1980, 1986, 1989, 1993 5 * The Regents of the University of California. All rights reserved. 6 * (c) UNIX System Laboratories, Inc. 7 * All or some portions of this file are derived from material licensed 8 * to the University of California by American Telephone and Telegraph --- 157 unchanged lines hidden (view full) --- 166 167/* 168 * Boot time overrides that are not scaled against main memory 169 */ 170void 171init_param1(void) 172{ 173 |
174 TSENTER(); |
|
174#if !defined(__arm64__) 175 TUNABLE_INT_FETCH("kern.kstack_pages", &kstack_pages); 176#endif 177 hz = -1; 178 TUNABLE_INT_FETCH("kern.hz", &hz); 179 if (hz == -1) 180 hz = vm_guest > VM_GUEST_NO ? HZ_VM : HZ; 181 --- 58 unchanged lines hidden (view full) --- 240 */ 241 TUNABLE_INT_FETCH("kern.pid_max", &pid_max); 242 if (pid_max > PID_MAX) 243 pid_max = PID_MAX; 244 else if (pid_max < 300) 245 pid_max = 300; 246 247 TUNABLE_INT_FETCH("vfs.unmapped_buf_allowed", &unmapped_buf_allowed); | 175#if !defined(__arm64__) 176 TUNABLE_INT_FETCH("kern.kstack_pages", &kstack_pages); 177#endif 178 hz = -1; 179 TUNABLE_INT_FETCH("kern.hz", &hz); 180 if (hz == -1) 181 hz = vm_guest > VM_GUEST_NO ? HZ_VM : HZ; 182 --- 58 unchanged lines hidden (view full) --- 241 */ 242 TUNABLE_INT_FETCH("kern.pid_max", &pid_max); 243 if (pid_max > PID_MAX) 244 pid_max = PID_MAX; 245 else if (pid_max < 300) 246 pid_max = 300; 247 248 TUNABLE_INT_FETCH("vfs.unmapped_buf_allowed", &unmapped_buf_allowed); |
249 TSEXIT(); |
|
248} 249 250/* 251 * Boot time overrides that are scaled against main memory 252 */ 253void 254init_param2(long physpages) 255{ 256 | 250} 251 252/* 253 * Boot time overrides that are scaled against main memory 254 */ 255void 256init_param2(long physpages) 257{ 258 |
259 TSENTER(); |
|
257 /* Base parameters */ 258 maxusers = MAXUSERS; 259 TUNABLE_INT_FETCH("kern.maxusers", &maxusers); 260 if (maxusers == 0) { 261 maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); 262 if (maxusers < 32) 263 maxusers = 32; 264#ifdef VM_MAX_AUTOTUNE_MAXUSERS --- 65 unchanged lines hidden (view full) --- 330 */ 331 maxpipekva = ptoa(physpages / 64); 332 TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); 333 if (maxpipekva < 512 * 1024) 334 maxpipekva = 512 * 1024; 335 if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) 336 maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 337 64; | 260 /* Base parameters */ 261 maxusers = MAXUSERS; 262 TUNABLE_INT_FETCH("kern.maxusers", &maxusers); 263 if (maxusers == 0) { 264 maxusers = physpages / (2 * 1024 * 1024 / PAGE_SIZE); 265 if (maxusers < 32) 266 maxusers = 32; 267#ifdef VM_MAX_AUTOTUNE_MAXUSERS --- 65 unchanged lines hidden (view full) --- 333 */ 334 maxpipekva = ptoa(physpages / 64); 335 TUNABLE_LONG_FETCH("kern.ipc.maxpipekva", &maxpipekva); 336 if (maxpipekva < 512 * 1024) 337 maxpipekva = 512 * 1024; 338 if (maxpipekva > (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 64) 339 maxpipekva = (VM_MAX_KERNEL_ADDRESS - VM_MIN_KERNEL_ADDRESS) / 340 64; |
341 TSEXIT(); |
|
338} 339 340/* 341 * Sysctl stringifying handler for kern.vm_guest. 342 */ 343static int 344sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS) 345{ 346 return (SYSCTL_OUT_STR(req, vm_guest_sysctl_names[vm_guest])); 347} | 342} 343 344/* 345 * Sysctl stringifying handler for kern.vm_guest. 346 */ 347static int 348sysctl_kern_vm_guest(SYSCTL_HANDLER_ARGS) 349{ 350 return (SYSCTL_OUT_STR(req, vm_guest_sysctl_names[vm_guest])); 351} |