When setting Linux process oom_score_adj values handles cases where the main process' score has already been adjusted
Categories
(Core :: Hardware Abstraction Layer (HAL), enhancement)
Tracking
()
People
(Reporter: gsvelto, Unassigned)
References
Details
Attachments
(1 file)
|
104.10 KB,
image/png
|
Details |
See bug 1771712 comment 14. Under certain conditions the main process oom_score_adj value might have already been adjusted to something different than 0. In this case we need to shift the adjustments accordingly, possibly adjusting the intervals between the different levels to prevent clamping.
| Reporter | ||
Updated•3 years ago
|
Comment 1•3 years ago
|
||
The severity field is not set for this bug.
:gsvelto, could you have a look please?
For more information, please visit auto_nag documentation.
| Reporter | ||
Comment 2•3 years ago
|
||
This is not a bug so I don't think it needs a severity.
Comment 3•10 months ago
|
||
I seem to have the opposite problem here. Bug 1771712 comment 14 (mentioned in the bug report) says:
This doesn't work as expected when running as a systemd service, which ships
OOMScoreAdjust=100for user@.service and another +100 because ofDefaultOOMScoreAdjustis unset.
Maybe Firefox could read its current oom_score_adj early and adjust on that base.
However, here, Firefox starts with an oom_score_adj value of 0. This means that Firefox tabs will get an oom_score_adj value lower than user systemd services. At https://github.com/rfjakob/earlyoom/issues/344 I reported an issue because pipewire-pulse (with oom_score_adj=200 for the above reason) was killed before a Firefox tab that was much larger (taking more and more memory due to bug 1964852, here more than 3 GB before it got killed by earlyoom). Note that without earlyoom, this is even worse as you can see in this bug 1964852 comment 3.
That said, I think that the core issue is the systemd strategy, because most user processes also start with an oom_score_adj value of 0 and do not change it.
This is a screenshot showing Firefox's oom_adj_score, taken from my virtual machine running recent Arch Linux KDE that is pretty out-of-box and doesn't have a lot of customization. The main process has oom_score_adj as 200, some child processes has 100, all web content has 233.
most user processes also start with an oom_score_adj value of 0 and do not change it.
In my case most (if not all) of them are running with oom_score_adj of 200, e.g. Konsole, my shell.
Comment 5•10 months ago
|
||
(In reply to lilydjwg from comment #4)
This is a screenshot showing Firefox's oom_adj_score, taken from my virtual machine running recent Arch Linux KDE that is pretty out-of-box and doesn't have a lot of customization. The main process has oom_score_adj as 200, some child processes has 100, all web content has 233.
AFAIK, the tabs are the "Isolated Web Co" processes, but your screenshot doesn't show any. On my machine, they have an oom_score_adj value of 100 or 167, so less than 200 in all cases.
In my case most (if not all) of them are running with oom_score_adj of 200, e.g. Konsole, my shell.
Perhaps because that's the default in KDE. I do not use any desktop environment, just an X session.
Comment 6•10 months ago
|
||
(In reply to Vincent Lefevre from comment #5)
(In reply to lilydjwg from comment #4)
In my case most (if not all) of them are running with oom_score_adj of 200, e.g. Konsole, my shell.
Perhaps because that's the default in KDE. I do not use any desktop environment, just an X session.
And the processes started from ssh also have an oom_score_adj of 0.
(In reply to Vincent Lefevre from comment #5)
AFAIK, the tabs are the "Isolated Web Co" processes, but your screenshot doesn't show any. On my machine, they have an oom_score_adj value of 100 or 167, so less than 200 in all cases.
Ah yes, I didn't open any webpages! I tried again and the "Isolated Web Co" has a oom_score_adj value of 100.
Perhaps because that's the default in KDE. I do not use any desktop environment, just an X session.
It also could be different systemd versions, or even downstream configuration / patches. I'm using systemd 257.7 on Arch Linux.
Comment 8•10 months ago
|
||
Here, 257.7 under Debian 13 (upcoming). It is actually the display manager that starts the X session: it has 2 children: Xorg and a "lightdm --session-child" with everything below it; lightdm and its descendants generally have an oom_score_adj value of 0. Both via lightdm and sshd-session, these are just forks; systemd is not involved. That's why the oom_score_adj value is 0 (unless it is changed by the process itself).
Description
•