![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Include dependency graph for pixelpipe_cache_pressure.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | dt_pixelpipe_cache_pressure_t |
| struct | dt_pixelpipe_cache_pressure_monitor_t |
| struct | dt_pixelpipe_cache_pressure_sink_t |
Macros | |
| #define | DT_PIXELPIPE_CACHE_PSI_WINDOW_US ((gint64)2 * 1000 * 1000) |
| #define | DT_PIXELPIPE_CACHE_PSI_SHED 0.10 |
| #define | DT_PIXELPIPE_CACHE_PSI_CALM 0.02 |
| #define | DT_PIXELPIPE_CACHE_PRESSURE_KEEP SIZE_MAX |
Typedefs | |
| typedef struct dt_pixelpipe_cache_pressure_t | dt_pixelpipe_cache_pressure_t |
| typedef struct dt_pixelpipe_cache_pressure_monitor_t | dt_pixelpipe_cache_pressure_monitor_t |
| typedef struct dt_pixelpipe_cache_pressure_sink_t | dt_pixelpipe_cache_pressure_sink_t |
| #define DT_PIXELPIPE_CACHE_PRESSURE_KEEP SIZE_MAX |
Definition at line 60 of file pixelpipe_cache_pressure.h.
| #define DT_PIXELPIPE_CACHE_PSI_CALM 0.02 |
Definition at line 56 of file pixelpipe_cache_pressure.h.
| #define DT_PIXELPIPE_CACHE_PSI_SHED 0.10 |
Definition at line 54 of file pixelpipe_cache_pressure.h.
| #define DT_PIXELPIPE_CACHE_PSI_WINDOW_US ((gint64)2 * 1000 * 1000) |
Definition at line 51 of file pixelpipe_cache_pressure.h.
| typedef struct dt_pixelpipe_cache_pressure_t dt_pixelpipe_cache_pressure_t |
|
inlinestatic |
Record what a shed achieved: eviction took the footprint from before to after. The mark is where pressure struck, and the ceiling follows what is actually left – never under the floor, since the ceiling only steers allocations and shedding itself still goes lower while the pressure lasts.
Definition at line 137 of file pixelpipe_cache_pressure.h.
References dt_pixelpipe_cache_pressure_floor(), MAX, MIN, and p.
Referenced by _a_shed_lowers_the_budget_to_what_is_left(), _recovery_reaches_the_plan_without_a_jump(), _recovery_waits_under_the_mark(), _reported_budget_never_underflows_its_readers(), _shed(), and _the_budget_never_falls_under_the_floor().
|
inlinestatic |
What allocations must evict down to.
Definition at line 99 of file pixelpipe_cache_pressure.h.
Referenced by _a_shed_lowers_the_budget_to_what_is_left(), _an_empty_cache_is_not_the_cause(), _cache_budget_locked(), _recovery_reaches_the_plan_without_a_jump(), _recovery_waits_under_the_mark(), _reported_budget_never_underflows_its_readers(), _shed(), _starts_at_the_plan(), _the_budget_never_falls_under_the_floor(), dt_pixelpipe_cache_pressure_react(), and dt_pixelpipe_cache_pressure_reported().
|
inlinestatic |
The highest the ceiling may climb to until the mark recovers further.
Definition at line 105 of file pixelpipe_cache_pressure.h.
Referenced by _recovery_waits_under_the_mark(), _starts_at_the_plan(), dt_pixelpipe_cache_pressure_react(), and dt_pixelpipe_cache_pressure_relax().
|
inlinestatic |
Below an eighth of the plan, shedding frees nothing worth having and the stall is somebody else's: the cache neither sheds nor lowers its budget.
Definition at line 76 of file pixelpipe_cache_pressure.h.
References p, and dt_pixelpipe_cache_pressure_t::plan.
Referenced by _an_empty_cache_is_not_the_cause(), _the_budget_never_falls_under_the_floor(), dt_pixelpipe_cache_pressure_after_shed(), and dt_pixelpipe_cache_pressure_shed_target().
|
inlinestatic |
Definition at line 91 of file pixelpipe_cache_pressure.h.
References dt_pixelpipe_cache_pressure_mark_top(), and p.
Referenced by _plan_of(), and dt_pixelpipe_cache_pressure_monitor_init().
|
inlinestatic |
The mark tops out here rather than at the plan, so that 7/8 of it MEETS the plan instead of the ceiling jumping the last eighth the moment the mark is full. The + 8 covers the integer division: without it, 7/8 of a full mark lands a few hundred bytes under the plan and the ceiling can never quite come home. Written this way, and not as plan * 8 / 7, because the multiplication overflows a 32-bit size_t for a plan of a few GiB.
Definition at line 86 of file pixelpipe_cache_pressure.h.
References p.
Referenced by _an_empty_cache_is_not_the_cause(), dt_pixelpipe_cache_pressure_init(), and dt_pixelpipe_cache_pressure_relax().
| void dt_pixelpipe_cache_pressure_monitor_init | ( | dt_pixelpipe_cache_pressure_monitor_t * | m, |
| size_t | plan | ||
| ) |
A monitor for a cache planned at plan bytes: full budget, nothing measured, no watcher.
Definition at line 63 of file pixelpipe_cache_pressure.c.
References dt_pixelpipe_cache_pressure_init(), and m.
Referenced by dt_dev_pixelpipe_cache_init().
| size_t dt_pixelpipe_cache_pressure_react | ( | dt_pixelpipe_cache_pressure_monitor_t * | m, |
| const dt_pixelpipe_cache_pressure_sink_t * | sink | ||
| ) |
Close the window since the last measurement and act on it: shed past the threshold, let the budget climb back under it, do nothing in between. Returns the bytes shed.
Definition at line 133 of file pixelpipe_cache_pressure.c.
References _shed(), _shed_too_soon(), _window_share(), DT_DEBUG_MEMORY, DT_DEBUG_PIPECACHE, dt_pixelpipe_cache_pressure_budget(), dt_pixelpipe_cache_pressure_cap(), dt_pixelpipe_cache_pressure_relax(), DT_PIXELPIPE_CACHE_PSI_CALM, DT_PIXELPIPE_CACHE_PSI_SHED, DT_PIXELPIPE_CACHE_PSI_WINDOW_US, dt_print(), and m.
Referenced by _pressure_react_locked().
|
inlinestatic |
One calm window: the mark recovers by 1/1024 of the plan and the ceiling by 1/32, up to the cap. TRUE when the ceiling actually moved, which is the only thing worth logging.
Definition at line 146 of file pixelpipe_cache_pressure.h.
References dt_pixelpipe_cache_pressure_cap(), dt_pixelpipe_cache_pressure_mark_top(), FALSE, MIN, p, and TRUE.
Referenced by _recovery_reaches_the_plan_without_a_jump(), _recovery_waits_under_the_mark(), and dt_pixelpipe_cache_pressure_react().
|
inlinestatic |
The budget to report outward (tiling plans against it): never under what is held, since the readers compute max - current unsigned.
Definition at line 112 of file pixelpipe_cache_pressure.h.
References dt_pixelpipe_cache_pressure_budget(), MAX, and p.
Referenced by _reported_budget_never_underflows_its_readers(), _starts_at_the_plan(), and dt_dev_pixelpipe_cache_get_usage().
|
inlinestatic |
The footprint to evict down to for a window share of which was fully stalled, while holding current bytes – a quarter of it, half when the stall is severe, and at least 256 MiB so a nearly-empty cache is not shed one byte at a time. DT_PIXELPIPE_CACHE_PRESSURE_KEEP when the stall is under the threshold, or when the cache holds too little to be the cause.
Definition at line 122 of file pixelpipe_cache_pressure.h.
References dt_pixelpipe_cache_pressure_floor(), DT_PIXELPIPE_CACHE_PRESSURE_KEEP, DT_PIXELPIPE_CACHE_PSI_SHED, MAX, and p.
Referenced by _an_empty_cache_is_not_the_cause(), _shed(), and _sheds_a_share_of_what_is_held().
| void dt_pixelpipe_cache_pressure_triggered | ( | dt_pixelpipe_cache_pressure_monitor_t * | m, |
| const dt_pixelpipe_cache_pressure_sink_t * | sink | ||
| ) |
The kernel raised a trigger: shed now, without waiting for a window of ours to close.
Definition at line 157 of file pixelpipe_cache_pressure.c.
References _shed(), _shed_too_soon(), _window_share(), DT_PIXELPIPE_CACHE_PSI_SHED, DT_PIXELPIPE_CACHE_PSI_WINDOW_US, m, and MAX.
Referenced by _pressure_wake().
| void dt_pixelpipe_cache_pressure_watch_start | ( | dt_pixelpipe_cache_pressure_monitor_t * | m, |
| void(*)(void *user) | wake, | ||
| void * | user | ||
| ) |
Definition at line 167 of file pixelpipe_cache_pressure.c.
References DT_DEBUG_MEMORY, DT_DEBUG_PIPECACHE, dt_memory_pressure_watch_levels(), dt_memory_pressure_watch_start(), DT_PIXELPIPE_CACHE_PSI_SHED, DT_PIXELPIPE_CACHE_PSI_WINDOW_US, dt_print(), IS_NULL_PTR, and m.
Referenced by dt_dev_pixelpipe_cache_init().
| void dt_pixelpipe_cache_pressure_watch_stop | ( | dt_pixelpipe_cache_pressure_monitor_t * | m | ) |
Join that thread. Nothing the sink touches may go away before this returns.
Definition at line 181 of file pixelpipe_cache_pressure.c.
References dt_memory_pressure_watch_stop(), and m.
Referenced by dt_dev_pixelpipe_cache_cleanup().