|
FreeBSD kernel kern code
|
#include <sys/cdefs.h>#include "opt_param.h"#include "opt_msgbuf.h"#include "opt_maxusers.h"#include <sys/param.h>#include <sys/systm.h>#include <sys/kernel.h>#include <sys/limits.h>#include <sys/msgbuf.h>#include <sys/sysctl.h>#include <sys/proc.h>#include <vm/vm.h>#include <vm/vm_param.h>#include <vm/pmap.h>
Go to the source code of this file.
Macros | |
| #define | HZ 1000 |
| #define | HZ_VM 100 |
| #define | NPROC (20 + 16 * maxusers) |
| #define | NBUF 0 |
| #define | MAXFILES (maxproc * 2) |
Functions | |
| __FBSDID ("$BSDSUniX$") | |
| static int | sysctl_kern_vm_guest (SYSCTL_HANDLER_ARGS) |
| SYSCTL_INT (_kern, OID_AUTO, hz, CTLFLAG_RDTUN,&hz, 0,"Number of clock ticks per second") | |
| SYSCTL_INT (_kern, OID_AUTO, ncallout, CTLFLAG_RDTUN,&ncallout, 0,"Number of pre-allocated timer events") | |
| SYSCTL_INT (_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN,&nbuf, 0,"Number of buffers in the buffer cache") | |
| SYSCTL_INT (_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN,&nswbuf, 0,"Number of swap buffers") | |
| SYSCTL_INT (_kern, OID_AUTO, msgbufsize, CTLFLAG_RDTUN,&msgbufsize, 0,"Size of the kernel message buffer") | |
| SYSCTL_LONG (_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN,&maxswzone, 0,"Maximum memory for swap metadata") | |
| SYSCTL_LONG (_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN,&maxbcache, 0,"Maximum value of vfs.maxbufspace") | |
| SYSCTL_INT (_kern, OID_AUTO, bio_transient_maxcnt, CTLFLAG_RDTUN,&bio_transient_maxcnt, 0,"Maximum number of transient BIOs mappings") | |
| SYSCTL_ULONG (_kern, OID_AUTO, maxtsiz, CTLFLAG_RW|CTLFLAG_TUN,&maxtsiz, 0,"Maximum text size") | |
| SYSCTL_ULONG (_kern, OID_AUTO, dfldsiz, CTLFLAG_RW|CTLFLAG_TUN,&dfldsiz, 0,"Initial data size limit") | |
| SYSCTL_ULONG (_kern, OID_AUTO, maxdsiz, CTLFLAG_RW|CTLFLAG_TUN,&maxdsiz, 0,"Maximum data size") | |
| SYSCTL_ULONG (_kern, OID_AUTO, dflssiz, CTLFLAG_RW|CTLFLAG_TUN,&dflssiz, 0,"Initial stack size limit") | |
| SYSCTL_ULONG (_kern, OID_AUTO, maxssiz, CTLFLAG_RW|CTLFLAG_TUN,&maxssiz, 0,"Maximum stack size") | |
| SYSCTL_ULONG (_kern, OID_AUTO, sgrowsiz, CTLFLAG_RW|CTLFLAG_TUN,&sgrowsiz, 0,"Amount to grow stack on a stack fault") | |
| SYSCTL_PROC (_kern, OID_AUTO, vm_guest, CTLFLAG_RD|CTLTYPE_STRING, NULL, 0, sysctl_kern_vm_guest,"A","Virtual machine guest detected? (none|generic|xen)") | |
| static enum VM_GUEST | detect_virtual (void) |
| void | init_param1 (void) |
| void | init_param2 (long physpages) |
Variables | |
| int | hz |
| int | tick |
| int | maxusers |
| int | maxproc |
| int | maxprocperuid |
| int | maxfiles |
| int | maxfilesperproc |
| int | msgbufsize |
| int | ncallout |
| int | nbuf |
| int | bio_transient_maxcnt |
| int | ngroups_max |
| int | nswbuf |
| pid_t | pid_max = PID_MAX |
| long | maxswzone |
| long | maxbcache |
| long | maxpipekva |
| int | vm_guest |
| u_long | maxtsiz |
| u_long | dfldsiz |
| u_long | maxdsiz |
| u_long | dflssiz |
| u_long | maxssiz |
| u_long | sgrowsiz |
| struct buf * | swbuf |
| static const char *const | vm_guest_sysctl_names [] |
| static const char *const | vm_bnames [] |
| static const char *const | vm_pnames [] |
| #define HZ 1000 |
Definition at line 64 of file subr_param.c.
Referenced by init_param1().
| #define HZ_VM 100 |
Definition at line 67 of file subr_param.c.
Referenced by init_param1().
| #define MAXFILES (maxproc * 2) |
Definition at line 79 of file subr_param.c.
Referenced by init_param2().
| #define NBUF 0 |
Definition at line 76 of file subr_param.c.
Referenced by init_param2().
| #define NPROC (20 + 16 * maxusers) |
Definition at line 74 of file subr_param.c.
Referenced by init_param2().
| __FBSDID | ( | "$BSDSUniX$" | ) |
|
static |
Definition at line 185 of file subr_param.c.
References freeenv(), getenv(), vm_bnames, and vm_pnames.
Referenced by init_param1().


