CLIMB framework
include/sch/climb.h View source View on GitHubStructs
Section titled “Structs”climb_handle
Section titled “climb_handle” struct climb_handle (5 fields) source
§
climb_pressure_t pressure §
climb_pressure_t applied_pressure_internal If 0, this has not applied presssure
§
enum climb_pressure_kind kind climb_thread_data
Section titled “climb_thread_data” struct climb_thread_data (11 fields) source
§
climb_pressure_t direct_pressure pressure
Contributed direct pressure
§
climb_pressure_t indirect_pressure Indirect pressure from others
§
climb_pressure_t pressure_ewma EWMA of pressure over time
§
int32_t wanted_boost boost
0..20, how much this thread “wants”
§
int32_t effective_boost How much boosted (derived from wanted_boost_raw) this thread “gets”. This exists because CLIMB will take into account the existence of other threads and their boosts and periods spent to compute the boost of one thread
§
int32_t pressure_periods time
>=1 active, < 0 decaying, 0 inactive
§
bool on_climb_tree : 1 scheduler integration
Used to logically verify things
§
struct climb_handle handle if this thread becomes a CLIMB source, what would it “apply”?
climb_source
Section titled “climb_source” struct climb_source (2 fields) source
§
char *name §
climb_pressure_t base climb_pressure_kind
Section titled “climb_pressure_kind”Type Aliases
Section titled “Type Aliases”climb_pressure_t
Section titled “climb_pressure_t”Functions
Section titled “Functions”climb_thread_applied_pressure
Section titled “climb_thread_applied_pressure”climb_pressure_t climb_thread_applied_pressure(struct thread *t) source climb_thread_compute_pressure_to_apply
Section titled “climb_thread_compute_pressure_to_apply”climb_pressure_t climb_thread_compute_pressure_to_apply(struct thread *t) source climb_handle_apply
Section titled “climb_handle_apply”void climb_handle_apply(struct thread *t, struct climb_handle *h) source climb_handle_update
Section titled “climb_handle_update”void climb_handle_update(
struct thread *t,
struct climb_handle *h,
climb_pressure_t new_pressure
) source climb_handle_remove
Section titled “climb_handle_remove”void climb_handle_remove(struct climb_handle *h) source climb_handle_apply_locked
Section titled “climb_handle_apply_locked”void climb_handle_apply_locked(
struct thread *t,
struct climb_handle *h
) source climb_handle_remove_locked
Section titled “climb_handle_remove_locked”void climb_handle_remove_locked(struct climb_handle *h) source climb_recompute_pressure
Section titled “climb_recompute_pressure”climb_thread_remove
Section titled “climb_thread_remove”climb_thread_init
Section titled “climb_thread_init”climb_post_migrate_hook
Section titled “climb_post_migrate_hook”climb_get_thread_data
Section titled “climb_get_thread_data”climb_cmp_threads
Section titled “climb_cmp_threads”climb_handle_init
Section titled “climb_handle_init”struct climb_handle * climb_handle_init(
struct climb_handle *ch,
struct climb_source *cs,
enum climb_pressure_kind k
) source Macros
Section titled “Macros”CLIMB_BOOST_LEVELS
Section titled “CLIMB_BOOST_LEVELS”#define CLIMB_BOOST_LEVELS 20 source CLIMB_MIN_GLOBAL_BOOST
Section titled “CLIMB_MIN_GLOBAL_BOOST”#define CLIMB_MIN_GLOBAL_BOOST 1 source CLIMB_GLOBAL_BOOST_SCALE
Section titled “CLIMB_GLOBAL_BOOST_SCALE”#define CLIMB_GLOBAL_BOOST_SCALE(nt) source Expansion
#define CLIMB_GLOBAL_BOOST_SCALE(nt) (CLIMB_BOOST_LEVELS / nt) CLIMB_PRESSURE_KEY_SHIFT
Section titled “CLIMB_PRESSURE_KEY_SHIFT”#define CLIMB_PRESSURE_KEY_SHIFT 31 source one period == 0.5 pressure points
CLIMB_MAX_DECAY_PERIODS
Section titled “CLIMB_MAX_DECAY_PERIODS”#define CLIMB_MAX_DECAY_PERIODS 20 source Pressures
CLIMB_PRESSURE_THREAD_BASE
Section titled “CLIMB_PRESSURE_THREAD_BASE”CLIMB_PRESSURE_IO_BASE
Section titled “CLIMB_PRESSURE_IO_BASE”CLIMB_PRESSURE_LOCK_BASE
Section titled “CLIMB_PRESSURE_LOCK_BASE”CLIMB_PRESSURE
Section titled “CLIMB_PRESSURE”#define CLIMB_PRESSURE(x) source Expansion
#define CLIMB_PRESSURE(x) FX(x) Pressure space
CLIMB_PRESSURE_MAX
Section titled “CLIMB_PRESSURE_MAX”CLIMB_DIRECT_PRESSURE_MAX
Section titled “CLIMB_DIRECT_PRESSURE_MAX”CLIMB_INDIRECT_PRESSURE_MAX
Section titled “CLIMB_INDIRECT_PRESSURE_MAX”Indirect pressure scaling
CLIMB_INDIRECT_MIN_SCALE
Section titled “CLIMB_INDIRECT_MIN_SCALE”CLIMB_INDIRECT_WEIGHT
Section titled “CLIMB_INDIRECT_WEIGHT”CLIMB_BOOST_LEVEL_MAX
Section titled “CLIMB_BOOST_LEVEL_MAX”#define CLIMB_BOOST_LEVEL_MAX 20 source Boost space
CLIMB_BOOST_EWMA_ALPHA
Section titled “CLIMB_BOOST_EWMA_ALPHA”Pressure to boost shaping
CLIMB_PRESSURE_EXPONENT
Section titled “CLIMB_PRESSURE_EXPONENT”#define CLIMB_PRESSURE_EXPONENT 3 source cubic
CLIMB_PRESSURE_TO_BOOST_SCALE
Section titled “CLIMB_PRESSURE_TO_BOOST_SCALE”climb_thread_data_from_tree_node
Section titled “climb_thread_data_from_tree_node”#define climb_thread_data_from_tree_node(tn) source Expansion
#define climb_thread_data_from_tree_node(tn) \
(container_of(tn, struct climb_thread_data, climb_node)) CLIMB_SOURCE_EXTERN
Section titled “CLIMB_SOURCE_EXTERN”#define CLIMB_SOURCE_EXTERN(name) source Expansion
#define CLIMB_SOURCE_EXTERN(name) extern struct climb_source __climb_src_##name CLIMB_SOURCE_CREATE
Section titled “CLIMB_SOURCE_CREATE”#define CLIMB_SOURCE_CREATE(n, strname, b) source Expansion
#define CLIMB_SOURCE_CREATE(n, strname, b) \
struct climb_source __climb_src_##n = {.name = strname, .base = b} CLIMB_SOURCE
Section titled “CLIMB_SOURCE”#define CLIMB_SOURCE(name) source Expansion
#define CLIMB_SOURCE(name) &(__climb_src_##name)