summaryrefslogtreecommitdiff
path: root/src/oom
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
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')
-rw-r--r--src/oom/oomd-manager.c10
-rw-r--r--src/oom/oomd-util.c8
2 files changed, 9 insertions, 9 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");
diff --git a/src/oom/oomd-util.c b/src/oom/oomd-util.c
index ff0fc13c6f..a92bc5fdf6 100644
--- a/src/oom/oomd-util.c
+++ b/src/oom/oomd-util.c
@@ -530,11 +530,11 @@ void oomd_dump_memory_pressure_cgroup_context(const OomdCGroupContext *ctx, FILE
"%s\tPressure: Avg10: %lu.%02lu Avg60: %lu.%02lu Avg300: %lu.%02lu Total: %s\n"
"%s\tCurrent Memory Usage: %s\n",
strempty(prefix), ctx->path,
- strempty(prefix), LOAD_INT(ctx->mem_pressure_limit), LOAD_FRAC(ctx->mem_pressure_limit),
+ strempty(prefix), INT_SIDE(ctx->mem_pressure_limit), DECIMAL_SIDE(ctx->mem_pressure_limit),
strempty(prefix),
- LOAD_INT(ctx->memory_pressure.avg10), LOAD_FRAC(ctx->memory_pressure.avg10),
- LOAD_INT(ctx->memory_pressure.avg60), LOAD_FRAC(ctx->memory_pressure.avg60),
- LOAD_INT(ctx->memory_pressure.avg300), LOAD_FRAC(ctx->memory_pressure.avg300),
+ INT_SIDE(ctx->memory_pressure.avg10), DECIMAL_SIDE(ctx->memory_pressure.avg10),
+ INT_SIDE(ctx->memory_pressure.avg60), DECIMAL_SIDE(ctx->memory_pressure.avg60),
+ INT_SIDE(ctx->memory_pressure.avg300), DECIMAL_SIDE(ctx->memory_pressure.avg300),
FORMAT_TIMESPAN(ctx->memory_pressure.total, USEC_PER_SEC),
strempty(prefix), FORMAT_BYTES(ctx->current_memory_usage));