| void init_param1 | ( | void | ) |
Definition at line 216 of file subr_param.c.
References detect_virtual(), dfldsiz, dflssiz, HZ, hz, HZ_VM, maxbcache, maxdsiz, maxssiz, maxswzone, maxtsiz, msgbufsize, ngroups_max, pid_max, sgrowsiz, tick, and vm_guest.

| void init_param2 | ( | long | physpages | ) |
Definition at line 280 of file subr_param.c.
References bio_transient_maxcnt, MAXFILES, maxfiles, maxfilesperproc, maxpipekva, maxproc, maxprocperuid, maxusers, NBUF, nbuf, ncallout, and NPROC.
| SYSCTL_INT | ( | _kern | , |
| OID_AUTO | , | ||
| ncallout | , | ||
| CTLFLAG_RDTUN | , | ||
| & | ncallout, | ||
| 0 | , | ||
| "Number of pre-allocated timer events" | |||
| ) |
| SYSCTL_INT | ( | _kern | , |
| OID_AUTO | , | ||
| nbuf | , | ||
| CTLFLAG_RDTUN | , | ||
| & | nbuf, | ||
| 0 | , | ||
| "Number of buffers in the buffer cache" | |||
| ) |
| SYSCTL_INT | ( | _kern | , |
| OID_AUTO | , | ||
| nswbuf | , | ||
| CTLFLAG_RDTUN | , | ||
| & | nswbuf, | ||
| 0 | , | ||
| "Number of swap buffers" | |||
| ) |
| SYSCTL_INT | ( | _kern | , |
| OID_AUTO | , | ||
| msgbufsize | , | ||
| CTLFLAG_RDTUN | , | ||
| & | msgbufsize, | ||
| 0 | , | ||
| "Size of the kernel message buffer" | |||
| ) |
| SYSCTL_INT | ( | _kern | , |
| OID_AUTO | , | ||
| bio_transient_maxcnt | , | ||
| CTLFLAG_RDTUN | , | ||
| & | bio_transient_maxcnt, | ||
| 0 | , | ||
| "Maximum number of transient BIOs mappings" | |||
| ) |
|
static |
Definition at line 358 of file subr_param.c.
References vm_guest, and vm_guest_sysctl_names.
| SYSCTL_LONG | ( | _kern | , |
| OID_AUTO | , | ||
| maxswzone | , | ||
| CTLFLAG_RDTUN | , | ||
| & | maxswzone, | ||
| 0 | , | ||
| "Maximum memory for swap metadata" | |||
| ) |
| SYSCTL_LONG | ( | _kern | , |
| OID_AUTO | , | ||
| maxbcache | , | ||
| CTLFLAG_RDTUN | , | ||
| & | maxbcache, | ||
| 0 | , | ||
| "Maximum value of vfs.maxbufspace" | |||
| ) |
| SYSCTL_PROC | ( | _kern | , |
| OID_AUTO | , | ||
| vm_guest | , | ||
| CTLFLAG_RD| | CTLTYPE_STRING, | ||
| NULL | , | ||
| 0 | , | ||
| sysctl_kern_vm_guest | , | ||
| "A" | , | ||
| "Virtual machine guest detected? (none|generic|xen)" | |||
| ) |
| SYSCTL_ULONG | ( | _kern | , |
| OID_AUTO | , | ||
| maxtsiz | , | ||
| CTLFLAG_RW| | CTLFLAG_TUN, | ||
| & | maxtsiz, | ||
| 0 | , | ||
| "Maximum text size" | |||
| ) |
| SYSCTL_ULONG | ( | _kern | , |
| OID_AUTO | , | ||
| dfldsiz | , | ||
| CTLFLAG_RW| | CTLFLAG_TUN, | ||
| & | dfldsiz, | ||
| 0 | , | ||
| "Initial data size limit" | |||
| ) |
| SYSCTL_ULONG | ( | _kern | , |
| OID_AUTO | , | ||
| maxdsiz | , | ||
| CTLFLAG_RW| | CTLFLAG_TUN, | ||
| & | maxdsiz, | ||
| 0 | , | ||
| "Maximum data size" | |||
| ) |
| SYSCTL_ULONG | ( | _kern | , |
| OID_AUTO | , | ||
| dflssiz | , | ||
| CTLFLAG_RW| | CTLFLAG_TUN, | ||
| & | dflssiz, | ||
| 0 | , | ||
| "Initial stack size limit" | |||
| ) |
| SYSCTL_ULONG | ( | _kern | , |
| OID_AUTO | , | ||
| maxssiz | , | ||
| CTLFLAG_RW| | CTLFLAG_TUN, | ||
| & | maxssiz, | ||
| 0 | , | ||
| "Maximum stack size" | |||
| ) |
| SYSCTL_ULONG | ( | _kern | , |
| OID_AUTO | , | ||
| sgrowsiz | , | ||
| CTLFLAG_RW| | CTLFLAG_TUN, | ||
| & | sgrowsiz, | ||
| 0 | , | ||
| "Amount to grow stack on a stack fault" | |||
| ) |
| int bio_transient_maxcnt |
Definition at line 94 of file subr_param.c.
Referenced by init_param2(), and kern_vfs_bio_buffer_alloc().
| u_long dfldsiz |
Definition at line 103 of file subr_param.c.
Referenced by init_param1(), and proc0_init().
| u_long dflssiz |
Definition at line 105 of file subr_param.c.
Referenced by init_param1(), and proc0_init().
| int hz |
Definition at line 84 of file subr_param.c.
Referenced by acct_process(), acct_thread(), aio_proc_rundown(), biowait(), boot_run_interrupt_driven_config_hooks(), buf_daemon(), constty_timeout(), cpu_initclocks_bsp(), destroy_dev_drain(), destroy_devl(), dev_strategy_csw(), fail_point_sleep(), fill_kinfo_proc_only(), fill_kinfo_thread(), fork1(), getnewvnode_wait(), getnextcpuevent(), hardclock_device_poll(), init_param1(), initclocks(), inittimecounter(), kern_clock_getres(), kern_msgsnd(), kern_proc_setrlimit(), kern_select(), kproc_shutdown(), kqueue_scan(), kthread_shutdown(), lim_cb(), lim_fork(), loadav(), logopen(), logtimeout(), netisr_pollmore(), parse_dir_ask(), parse_mount(), pause(), periodic_resettodr(), pffasttimo(), pfslowtimo(), poll_idle(), ppsratecheck(), reg_frac_sysctl(), root_mount_wait(), sched_initticks(), sched_pctcpu(), sched_rr_interval(), sched_sync(), schedcpu_thread(), selsocket(), setuptimer(), sleepinit(), soclose(), sogetopt(), start_periodic_resettodr(), sys_poll(), syscall_thread_drain(), sysctl_kern_clockrate(), sysctl_kern_quantum(), sysctl_msec_to_ticks(), sysctl_resettodr_period(), tc_init(), ttydisc_read_raw_read_timer(), vfs_mountroot_wait(), and vnlru_proc().
| long maxbcache |
Definition at line 99 of file subr_param.c.
Referenced by init_param1(), and kern_vfs_bio_buffer_alloc().
| u_long maxdsiz |
Definition at line 104 of file subr_param.c.
Referenced by init_param1(), kern_proc_setrlimit(), and proc0_init().
| int maxfiles |
Definition at line 89 of file subr_param.c.
Referenced by falloc_noinstall(), init_maxsockets(), init_param2(), proc0_init(), and sysctl_maxsockets().
| int maxfilesperproc |
Definition at line 90 of file subr_param.c.
Referenced by getmaxfd(), init_param2(), kern_proc_setrlimit(), sys_getdtablesize(), and sys_poll().
| long maxpipekva |
Definition at line 100 of file subr_param.c.
Referenced by init_param2(), pipe_create(), pipe_read(), and pipe_write().
| int maxproc |
Definition at line 87 of file subr_param.c.
Referenced by fork1(), init_param2(), proc0_init(), procinit(), threadinit(), uihashinit(), and vntblinit().
| int maxprocperuid |
Definition at line 88 of file subr_param.c.
Referenced by init_param2(), and kern_proc_setrlimit().
| u_long maxssiz |
Definition at line 106 of file subr_param.c.
Referenced by exec_new_vmspace(), init_param1(), kern_proc_setrlimit(), and proc0_init().
| long maxswzone |
Definition at line 98 of file subr_param.c.
Referenced by init_param1().
| u_long maxtsiz |
Definition at line 102 of file subr_param.c.
Referenced by do_aout_hdr(), exec_aout_imgact(), and init_param1().
| int maxusers |
Definition at line 86 of file subr_param.c.
Referenced by init_param2().
| int msgbufsize |
Definition at line 91 of file subr_param.c.
Referenced by init_param1().
| int nbuf |
Definition at line 93 of file subr_param.c.
Referenced by bufcountwakeup(), bufinit(), cluster_read_gb(), init_param2(), kern_reboot(), kern_vfs_bio_buffer_alloc(), ksprintn(), kvprintf(), and msglogchar().
| int ncallout |
Definition at line 92 of file subr_param.c.
Referenced by callout_cpu_init(), callout_tickstofirst(), init_param2(), and kern_timeout_callwheel_alloc().
| int ngroups_max |
Definition at line 95 of file subr_param.c.
Referenced by crsetgroups(), init_param1(), kern_setgroups(), and sys_setgroups().
| int nswbuf |
Definition at line 96 of file subr_param.c.
Referenced by kern_vfs_bio_buffer_alloc().
| pid_t pid_max = PID_MAX |
Definition at line 97 of file subr_param.c.
Referenced by fork_findpid(), init_param1(), sysctl_kern_pid_max(), and sysctl_kern_randompid().
| u_long sgrowsiz |
Definition at line 107 of file subr_param.c.
Referenced by exec_new_vmspace(), and init_param1().
| struct buf* swbuf |
Definition at line 147 of file subr_param.c.
Referenced by kern_vfs_bio_buffer_alloc().
| int tick |
Definition at line 85 of file subr_param.c.
Referenced by acct_process(), cpu_initclocks_bsp(), hardclock_cnt(), hardclock_cpu(), init_param1(), itimerfix(), itimespecfix(), pause(), sogetopt(), statclock_cnt(), sysctl_kern_clockrate(), and tvtohz().
|
static |
Definition at line 161 of file subr_param.c.
Referenced by detect_virtual().
| int vm_guest |
Definition at line 101 of file subr_param.c.
Referenced by init_param1(), and sysctl_kern_vm_guest().
|
static |
Definition at line 153 of file subr_param.c.
Referenced by sysctl_kern_vm_guest().
|
static |
Definition at line 171 of file subr_param.c.
Referenced by detect_virtual().