mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-03-08 20:58:20 +03:00
oomd: fix off-by-one when dumping kill candidates
When we kill a cgroup that is towards the end of the sorted candidate list (i.e. when we have to resort to killing a candidate with ManagedOOMPreference=avoid), this cgroup is not logged in the candidate list. This is due to an off-by-one error when assigning dump_until. (cherry picked from commit b814de305445f59baa289ab926cbe6ca05ac26a4)
This commit is contained in:
parent
b00cb050c8
commit
1e29d934de
@ -272,7 +272,7 @@ int oomd_kill_by_pgscan_rate(Hashmap *h, const char *prefix, bool dry_run, char
|
|||||||
continue; /* Try to find something else to kill */
|
continue; /* Try to find something else to kill */
|
||||||
}
|
}
|
||||||
|
|
||||||
dump_until = MAX(dump_until, i);
|
dump_until = MAX(dump_until, i + 1);
|
||||||
char *selected = strdup(sorted[i]->path);
|
char *selected = strdup(sorted[i]->path);
|
||||||
if (!selected)
|
if (!selected)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -316,7 +316,7 @@ int oomd_kill_by_swap_usage(Hashmap *h, uint64_t threshold_usage, bool dry_run,
|
|||||||
continue; /* Try to find something else to kill */
|
continue; /* Try to find something else to kill */
|
||||||
}
|
}
|
||||||
|
|
||||||
dump_until = MAX(dump_until, i);
|
dump_until = MAX(dump_until, i + 1);
|
||||||
char *selected = strdup(sorted[i]->path);
|
char *selected = strdup(sorted[i]->path);
|
||||||
if (!selected)
|
if (!selected)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user