1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00
Mirror of the FreeBSD src repository https://git.FreeBSD.org/src.git .
Go to file
Alexander Motin a157e42516 Refactor timer management code with priority to one-shot operation mode.
The main goal of this is to generate timer interrupts only when there is
some work to do. When CPU is busy interrupts are generating at full rate
of hz + stathz to fullfill scheduler and timekeeping requirements. But
when CPU is idle, only minimum set of interrupts (down to 8 interrupts per
second per CPU now), needed to handle scheduled callouts is executed.
This allows significantly increase idle CPU sleep time, increasing effect
of static power-saving technologies. Also it should reduce host CPU load
on virtualized systems, when guest system is idle.

There is set of tunables, also available as writable sysctls, allowing to
control wanted event timer subsystem behavior:
  kern.eventtimer.timer - allows to choose event timer hardware to use.
On x86 there is up to 4 different kinds of timers. Depending on whether
chosen timer is per-CPU, behavior of other options slightly differs.
  kern.eventtimer.periodic - allows to choose periodic and one-shot
operation mode. In periodic mode, current timer hardware taken as the only
source of time for time events. This mode is quite alike to previous kernel
behavior. One-shot mode instead uses currently selected time counter
hardware to schedule all needed events one by one and program timer to
generate interrupt exactly in specified time. Default value depends of
chosen timer capabilities, but one-shot mode is preferred, until other is
forced by user or hardware.
  kern.eventtimer.singlemul - in periodic mode specifies how much times
higher timer frequency should be, to not strictly alias hardclock() and
statclock() events. Default values are 2 and 4, but could be reduced to 1
if extra interrupts are unwanted.
  kern.eventtimer.idletick - makes each CPU to receive every timer interrupt
independently of whether they busy or not. By default this options is
disabled. If chosen timer is per-CPU and runs in periodic mode, this option
has no effect - all interrupts are generating.

As soon as this patch modifies cpu_idle() on some platforms, I have also
refactored one on x86. Now it makes use of MONITOR/MWAIT instrunctions
(if supported) under high sleep/wakeup rate, as fast alternative to other
methods. It allows SMP scheduler to wake up sleeping CPUs much faster
without using IPI, significantly increasing performance on some highly
task-switching loads.

Tested by:	many (on i386, amd64, sparc64 and powerc)
H/W donated by:	Gheorghe Ardelean
Sponsored by:	iXsystems, Inc.
2010-09-13 07:25:35 +00:00
bin Merge from tbemd: 2010-09-13 01:29:51 +00:00
cddl Give a chance to the target binary to run the ctors by waiting until it 2010-09-12 15:59:14 +00:00
contrib Mark __DTOR_LIST__, __EH_FRAME_BEGIN__ and __CTOR_END__ as used to avoid 2010-08-26 13:04:16 +00:00
crypto
etc Create the var/run/wpa_supplicant directory where the wpa_supplicant 2010-09-10 08:27:02 +00:00
games fix the move so that it matches what the rest of the internet 2010-09-03 03:20:34 +00:00
gnu GCC defines built-ins for atomic instructions found on i486 and higher. 2010-09-07 08:33:17 +00:00
include Correct value for _POSIX_AIO_LISTIO_MAX in <limits.h>. 2010-08-29 22:22:15 +00:00
kerberos5
lib PS_DEAD state needs not be checked because _thr_find_thread() has already 2010-09-13 07:18:00 +00:00
libexec Check for undefined weak symbols during PLT binding on powerpc64, and do 2010-09-12 17:04:51 +00:00
release sis(4) should work on all architectures now. 2010-09-06 11:02:50 +00:00
rescue MFtbemd: 2010-08-23 22:24:11 +00:00
sbin MF tbemd: Move to using Makefile.arch to select what to build. 2010-09-13 02:25:21 +00:00
secure Revert changes of 'assure' to 'ensure' made in r211936. 2010-09-11 10:49:56 +00:00
share Prefer MACHINE_CPUARCH to MACHINE_ARCH unless there's a good reason... 2010-09-13 07:22:14 +00:00
sys Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
tools sh: Fix exit status if return is used within a loop condition. 2010-09-11 15:07:40 +00:00
usr.bin Doh! two last second refactoring typos crept in. Fix. 2010-09-13 06:50:07 +00:00
usr.sbin It turns out that TARGET_CPUARCH doesn't buy us much here, if anything, but 2010-09-13 07:15:01 +00:00
COPYRIGHT
LOCKS
MAINTAINERS
Makefile
Makefile.inc1 Check TARGET_ARCH as well as TARGET to determine if we are doing a cross 2010-09-08 19:53:16 +00:00
Makefile.mips Guard against TARGET_ABI being undefined (TARGET_ABI will go away soon) 2010-08-26 14:54:12 +00:00
ObsoleteFiles.inc Mark the sbuf_overflowed(9) manpage as obsolete since it has been 2010-09-10 20:42:41 +00:00
README
UPDATING Mention the removal of acpi_aiboost. 2010-07-25 18:32:59 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html