FreeBSD kernel kern code
|
#include <sys/cdefs.h>
#include "opt_param.h"
#include "opt_msgbuf.h"
#include "opt_maxphys.h"
#include "opt_maxusers.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/buf.h>
#include <sys/kernel.h>
#include <sys/limits.h>
#include <sys/msgbuf.h>
#include <sys/sysctl.h>
#include <sys/proc.h>
#include <sys/vnode.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 (40 + 32 * maxusers) |
Functions | |
__FBSDID ("$FreeBSD$") | |
static int | sysctl_kern_vm_guest (SYSCTL_HANDLER_ARGS) |
SYSCTL_INT (_kern, OID_AUTO, hz, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &hz, 0, "Number of clock ticks per second") | |
SYSCTL_INT (_kern, OID_AUTO, nbuf, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &nbuf, 0, "Number of buffers in the buffer cache") | |
SYSCTL_INT (_kern, OID_AUTO, nswbuf, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &nswbuf, 0, "Number of swap buffers") | |
SYSCTL_INT (_kern, OID_AUTO, msgbufsize, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &msgbufsize, 0, "Size of the kernel message buffer") | |
SYSCTL_LONG (_kern, OID_AUTO, maxswzone, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &maxswzone, 0, "Maximum memory for swap metadata") | |
SYSCTL_LONG (_kern, OID_AUTO, maxbcache, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &maxbcache, 0, "Maximum value of vfs.maxbufspace") | |
SYSCTL_INT (_kern, OID_AUTO, bio_transient_maxcnt, CTLFLAG_RDTUN|CTLFLAG_NOFETCH, &bio_transient_maxcnt, 0, "Maximum number of transient BIOs mappings") | |
SYSCTL_ULONG (_kern, OID_AUTO, maxtsiz, CTLFLAG_RWTUN|CTLFLAG_NOFETCH, &maxtsiz, 0, "Maximum text size") | |
SYSCTL_ULONG (_kern, OID_AUTO, dfldsiz, CTLFLAG_RWTUN|CTLFLAG_NOFETCH, &dfldsiz, 0, "Initial data size limit") | |
SYSCTL_ULONG (_kern, OID_AUTO, maxdsiz, CTLFLAG_RWTUN|CTLFLAG_NOFETCH, &maxdsiz, 0, "Maximum data size") | |
SYSCTL_ULONG (_kern, OID_AUTO, dflssiz, CTLFLAG_RWTUN|CTLFLAG_NOFETCH, &dflssiz, 0, "Initial stack size limit") | |
SYSCTL_ULONG (_kern, OID_AUTO, maxssiz, CTLFLAG_RWTUN|CTLFLAG_NOFETCH, &maxssiz, 0, "Maximum stack size") | |
SYSCTL_ULONG (_kern, OID_AUTO, sgrowsiz, CTLFLAG_RWTUN|CTLFLAG_NOFETCH, &sgrowsiz, 0, "Amount to grow stack on a stack fault") | |
SYSCTL_PROC (_kern, OID_AUTO, vm_guest, CTLFLAG_RD|CTLTYPE_STRING|CTLFLAG_MPSAFE, NULL, 0, sysctl_kern_vm_guest, "A", "Virtual machine guest detected?") | |
CTASSERT (nitems(vm_guest_sysctl_names) - 1==VM_LAST) | |
void | init_param1 (void) |
void | init_param2 (long physpages) |
Variables | |
int | hz |
int | tick |
struct bintime | tick_bt |
sbintime_t | tick_sbt |
int | maxusers |
int | maxproc |
int | maxprocperuid |
int | maxfiles |
int | maxfilesperproc |
int | msgbufsize |
int | nbuf |
int | bio_transient_maxcnt |
int | ngroups_max |
int | nswbuf |
pid_t | pid_max = PID_MAX |
u_long | maxswzone |
u_long | maxbcache |
u_long | maxpipekva |
u_long | maxphys |
int | vm_guest = VM_GUEST_NO |
u_long | maxtsiz |
u_long | dfldsiz |
u_long | maxdsiz |
u_long | dflssiz |
u_long | maxssiz |
u_long | sgrowsiz |
static const char *const | vm_guest_sysctl_names [] |
#define HZ 1000 |
Definition at line 66 of file subr_param.c.
#define HZ_VM 100 |
Definition at line 68 of file subr_param.c.
#define MAXFILES (40 + 32 * maxusers) |
Definition at line 80 of file subr_param.c.
#define NBUF 0 |
Definition at line 77 of file subr_param.c.
#define NPROC (20 + 16 * maxusers) |
Definition at line 75 of file subr_param.c.
__FBSDID | ( | "$FreeBSD$" | ) |
CTASSERT | ( | nitems(vm_guest_sysctl_names) - | 1 = =VM_LAST | ) |
void init_param1 | ( | void | ) |
Definition at line 166 of file subr_param.c.
References dfldsiz, dflssiz, HZ, hz, HZ_VM, kstack_pages, maxbcache, maxdsiz, maxssiz, maxswzone, maxtsiz, msgbufsize, ngroups_max, pid_max, sgrowsiz, tick, tick_bt, tick_sbt, ticks, vm_guest, and vn_lock_pair_pause_max.
void init_param2 | ( | long | physpages | ) |
Definition at line 241 of file subr_param.c.
References bio_transient_maxcnt, MAXFILES, maxfiles, maxfilesperproc, maxphys, maxpipekva, maxproc, maxprocperuid, maxusers, NBUF, nbuf, NPROC, nswbuf, and pid_max.
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
bio_transient_maxcnt | , | ||
CTLFLAG_RDTUN| | CTLFLAG_NOFETCH, | ||
& | bio_transient_maxcnt, | ||
0 | , | ||
"Maximum number of transient BIOs mappings" | |||
) |
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
hz | , | ||
CTLFLAG_RDTUN| | CTLFLAG_NOFETCH, | ||
& | hz, | ||
0 | , | ||
"Number of clock ticks per second" | |||
) |
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
msgbufsize | , | ||
CTLFLAG_RDTUN| | CTLFLAG_NOFETCH, | ||
& | msgbufsize, | ||
0 | , | ||
"Size of the kernel message buffer" | |||
) |
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
nbuf | , | ||
CTLFLAG_RDTUN| | CTLFLAG_NOFETCH, | ||
& | nbuf, | ||
0 | , | ||
"Number of buffers in the buffer cache" | |||
) |
SYSCTL_INT | ( | _kern | , |
OID_AUTO | , | ||
nswbuf | , | ||
CTLFLAG_RDTUN| | CTLFLAG_NOFETCH, | ||
& | nswbuf, | ||
0 | , | ||
"Number of swap buffers" | |||
) |
|
static |
Definition at line 331 of file subr_param.c.
References vm_guest, and vm_guest_sysctl_names.
SYSCTL_LONG | ( | _kern | , |
OID_AUTO | , | ||
maxbcache | , | ||
CTLFLAG_RDTUN| | CTLFLAG_NOFETCH, | ||
& | maxbcache, | ||
0 | , | ||
"Maximum value of vfs.maxbufspace" | |||
) |
SYSCTL_LONG | ( | _kern | , |
OID_AUTO | , | ||
maxswzone | , | ||
CTLFLAG_RDTUN| | CTLFLAG_NOFETCH, | ||
& | maxswzone, | ||
0 | , | ||
"Maximum memory for swap metadata" | |||
) |
SYSCTL_PROC | ( | _kern | , |
OID_AUTO | , | ||
vm_guest | , | ||
CTLFLAG_RD|CTLTYPE_STRING| | CTLFLAG_MPSAFE, | ||
NULL | , | ||
0 | , | ||
sysctl_kern_vm_guest | , | ||
"A" | , | ||
"Virtual machine guest detected?" | |||
) |
SYSCTL_ULONG | ( | _kern | , |
OID_AUTO | , | ||
dfldsiz | , | ||
CTLFLAG_RWTUN| | CTLFLAG_NOFETCH, | ||
& | dfldsiz, | ||
0 | , | ||
"Initial data size limit" | |||
) |
SYSCTL_ULONG | ( | _kern | , |
OID_AUTO | , | ||
dflssiz | , | ||
CTLFLAG_RWTUN| | CTLFLAG_NOFETCH, | ||
& | dflssiz, | ||
0 | , | ||
"Initial stack size limit" | |||
) |
SYSCTL_ULONG | ( | _kern | , |
OID_AUTO | , | ||
maxdsiz | , | ||
CTLFLAG_RWTUN| | CTLFLAG_NOFETCH, | ||
& | maxdsiz, | ||
0 | , | ||
"Maximum data size" | |||
) |
SYSCTL_ULONG | ( | _kern | , |
OID_AUTO | , | ||
maxssiz | , | ||
CTLFLAG_RWTUN| | CTLFLAG_NOFETCH, | ||
& | maxssiz, | ||
0 | , | ||
"Maximum stack size" | |||
) |
SYSCTL_ULONG | ( | _kern | , |
OID_AUTO | , | ||
maxtsiz | , | ||
CTLFLAG_RWTUN| | CTLFLAG_NOFETCH, | ||
& | maxtsiz, | ||
0 | , | ||
"Maximum text size" | |||
) |
SYSCTL_ULONG | ( | _kern | , |
OID_AUTO | , | ||
sgrowsiz | , | ||
CTLFLAG_RWTUN| | CTLFLAG_NOFETCH, | ||
& | sgrowsiz, | ||
0 | , | ||
"Amount to grow stack on a stack fault" | |||
) |
int bio_transient_maxcnt |
Definition at line 96 of file subr_param.c.
Referenced by init_param2(), and kern_vfs_bio_buffer_alloc().
u_long dfldsiz |
Definition at line 106 of file subr_param.c.
Referenced by init_param1(), and proc0_init().
u_long dflssiz |
Definition at line 108 of file subr_param.c.
Referenced by init_param1(), and proc0_init().
int hz |
Definition at line 85 of file subr_param.c.
Referenced by acct_process(), acct_thread(), aio_proc_rundown(), boot_run_interrupt_driven_config_hooks(), buf_daemon(), buf_daemon_shutdown(), bufspace_daemon(), bufspace_daemon_shutdown(), config_intrhook_drain(), counter_ratecheck(), cpu_initclocks_bsp(), destroy_dev_drain(), destroy_devl(), fail_point_drain(), fail_point_sleep(), fill_kinfo_proc_only(), fill_kinfo_thread(), fork1(), fork_rfppwait(), getnextcpuevent(), hardclock_device_poll(), init_param1(), initclocks(), inittimecounter(), kern_clock_getres(), kern_msgsnd(), kproc_shutdown(), ksched_attach(), kthread_shutdown(), ktls_buffer_alloc(), netisr_pollmore(), parse_dir_ask(), parse_mount(), periodic_resettodr(), pffasttimo(), pfslowtimo(), poll_idle(), ppsratecheck(), reg_frac_sysctl(), sched_initticks(), sched_pctcpu(), sched_rr_interval(), sched_sync(), schedcpu_thread(), setuptimer(), sleepinit(), so_linger_set(), soclose(), sosetopt(), start_periodic_resettodr(), statclock(), syscall_thread_drain(), sysctl_kern_clockrate(), sysctl_kern_quantum(), sysctl_msec_to_ticks(), sysctl_resettodr_period(), tc_adjprecision(), tc_init(), thread_reap_callout_cb(), threadinit(), tty_drain(), tty_timedwait(), ttydisc_read_raw_read_timer(), tvtohz(), vfs_mount_init(), vfs_mountroot_wait(), vfs_mountroot_wait_if_neccessary(), vmem_start_callout(), vn_alloc_hard(), vn_fsync_buf(), vnlru_proc(), and watchdog_config().
u_long maxbcache |
Definition at line 101 of file subr_param.c.
Referenced by init_param1(), and kern_vfs_bio_buffer_alloc().
u_long maxdsiz |
Definition at line 107 of file subr_param.c.
Referenced by init_param1(), kern_proc_setrlimit(), and proc0_init().
int maxfiles |
Definition at line 92 of file subr_param.c.
Referenced by _falloc_noinstall(), callout_callwheel_init(), init_maxsockets(), init_param2(), proc0_init(), and sysctl_maxsockets().
int maxfilesperproc |
Definition at line 93 of file subr_param.c.
Referenced by getmaxfd(), init_param2(), kern_poll_maxfds(), and kern_proc_setrlimit().
u_long maxphys |
Definition at line 103 of file subr_param.c.
Referenced by aio_biocleanup(), aio_qbio(), bufinit(), init_param2(), kern_vfs_bio_buffer_alloc(), maxbcachebuf_adjust(), physio(), vfs_bio_awrite(), vn_sendfile(), and vop_stdallocate().
u_long maxpipekva |
Definition at line 102 of file subr_param.c.
Referenced by init_param2(), pipe_create(), pipe_read(), and pipe_write().
int maxproc |
Definition at line 90 of file subr_param.c.
Referenced by callout_callwheel_init(), fork1(), init_param2(), proc0_init(), procinit(), threadinit(), uihashinit(), and vntblinit().
int maxprocperuid |
Definition at line 91 of file subr_param.c.
Referenced by init_param2(), and kern_proc_setrlimit().
u_long maxssiz |
Definition at line 109 of file subr_param.c.
Referenced by exec_map_stack(), init_param1(), kern_proc_setrlimit(), and proc0_init().
u_long maxswzone |
Definition at line 100 of file subr_param.c.
Referenced by init_param1().
u_long maxtsiz |
Definition at line 105 of file subr_param.c.
Referenced by enforce_limits(), exec_aout_imgact(), and init_param1().
int maxusers |
Definition at line 89 of file subr_param.c.
Referenced by init_param2().
int msgbufsize |
Definition at line 94 of file subr_param.c.
Referenced by init_param1().
int nbuf |
Definition at line 95 of file subr_param.c.
Referenced by bufinit(), bufshutdown(), cluster_read(), init_param2(), kern_vfs_bio_buffer_alloc(), ksprintn(), kvprintf(), msglogchar(), and vntblinit().
int ngroups_max |
Definition at line 97 of file subr_param.c.
Referenced by crsetgroups(), init_param1(), kern_setgroups(), and sys_setgroups().
int nswbuf |
Definition at line 98 of file subr_param.c.
Referenced by cluster_init(), init_param2(), and kern_vfs_bio_buffer_alloc().
pid_t pid_max = PID_MAX |
Definition at line 99 of file subr_param.c.
Referenced by fork_findpid(), init_param1(), init_param2(), sysctl_kern_pid_max(), and sysctl_kern_randompid().
u_long sgrowsiz |
Definition at line 110 of file subr_param.c.
Referenced by exec_map_stack(), and init_param1().
int tick |
Definition at line 86 of file subr_param.c.
Referenced by acct_process(), cpu_initclocks_bsp(), cputick2usec(), hardclock_itimer(), init_param1(), itimerfix(), itimespecfix(), kern_setitimer(), statclock(), sysctl_kern_clockrate(), and tvtohz().
struct bintime tick_bt |
Definition at line 87 of file subr_param.c.
Referenced by cpu_initclocks_bsp(), init_param1(), and inittimecounter().
sbintime_t tick_sbt |
Definition at line 88 of file subr_param.c.
Referenced by callout_when(), cpu_initclocks_bsp(), getnextcpuevent(), handleevents(), init_param1(), inittimecounter(), pause_sbt(), taskqueue_enqueue_timeout(), and umtx_abs_timeout_getsbt().
int vm_guest = VM_GUEST_NO |
Definition at line 104 of file subr_param.c.
Referenced by calcru1(), init_param1(), and sysctl_kern_vm_guest().
|
static |
Definition at line 148 of file subr_param.c.
Referenced by sysctl_kern_vm_guest().