freebsd-skq/sys
mav eb4931dc6c 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
..
amd64 Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
arm In pmap_remove_all(), do not decrease pm_stats.wired_count if the mapping was 2010-09-12 20:46:32 +00:00
boot Remove empty lines committed by accident. 2010-09-09 21:32:09 +00:00
bsm Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
cam Correct bioq_disksort so that bioq_insert_tail() offers barrier semantic. 2010-09-02 19:40:28 +00:00
cddl Revamp locking a bit. This fixes three problems: 2010-09-12 14:12:16 +00:00
compat Replace sbuf_overflowed() with sbuf_error(), which returns any error 2010-09-10 16:42:16 +00:00
conf Use MACHINE_CPUARCH as appropriate 2010-09-13 07:16:48 +00:00
contrib When using pf routing options, properly handle IP fragmentation 2010-09-10 00:00:06 +00:00
crypto Crypto(4) driver for AESNI. 2010-07-23 11:00:46 +00:00
ddb One more use for _SIG_VALID. 2010-07-12 10:18:10 +00:00
dev Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
fs This patch applies one of the two fixes suggested by 2010-09-10 23:49:33 +00:00
gdb Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
geom Correct bioq_disksort so that bioq_insert_tail() offers barrier semantic. 2010-09-02 19:40:28 +00:00
gnu Add dedicated routines to toggle lockmgr flags such as LK_NOSHARE and 2010-08-20 19:46:50 +00:00
i386 Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
ia64 bus_add_child: change type of order parameter to u_int 2010-09-10 11:19:03 +00:00
isa bus_add_child: change type of order parameter to u_int 2010-09-10 11:19:03 +00:00
kern Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
kgssapi Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
libkern Provide memchr() in the libkern. 2010-06-02 17:27:23 +00:00
mips Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
modules MFtbemd: use MACHINE_CPUARCH 2010-09-13 02:05:42 +00:00
net Replace sbuf_overflowed() with sbuf_error(), which returns any error 2010-09-10 16:42:16 +00:00
net80211 Wrap remaining ieee80211_ratectl_node_init() calls missed in r211314. 2010-08-21 11:06:21 +00:00
netatalk Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
netgraph Fix typo 2010-08-02 22:26:08 +00:00
netinet Adding an address on an interface also requires the loopback route to 2010-09-12 18:04:47 +00:00
netinet6 MFp4 CH=183052 183053 183258: 2010-09-02 17:43:44 +00:00
netipsec MFp4 @178283: 2010-05-24 16:27:47 +00:00
netipx Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
netnatm Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
netncp Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
netsmb Switch to our preferred 2-clause BSD license. 2010-04-07 16:50:38 +00:00
nfs Move sys/nfsclient/nfs_lock.c into sys/nfs and build it as a separate 2010-07-24 22:11:11 +00:00
nfsclient Do not fork nfsiod directly from the vop methods. This causes LORs between 2010-09-12 19:06:08 +00:00
nfsserver - When VFS_VGET() is not supported, switch to VOP_LOOKUP(). 2010-08-26 23:41:40 +00:00
nlm Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
opencrypto Add an extra comment to the SDT probes definition. This allows us to get 2010-08-22 11:18:57 +00:00
pc98 Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
pci Remove unnecessary controller reinitialization. 2010-08-24 18:52:24 +00:00
powerpc Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
rpc - Check the result of malloc(M_NOWAIT) in replay_alloc(). The caller 2010-08-26 23:33:04 +00:00
security Replace sbuf_overflowed() with sbuf_error(), which returns any error 2010-09-10 16:42:16 +00:00
sparc64 Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
sun4v Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
sys Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
teken Make ^L with cons25 and origin mode bit more sane. 2010-08-09 18:07:15 +00:00
tools Add an extra comment to the SDT probes definition. This allows us to get 2010-08-22 11:18:57 +00:00
ufs Add dedicated routines to toggle lockmgr flags such as LK_NOSHARE and 2010-08-20 19:46:50 +00:00
vm Add a drain function for struct sysctl_req, and use it for a variety of 2010-09-09 18:33:46 +00:00
x86 Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
xdr Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
xen Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00
Makefile Create a custom branch where I will be able to do the merge. 2010-03-19 00:19:55 +00:00