1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-28 16:43:09 +00:00
freebsd/sys/dev
Jonathan T. Looney 5eaa6f01f5 Improve accuracy of PMC sampling frequency
The code tracks a counter which is the number of events until the next
sample. On context switch in, it loads the saved counter. On context
switch out, it tries to calculate a new saved counter.

Problems:

1. The saved counter was shared by all threads in a process. However, this
means that all threads would be initially loaded with the same saved
counter. However, that could result in sampling more often than once every
X number of events.

2. The calculation to determine a new saved counter was backwards. It
added when it should have subtracted, and subtracted when it should have
added. Assume a single-threaded process with a reload count of 1000 events.
Assuming the counter on context switch in was 100 and the counter on context
switch out was 50 (meaning the thread has "consumed" 50 more events), the
code would calculate a new saved counter of 150 (instead of the proper 50).

Fix:

1. As soon as the saved counter is used to initialize a monitor for a
thread on context switch in, set the saved counter to the reload count.
That way, subsequent threads to use the saved counter will get the full
reload count, assuring we sample at least once every X number of events
(across all threads).

2. Change the calculation of the saved counter. Due to the change to the
saved counter in #1, we simply need to add (modulo the reload count) the
remaining counter time we retrieve from the CPU when a thread is context
switched out.

Differential Revision:	https://reviews.freebsd.org/D4122
Approved by:	gnn (mentor)
MFC after:	1 month
Sponsored by:	Juniper Networks
2015-11-16 15:22:15 +00:00
..
aac
aacraid
acpi_support
acpica Disable suspend when we're shutting down. This solves the "tell FreeBSD 2015-10-01 10:52:26 +00:00
adb
adlink
advansys
ae
age
agp
aha
ahb
ahci Allow AHCI driver attach to all known chips reporting RAID class. 2015-09-22 15:06:26 +00:00
aic
aic7xxx
alc
ale
alpm
altera
amdpm
amdsbwd
amdsmb
amdtemp
amr
an
arcmsr
asmc
ata Increase reset assertion time from 10 to 100us. 2015-11-15 10:58:01 +00:00
ath Fix kernel build, broken in r290612 2015-11-09 20:22:59 +00:00
atkbdc
auxio
bce
beri
bfe
bge
bktr
bm
buslogic
bvm
bwi net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output(). 2015-10-12 04:55:20 +00:00
bwn net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output(). 2015-10-12 04:55:20 +00:00
bxe Add support for reading device temperature 2015-10-12 20:21:17 +00:00
cadence
cardbus
cas
ce
cesa
cfe
cfi
ciss
cm
cmx
coretemp
cp
cpuctl
cpufreq
cs
ct
ctau
cx
cxgb Rename linuxapi[.ko] into linuxkpi[.ko], to reflect that it is a 2015-10-22 09:50:45 +00:00
cxgbe cxgbe/t4_tom: add a knob to the default configuration file to tune 2015-11-10 02:29:19 +00:00
cy
cyapa
dc
dcons
de
digi
dpms
dpt
drm
drm2 drm/i915: Reduce diff with Linux 3.8 2015-11-08 19:29:34 +00:00
dwc
e1000 Add support for SCTP checksum offloading for the 82580 controller 2015-11-10 10:55:57 +00:00
ed
eisa
en
ep
esp
et
etherswitch Introduce e6000sw etherswitch support 2015-10-25 22:14:04 +00:00
ex
exca
fatm
fb
fdc
fdt
fe
ffec
filemon Remove unneeded mutex.h include, missed in r287155. 2015-11-04 22:49:34 +00:00
firewire
flash Add support for s25fl256s. I /think/ it's a 32mb NOR flash part. 2015-11-05 03:13:10 +00:00
fxp
gem
glxiic
glxsb
gpio
gxemul
hatm
hifn
hme
hpt27xx
hptiop
hptmv hptmv(4): Fix broken sysctl(9) API assumptions 2015-11-07 23:05:23 +00:00
hptnr
hptrr
hwpmc Improve accuracy of PMC sampling frequency 2015-11-16 15:22:15 +00:00
hyperv
ic
ichiic
ichsmb
ichwd
ida
ie
if_ndis net80211: drop redundant 3rd parameter from iv_key_set(). 2015-10-03 21:48:27 +00:00
iicbus Add FDT compatibility to the icee driver. 2015-10-22 01:04:31 +00:00
iir
intpm
io
ioat ioat: Handle channel-fatal HW errors safely 2015-10-31 20:38:06 +00:00
ipmi
ips
ipw net80211 & wireless drivers: remove duplicate defines (noop) 2015-09-22 02:44:59 +00:00
isci
iscsi
iscsi_initiator
isl
ismt
isp Fix/improve CRN tracking. 2015-11-14 19:47:17 +00:00
ispfw Remove residual verbosity. 2015-10-22 15:13:47 +00:00
iwi net80211: WME callback cleanup in various drivers 2015-11-05 17:58:18 +00:00
iwm Fix IEEE80211_ADDR_COPY() usage. 2015-10-22 01:36:16 +00:00
iwn iwn(4): various simple fixes 2015-11-05 22:44:36 +00:00
ixgb
ixgbe Add support for sysctl knobs to live tune the per interrupt rx/tx packet 2015-10-13 17:34:18 +00:00
ixl Fix ixl debug sysctls panic 2015-11-12 09:45:35 +00:00
jme
joy
kbd
kbdmux
ksyms
le
led
lge
lmc
malo net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output(). 2015-10-12 04:55:20 +00:00
mbox
mc146818
mca
mcd
md
mem
mfi
mge Improve style in mge driver 2015-10-25 22:20:13 +00:00
mii
mk48txx
mlx
mlx5 Compile fix for 32-bit platforms: 2015-11-12 09:52:37 +00:00
mly
mmc
mn
mpr Remove _FreeBSD_version check for something that was only an issue with 2015-10-16 17:56:43 +00:00
mps Revert an extra hunk that crept into the last commit. 2015-10-16 20:18:12 +00:00
mpt
mrsas
mse
msk
mvs
mwl net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output(). 2015-10-12 04:55:20 +00:00
mxge
my
nand
ncr
ncv
netfpga10g/nf10bmac
netmap
nfe
nfsmb
nge
nmdm
nsp
ntb if_ntb: Clear the right QP in the free bitmap 2015-11-14 01:23:13 +00:00
null
nvd nvd, nvme: report stripesize through GEOM disk layer 2015-10-30 16:35:18 +00:00
nvme nvd, nvme: report stripesize through GEOM disk layer 2015-10-30 16:35:18 +00:00
nvram
nvram2env
nxge Fix what looks like a consistent copy&paste error. 2015-09-27 12:19:36 +00:00
oce
ofw Improve r290373, do a runtime check rather than a compile time switch. I 2015-11-08 21:06:51 +00:00
otus otus(4) - add flags for RX filter, configuration and sniffer. 2015-11-06 03:09:26 +00:00
ow
patm
pbio
pccard
pccbb
pcf Use IIC_EBUSBSY and IIC_BUSERR status values consistantly across all drivers. 2015-10-09 22:49:50 +00:00
pci Add a new helper function for PCI devices to locate the upstream 2015-11-05 21:27:25 +00:00
pcn
pdq
pms
powermac_nvram
ppbus
ppc
proto
psci
pst
pty
puc
qlxgb
qlxgbe ql_hw.c: fixed error code INJCT_HEARTBEAT_FAILURE 2015-10-20 17:27:11 +00:00
qlxge
quicc
ral Remove the static function declaration. 2015-10-29 04:51:27 +00:00
random Fix printf-like formats for KASSERT. 2015-10-05 10:45:52 +00:00
rc
rccgpio
re - Although it doesn't make a whole lot of sense to enable RX and TX 2015-11-09 00:19:04 +00:00
rl - Although it doesn't make a whole lot of sense to enable RX and TX 2015-11-09 00:19:04 +00:00
rndtest
rp
rt
safe
sbni
scc
scd
sdhci Add support for the BCM57765 card reader. 2015-10-15 04:22:56 +00:00
sec
sf
sfxge
sge
si
siba
siis
sio
sis
sk
smbus
smc
sn
snc
snp
sound - Plugging a memory leak when malloc() failed during initialisation; 2015-10-24 19:40:03 +00:00
speaker
spibus
ste
stg
stge
streams
sym Add the arm64 define. 2015-10-08 17:32:17 +00:00
syscons
tdfx
terasic
ti
tl
tpm
trm
tsec
twa
twe
tws
tx
txp
uart
ubsec
usb urtwn(4): add IBSS mode support 2015-11-10 12:52:26 +00:00
utopia
vge
viapm
viawd
videomode
virtio
vkbd
vmware/vmxnet3
vnic Mark the thunder_mdio_fdt driver as early, the bgx needs it to exist so it 2015-11-06 14:40:51 +00:00
vr
vt
vte
vx
vxge
watchdog
wb
wbwd
wds
wi net80211: move ieee80211_free_node() call on error from ic_raw_xmit() to ieee80211_raw_output(). 2015-10-12 04:55:20 +00:00
wl
wpi Remove BUS_DMA_NOWAIT from bus_dma_tag_create() invocations as it's 2015-10-21 06:23:57 +00:00
wtap wtap: remove some obsolete radiotap(9) code 2015-10-22 15:20:33 +00:00
xe
xen xen-blkfront: add support for unmapped IO 2015-11-09 12:22:44 +00:00
xl