You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the kernel already using the term badness used to calculate the term oom_score, nohang's usage of the term badness confused me for a while. After examining the source and playing around with it a bit, I wonder if it might be better in nohang to drop the term "badness" completely. It seems to work as a oom_score_adj_adj which is kind of a weird name, so could maybe be called oom_score_adj_extra. It seems like it's added to the kernel's oom_score, without displacing the oom_score_adj that its adjusted by in the kernel.
Through testing and viewing source, oom-sort shows the oom_score and oom_score_adj values as reported by the kernel, and isn't affected by and doesn't list separately the @BADNESS_ADJ_ conf file entries. This is actually where I started this journey, trying to debug regex's that turned out to be fine, because its output wasn't changing. :-) Could the oom-sort man page clarify it isn't affected by the conf file entries? (In retrospect, this makes sense, since there isn't a single /etc/ conf file for nohang, and it wasn't having me specify one.)
Better yet, could oom-sort either be changed or given an option to parse the conf file and use the BADNESS_ADJ_ entries?
This doesn't exactly fit here, but I'm assuming the systemd service needs to be restarted to reload conf file changes, and that during each cycle it doesn't check to see if the file has been updated. That could also be a nice addition to mention in the ongoing documentaiton project. Especially if someone views a nohang-calculated badness level like I am, if they were to miss this need, it wouldn't operate like they thought it would they rebooted.
In case it helps anyone, I'm using the following script to show me processes sorted in the order that nohang would kill them:
nohang-tasks
#!/usr/bin/bash
output_file="/tmp/nohang.$$"
sudo nohang --config /etc/nohang/nohang-desktop.conf --tasks > "${output_file}"
# print header
head -n 5 "${output_file}"
# print resorted table, everything between the lines starting #- and ## at the bottom (courtesy of konsolebox in irc #bash)
awk 'p && /^##/ { exit } p; /^#-/ { p = 1 }' "${output_file}" | \
sort -k 4,4 -k 2,2 --reverse
# print footer
tail -n 4 "${output_file}"
rm "${output_file}"
The text was updated successfully, but these errors were encountered:
does a better job. For long proc-ids you get output like #9081239 which is one column according to awk. So drop the '#' prefix. And sort -n seems more appropriate :)
I agree with the sentiment - would be nice if oom-sort would reflect the config-file settings somehow. Or clearly point out that it does not.
With the kernel already using the term
badness
used to calculate the termoom_score
, nohang's usage of the termbadness
confused me for a while. After examining the source and playing around with it a bit, I wonder if it might be better in nohang to drop the term "badness" completely. It seems to work as aoom_score_adj_adj
which is kind of a weird name, so could maybe be calledoom_score_adj_extra
. It seems like it's added to the kernel'soom_score
, without displacing theoom_score_adj
that its adjusted by in the kernel.Through testing and viewing source,
oom-sort
shows theoom_score
andoom_score_adj
values as reported by the kernel, and isn't affected by and doesn't list separately the@BADNESS_ADJ_
conf file entries. This is actually where I started this journey, trying to debug regex's that turned out to be fine, because its output wasn't changing. :-) Could theoom-sort
man page clarify it isn't affected by the conf file entries? (In retrospect, this makes sense, since there isn't a single/etc/
conf file for nohang, and it wasn't having me specify one.)Better yet, could
oom-sort
either be changed or given an option to parse the conf file and use theBADNESS_ADJ_
entries?This doesn't exactly fit here, but I'm assuming the systemd service needs to be restarted to reload conf file changes, and that during each cycle it doesn't check to see if the file has been updated. That could also be a nice addition to mention in the ongoing documentaiton project. Especially if someone views a nohang-calculated badness level like I am, if they were to miss this need, it wouldn't operate like they thought it would they rebooted.
In case it helps anyone, I'm using the following script to show me processes sorted in the order that nohang would kill them:
nohang-tasks
The text was updated successfully, but these errors were encountered: