summaryrefslogtreecommitdiff
path: root/src/oom/oomd-manager.c
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2021-09-24 17:28:27 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-09-25 07:10:44 +0900
commitf0e2cfc6dc1fc31a1a49c0a3bcaa56301e67e4ae (patch)
tree45149835ad52018d33bbe7c50ab31aa86f1ce9d5 /src/oom/oomd-manager.c
parent3f67dccca0130093453b9abad4bf8171a3a72687 (diff)
downloadsystemd-f0e2cfc6dc1fc31a1a49c0a3bcaa56301e67e4ae.tar.gz
basic: delete loadavg.h copy
loadavg.h is an internal header of the Linux source repository, and as such it is licensed as GPLv2-only, without syscall exception. We use it only for 4 macros, which are simply doing some math calculations that cannot thus be subject to copyright. Reimplement the same calculations in another internal header and delete loadavg.h from our tree.
Diffstat (limited to 'src/oom/oomd-manager.c')
-rw-r--r--src/oom/oomd-manager.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/oom/oomd-manager.c b/src/oom/oomd-manager.c
index 2684cfd85a..1dc83a505c 100644
--- a/src/oom/oomd-manager.c
+++ b/src/oom/oomd-manager.c
@@ -502,8 +502,8 @@ static int monitor_memory_pressure_contexts_handler(sd_event_source *s, uint64_t
log_debug("Memory pressure for %s is %lu.%02lu%% > %lu.%02lu%% for > %s with reclaim activity",
t->path,
- LOAD_INT(t->memory_pressure.avg10), LOAD_FRAC(t->memory_pressure.avg10),
- LOAD_INT(t->mem_pressure_limit), LOAD_FRAC(t->mem_pressure_limit),
+ INT_SIDE(t->memory_pressure.avg10), DECIMAL_SIDE(t->memory_pressure.avg10),
+ INT_SIDE(t->mem_pressure_limit), DECIMAL_SIDE(t->mem_pressure_limit),
FORMAT_TIMESPAN(m->default_mem_pressure_duration_usec, USEC_PER_SEC));
r = update_monitored_cgroup_contexts_candidates(
@@ -527,8 +527,8 @@ static int monitor_memory_pressure_contexts_handler(sd_event_source *s, uint64_t
log_notice("Killed %s due to memory pressure for %s being %lu.%02lu%% > %lu.%02lu%%"
" for > %s with reclaim activity",
selected, t->path,
- LOAD_INT(t->memory_pressure.avg10), LOAD_FRAC(t->memory_pressure.avg10),
- LOAD_INT(t->mem_pressure_limit), LOAD_FRAC(t->mem_pressure_limit),
+ INT_SIDE(t->memory_pressure.avg10), DECIMAL_SIDE(t->memory_pressure.avg10),
+ INT_SIDE(t->mem_pressure_limit), DECIMAL_SIDE(t->mem_pressure_limit),
FORMAT_TIMESPAN(m->default_mem_pressure_duration_usec, USEC_PER_SEC));
return 0;
}
@@ -811,7 +811,7 @@ int manager_get_dump_string(Manager *m, char **ret) {
"System Context:\n",
yes_no(m->dry_run),
PERMYRIAD_AS_PERCENT_FORMAT_VAL(m->swap_used_limit_permyriad),
- LOAD_INT(m->default_mem_pressure_limit), LOAD_FRAC(m->default_mem_pressure_limit),
+ INT_SIDE(m->default_mem_pressure_limit), DECIMAL_SIDE(m->default_mem_pressure_limit),
FORMAT_TIMESPAN(m->default_mem_pressure_duration_usec, USEC_PER_SEC));
oomd_dump_system_context(&m->system_context, f, "\t");