![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
#include "caches/pixelpipe_cache_pressure.h"#include "common/logging.h"#include "system/macros.h"#include <string.h>
Include dependency graph for pixelpipe_cache_pressure.c:Go to the source code of this file.
Functions | |
| void | dt_pixelpipe_cache_pressure_monitor_init (dt_pixelpipe_cache_pressure_monitor_t *m, const size_t plan) |
| static double | _window_share (dt_pixelpipe_cache_pressure_monitor_t *m, const gint64 now, const gint64 min_window_us) |
| static size_t | _shed (dt_pixelpipe_cache_pressure_monitor_t *m, const dt_pixelpipe_cache_pressure_sink_t *sink, const double share, const char *origin) |
| static gboolean | _shed_too_soon (const dt_pixelpipe_cache_pressure_monitor_t *m, const gint64 now) |
| size_t | dt_pixelpipe_cache_pressure_react (dt_pixelpipe_cache_pressure_monitor_t *m, const dt_pixelpipe_cache_pressure_sink_t *sink) |
| void | dt_pixelpipe_cache_pressure_triggered (dt_pixelpipe_cache_pressure_monitor_t *m, const dt_pixelpipe_cache_pressure_sink_t *sink) |
| void | dt_pixelpipe_cache_pressure_watch_start (dt_pixelpipe_cache_pressure_monitor_t *m, void(*wake)(void *user), void *user) |
| void | dt_pixelpipe_cache_pressure_watch_stop (dt_pixelpipe_cache_pressure_monitor_t *m) |
|
static |
Definition at line 104 of file pixelpipe_cache_pressure.c.
References DT_DEBUG_MEMORY, DT_DEBUG_PIPECACHE, dt_pixelpipe_cache_pressure_after_shed(), dt_pixelpipe_cache_pressure_budget(), DT_PIXELPIPE_CACHE_PRESSURE_KEEP, dt_pixelpipe_cache_pressure_shed_target(), dt_print(), dt_pixelpipe_cache_pressure_sink_t::held, m, dt_pixelpipe_cache_pressure_sink_t::shed, and dt_pixelpipe_cache_pressure_sink_t::user.
Referenced by dt_pixelpipe_cache_pressure_react(), and dt_pixelpipe_cache_pressure_triggered().
|
inlinestatic |
Definition at line 128 of file pixelpipe_cache_pressure.c.
References DT_PIXELPIPE_CACHE_PSI_WINDOW_US, and m.
Referenced by dt_pixelpipe_cache_pressure_react(), and dt_pixelpipe_cache_pressure_triggered().
|
static |
Definition at line 78 of file pixelpipe_cache_pressure.c.
References DT_MEMORY_PRESSURE_MAX_LEVELS, dt_memory_pressure_read_full_stall(), i, levels(), m, and MAX.
Referenced by dt_pixelpipe_cache_pressure_react(), and dt_pixelpipe_cache_pressure_triggered().
| 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().
| 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().