1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-02 12:20:51 +00:00
freebsd/sys/mips/include
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
..
_align.h Merge from projects/mips to head by hand: 2010-01-10 19:50:24 +00:00
_bus.h Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive 2010-07-20 19:25:11 +00:00
_inttypes.h Adjust limits and formats for ABIs with 64-bit longs. 2010-04-16 23:54:56 +00:00
_limits.h Adjust limits and formats for ABIs with 64-bit longs. 2010-04-16 23:54:56 +00:00
_stdint.h Update MIPS _stdint.h for 64 bit. Initial 64 bit changes for profile.h. 2010-07-29 14:04:29 +00:00
_types.h Merge from projects/mips to head by hand: 2010-01-10 19:50:24 +00:00
asm.h Move common macros into asm.h. Replace MIPS_CPU_NOP_DELAY with 2010-07-16 06:35:17 +00:00
atomic.h Whitespace fixes in mips/include, remove unused 'struct tlb' from locore.h 2010-08-27 07:45:50 +00:00
bootinfo.h
bswap.h
bus_dma.h
bus.h Rename TARGET_XLR_XLS to CPU_RMI to match other CPU_xxx definitions. 2010-08-13 12:56:00 +00:00
cache_mipsNN.h Update the port of FreeBSD to Cavium Octeon to use the Cavium Simple Executive 2010-07-20 19:25:11 +00:00
cache_r4k.h
cache.h Merge from projects/mips to head by hand: 2010-01-10 19:50:24 +00:00
cdefs.h Update macros for multiple ABI support from NetBSD. 2010-03-02 07:27:30 +00:00
clock.h Remove unused stuff from cpu.h. 2010-07-15 01:58:20 +00:00
clockvar.h
cpu.h Use #define for get_cyclecount rather than inline function. 2010-07-16 06:09:51 +00:00
cpufunc.h The functions in sys/mips/mips/psraccess.S can be implemented with 2010-09-13 05:03:37 +00:00
cpuinfo.h Remove some unused cruft. 2010-03-04 05:37:19 +00:00
cpuregs.h MIPS n64 support - continued... 2010-08-18 12:52:21 +00:00
cputypes.h
db_machdep.h Use cpuregs.h spellings over the cpu.h spellings. 2010-07-14 00:52:29 +00:00
elf.h Supply some useful information to the started image using ELF aux vectors. 2010-08-17 08:55:45 +00:00
endian.h Add parentheses around the argument 'x' used in the __bswapXX(x) macros. Revert 2010-08-11 02:28:39 +00:00
exec.h
float.h Merge from projects/mips to head by hand: 2010-01-10 19:50:24 +00:00
floatingpoint.h
fls64.h With this commit our friend RMI will now compile. I have 2009-10-30 08:53:11 +00:00
fpu.h
frame.h
gdb_machdep.h
hwfunc.h Adds JC's cleanup patches that fix it so 2010-05-18 04:02:34 +00:00
ieee.h
ieeefp.h
in_cksum.h
intr_machdep.h Rename TARGET_XLR_XLS to CPU_RMI to match other CPU_xxx definitions. 2010-08-13 12:56:00 +00:00
iodev.h
kdb.h Stash the context of the running thread at the time an IPI_STOP is received 2010-03-11 07:17:14 +00:00
limits.h
locore.h Whitespace fixes in mips/include, remove unused 'struct tlb' from locore.h 2010-08-27 07:45:50 +00:00
md_var.h The functions in sys/mips/mips/psraccess.S can be implemented with 2010-09-13 05:03:37 +00:00
memdev.h Whitespace fixes in mips/include, remove unused 'struct tlb' from locore.h 2010-08-27 07:45:50 +00:00
metadata.h
minidump.h
mips_opcode.h
mp_watchdog.h
mutex.h
param.h Add 3 level page tables for MIPS in n64. 2010-08-04 14:12:09 +00:00
pcb.h Whitespace fixes in mips/include, remove unused 'struct tlb' from locore.h 2010-08-27 07:45:50 +00:00
pci_cfgreg.h
pcpu.h SMP support for the mips port. 2010-02-09 06:24:43 +00:00
pmap.h Apply MIPS pmap clean up patch from alc@ (with minor change to KASSERT): 2010-08-29 05:39:21 +00:00
pmc_mdep.h Add support for hwpmc(4) on the MIPS 24K, 32 bit, embedded processor. 2010-03-03 15:05:58 +00:00
ppireg.h
proc.h Style: use #define<TAB> instead of #define<SPACE>. 2010-04-27 09:48:43 +00:00
profile.h Update MIPS _stdint.h for 64 bit. Initial 64 bit changes for profile.h. 2010-07-29 14:04:29 +00:00
pte.h Remove misleading comment in pte.h. MIPS PTE entries are software managed 2010-08-30 08:23:22 +00:00
ptrace.h
reg.h
regdef.h Merge from projects/mips to head by hand: 2010-01-10 19:50:24 +00:00
regnum.h Whitespace fixes in mips/include, remove unused 'struct tlb' from locore.h 2010-08-27 07:45:50 +00:00
reloc.h
resource.h
runq.h Fix RQB_FFS for 64 bit, we need to use ffsl() for 64bit. 2010-07-29 13:52:46 +00:00
setjmp.h Merge jmallett@'s n64 work into HEAD - changeset 7 2010-06-24 08:08:43 +00:00
sf_buf.h o) Use the direct map where possible for uiomove_fromphys, based on code from 2010-04-16 23:48:28 +00:00
sigframe.h
signal.h
smp.h Refactor timer management code with priority to one-shot operation mode. 2010-09-13 07:25:35 +00:00
stdarg.h
sysarch.h Merge r195128 from project/mips to head. 2010-01-09 04:59:57 +00:00
timerreg.h
tlb.h Move TLB definitions to tlb.h 2010-07-15 03:56:08 +00:00
trap.h o) Use inline functions to access coprocessor 0 registers rather than external 2010-04-17 01:17:31 +00:00
ucontext.h Whitespace fixes in mips/include, remove unused 'struct tlb' from locore.h 2010-08-27 07:45:50 +00:00
varargs.h
vm.h Merge jmallett@'s n64 work into HEAD - changeset 6 2010-06-23 19:42:01 +00:00
vmparam.h MIPS n64 support - continued... 2010-08-18 12:52:21 +00:00