Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages


home | help
settune(2)		      System Calls Manual		    settune(2)

       settune - set the value of a kernel tunable parameter

       This function sets the value of the kernel tunable parameter named tun-
       able to the supplied value.  This new value will	 take  effect  immedi-
       ately, except in	the cases noted	below.

       Some parameters cannot be changed without rebuilding the	OS kernel, and
       then booting that rebuilt kernel.  will return an  error	 if  asked  to
       change one of these parameters.

       Some  parameters	 represent limits on resources that can	be consumed by
       individual processes.  In general, changes to these parameters  do  not
       affect  processes that are running at the time the change is made; they
       affect only new programs	started	(with exec(2) or an equivalent)	 after
       that time.  (Some specific parameters may be exceptions to this general
       rule; see the man pages for those parameters for	details.)

       If the flag is set in the flags parameter, the value of the tunable pa-
       rameter will be set to its hard-coded default value.  In	this case, the
       value parameter to will be ignored.

       The tuneinfo2(2)	call can give information about	whether	or not changes
       to  a parameter are allowed, or will require a reboot.  Some individual
       parameters may  have  specific  notes  regarding	 their	behavior  when
       changed;	 consult  the parameter	man pages for details on each specific

   Persistence of Changes
       Changes to parameter values made	with will remain effective across  re-
       boots.	Tunable	 parameter  values  are	 stored	in the Kernel Registry
       database.  Each time the	system boots, it reads	the  parameter	values
       from the	database and restores them.

       There  is a separate Kernel Registry database for each different	kernel
       file name.  For example,	has a different	set of stored parameter	values
       than  always changes the	database corresponding to the kernel file from
       which the system	was last booted.  Its changes do not affect any	 other

       Whenever	a kernel gets rebuilt, using SAM, mk_kernel(1M), or some other
       method, the Kernel Registry database will be erased and	replaced  with
       the  tunable parameter values compiled into the new kernel.  Therefore,
       parameter changes made using do not persist across kernel rebuilds.  To
       make  a	parameter  change  which  persists across kernel rebuilds, the
       files read during the kernel build process must be updated.  Use	SAM or
       kmtune(1M) to do	this.

       This function returns one of the	following values:

	      The  value of the	specified parameter has	been changed.  The new
	      value is
			       effective immediately.

	      The value	of the specified parameter has been changed.  However,
			       processes  exceeded the resource	limits implied
			       by the new parameter value.  The	changed	param-
			       eter  value  does not affect those processes or
			       any future children of them.

	      The function did not complete successfully.  The	value  of  the
			       parameter has not been changed.

       If this function	returns	to indicate an error, the global variable will
       be set to one of	the following values, to indicate the error  that  oc-

	      The specified tunable parameter does not exist.

	      tunable	     specifies an address that is inaccessible.

	      The caller does not have super-user privileges.

	      The  specified  value is not within the acceptable range for the

	      The value	of the parameter could not be changed immediately.

	      The specified parameter cannot be	changed	without	rebuilding the

	      The  Kernel  Registry  Service was unavailable or	encountered an

	      Insufficient memory to accommodate the new parameter value.

       It is possible to seriously degrade system performance, or even	render
       a  system  unbootable,  with incorrect tunable settings.	 Use care when
       setting tunable values.	Always have a known working kernel saved as  a
       backup;	if  the	system fails to	boot after a tunable change, boot from
       that backup kernel.  Keep good records of all tunable changes  so  that
       they  can  be  reversed	if  they degrade system	performance.  (Tunable
       changes made with are automatically logged to and to the	Kernel Logging

       was developed by	Hewlett-Packard	Company.

       kmtune(1M), mk_kernel(1M), gettune(2), tuneinfo2(2), and	the individual
       tunable parameter man pages in section 5.



Want to link to this manual page? Use this URL:

home | help