3 ms·
"earlyoom is just polling"? > systemd-oomd periodically polls PSI statistics for the system and those cgroups to decide when to take action. It's unclear if t
by CGamesPlay 1y ago
"earlyoom is just polling"?
> systemd-oomd periodically polls PSI statistics for the system and those cgroups to decide when to take action.
It's unclear if the docs for systemd-oomd are incorrect or misleading; I do see from the kernel.org link that the recommended usage pattern is to use the `poll` system call, which in this context would mean "not polling", if I understand correctly.
- 100721 1y agoUnrelated to the topic, it seems awfully unintuitive to name a function ‘poll’ if the result is ‘not polling.’ I’m guessing there’s some history and maybe backwards-compatible rewrites?
- unilynx 1y agoPoll takes a timeout parameter. ‘Not polling’ is just a really long timeout
- friendzis 1y ago"Let the underlying platform do the polling and return once the condition is met"
- CGamesPlay 1y agoSpecifically, earlyoom’s README says it repeatedly checks (“periodically polls”) the memory pressure, using CPU each time even when there is no change. The “poll” system call waits for the kernel to notify the process that the file has changed, using no CPU until the call resolves. It’s unclear what systemd-oomd does, because it uses the phrase “periodically polls”,
- immibis 1y agoThe "poll" system call does not wait until a file changes.
- CGamesPlay 1y agos/the file has changed/it has published new data to the file descriptor/ See https://docs.kernel.org/accounting/psi.html https://docs.kernel.org/accounting/psi.html
- TheDong 1y agosystemd-oomd, oomd, and earlyoom all do poll for when to actually take action on OOM conditions. What I was trying to say is that the actual information on when there's memory pressure is more accurate for systemd-oomd / oomd because they use PSI, which the kernel itself is updating over time, and they just poll that, while earlyoom is also internally making its own estimates at a lower granularity than the kernel does.