1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-23 11:18:54 +00:00
freebsd/sys/mips/mips
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
..
autoconf.c o) Eliminate the "stand" frame and its use. Use CALLFRAME_* everywhere. 2010-04-19 07:34:26 +00:00
bus_space_generic.c Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive 2010-07-20 19:25:11 +00:00
busdma_machdep.c Whitespace fixes - indent with tabs instead of spaces. 2010-09-07 06:02:43 +00:00
cache_mipsNN.c Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive 2010-07-20 19:25:11 +00:00
cache.c Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive 2010-07-20 19:25:11 +00:00
cpu.c Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive 2010-07-20 19:25:11 +00:00
db_disasm.c
db_interface.c Merge jmallett@'s n64 work into HEAD 2010-07-12 10:22:58 +00:00
db_trace.c Remove one layer of indirection. No need to call cpu_throw which then 2010-07-15 01:47:47 +00:00
dump_machdep.c Fix copyrights to reflect the origin of these files. 2009-06-29 16:45:50 +00:00
elf64_machdep.c Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
elf_machdep.c Reorganize syscall entry and leave handling. 2010-05-23 18:32:02 +00:00
elf_trampoline.c Use proper structure type for 64-bit headers 2010-02-18 19:02:33 +00:00
exception.S MIPS n64 support - continued... 2010-08-18 12:52:21 +00:00
fp.S Prefer the cpuregs.h spellings of register and bit names over cpu.h. 2010-07-14 00:41:22 +00:00
gdb_machdep.c Merge from projects/mips to head by hand: 2010-01-10 20:29:20 +00:00
genassym.c Add 3 level page tables for MIPS in n64. 2010-08-04 14:12:09 +00:00
in_cksum.c Merge from projects/mips to head by hand: 2010-01-10 20:29:20 +00:00
inckern.S - Revert changes accidentally killed by merge operation 2009-04-14 22:53:22 +00:00
intr_machdep.c SMP support for the mips port. 2010-02-09 06:24:43 +00:00
locore.S Rename TARGET_XLR_XLS to CPU_RMI to match other CPU_xxx definitions. 2010-08-13 12:56:00 +00:00
machdep.c Rename TARGET_XLR_XLS to CPU_RMI to match other CPU_xxx definitions. 2010-08-13 12:56:00 +00:00
mainbus.c bus_add_child: change type of order parameter to u_int 2010-09-10 11:19:03 +00:00
mem.c o) Back out my previous change to SWARM; some of it was to address an issue 2010-04-17 01:49:50 +00:00
mp_machdep.c Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
mpboot.S SMP support in n64. 2010-08-12 11:00:45 +00:00
nexus.c bus_add_child: change type of order parameter to u_int 2010-09-10 11:19:03 +00:00
pm_machdep.c SMP support in n64. 2010-08-12 11:00:45 +00:00
pmap.c Apply MIPS pmap clean up patch from alc@ (with minor change to KASSERT): 2010-08-29 05:39:21 +00:00
ptrace_machdep.c Place holder ptrace mips module. Not entirely sure what's required 2009-12-17 23:55:49 +00:00
stack_machdep.c Merge jmallett@'s n64 work into HEAD - changeset 7 2010-06-24 08:08:43 +00:00
support.S Add fuiword() in n64 for completeness. 2010-07-29 19:47:15 +00:00
swtch.S Use PTR_ADDU to change sp, so that it works for n64 too. 2010-07-31 19:13:08 +00:00
sys_machdep.c - Add support for handling TLS area address in kernel space. 2009-06-27 23:27:41 +00:00
tick.c Fix a race between clock_intr() and tick_ticker() when updating 2010-08-05 04:59:54 +00:00
tlb.c Remove save/restore of PageMask in tlb.c functions introduced in r209243. 2010-07-02 12:01:46 +00:00
trap.c Implement pmap changes suggested by alc@: 2010-08-12 10:09:28 +00:00
uio_machdep.c - Fix kseg0 address calculation - it doesn't always start at 2010-05-26 22:38:45 +00:00
vm_machdep.c SMP support in n64. 2010-08-12 11:00:45 +00:00