irqbalance/constants.h
Shawn Bohrer 6e217da60d Compute load in nanoseconds
When computing the load_slice per irq we take the topology object load
divided by the interrupt count for the object.  Both of these values are
integervalues which means if the interrupt count is larger than the load
we get a load_slice of 0.  It seems likely that on modern processors
interrupt durations will be at least multiple nanoseconds long so if we
compute load in nanoseconds it should be >= the interrupt count.

The load is recomputed every SLEEP_INTERVAL which is currently 10s which
makes the maximum possible load 10e9 which easily fits in a uint64_t.

Note: corrected error checking on sysconf usage

Signed-off-by: Shawn Bohrer <sbohrer@rgmadvisors.com>
Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
2013-02-18 14:08:57 -05:00

34 lines
818 B
C

#ifndef __INCLUDE_GUARD_CONSTANTS_H
#define __INCLUDE_GUARD_CONSTANTS_H
/* interval between rebalance attempts in seconds */
#define SLEEP_INTERVAL 10
#define NSEC_PER_SEC 1e9
/* NUMA topology refresh intervals, in units of SLEEP_INTERVAL */
#define NUMA_REFRESH_INTERVAL 32
/* NIC interrupt refresh interval, in units of SLEEP_INTERVAL */
#define NIC_REFRESH_INTERVAL 32
/* minimum number of interrupts since boot for an interrupt to matter */
#define MIN_IRQ_COUNT 20
/* balancing tunings */
#define CROSS_PACKAGE_PENALTY 3000
#define NUMA_PENALTY 500
#define POWER_MODE_PACKAGE_THRESHOLD 20000
#define CLASS_VIOLATION_PENTALTY 6000
#define MSI_CACHE_PENALTY 10000
#define CORE_SPECIFIC_THRESHOLD 5000
/* power mode */
#define POWER_MODE_SOFTIRQ_THRESHOLD 20
#define POWER_MODE_HYSTERESIS 3
#endif