Compare commits

..

2 Commits

Author SHA1 Message Date
slee649 6e62842112
Merge ac6bd3c1fc into 321c202e7c 2024-11-25 16:55:44 +00:00
Sea-Eun Lee ac6bd3c1fc oomd: support reloading configuration at runtime 2024-11-25 16:55:21 +00:00
2 changed files with 2 additions and 5 deletions

View File

@ -74,10 +74,6 @@ int manager_parse_config_file(Manager *m) {
unsigned long l, f;
int r;
arg_swap_used_limit_permyriad = -1;
arg_mem_pressure_limit_permyriad = -1;
arg_mem_pressure_usec = DEFAULT_MEM_PRESSURE_DURATION_USEC;
static const ConfigTableItem items[] = {
{ "OOM", "SwapUsedLimit", config_parse_permyriad, 0, &arg_swap_used_limit_permyriad },
{ "OOM", "DefaultMemoryPressureLimit", config_parse_permyriad, 0, &arg_mem_pressure_limit_permyriad },

View File

@ -288,11 +288,12 @@ testcase_reload() {
mkdir -p /run/systemd/oomd.conf.d/
{
echo "[OOM]"
echo "SwapUsedLimit=90%"
echo "DefaultMemoryPressureLimit=60%"
echo "DefaultMemoryPressureDurationSec=2s"
} >/run/systemd/oomd.conf.d/99-oomd-test.conf
systemctl reload systemd-oomd.service
assert_in 'Swap Used Limit: 90.00%' "$(oomctl)"
assert_in 'Default Memory Pressure Limit: 60.00%' "$(oomctl)"
assert_in 'Default Memory Pressure Duration: 2s' "$(oomctl)"