diff options
author | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-10-11 19:44:22 +0200 |
---|---|---|
committer | Yu Watanabe <watanabe.yu+github@gmail.com> | 2024-10-19 05:34:48 +0200 |
commit | 88bbf187a9b2ebe0732caa1e886616ae5f8186da (patch) | |
tree | afc49f3c0ed5f6c5b4d289d0758d8abfb81aa293 | |
parent | Merge pull request #34820 from poettering/dissect-image-uclean (diff) | |
download | systemd-88bbf187a9b2ebe0732caa1e886616ae5f8186da.tar.xz systemd-88bbf187a9b2ebe0732caa1e886616ae5f8186da.zip |
TEST-55-OOMD: workaround for kernel regression in 6.12-rcX
This ignore failures when running on kernel-6.12-rcX, which has a
regression in the kernel scheduler that breaks PSI.
From https://github.com/systemd/systemd/issues/32730#issuecomment-2415312260
> There is a known scheduler bug in 6.12 that breaks psi. It leaks
> "running tasks" counts, which matches your symptoms of seeing partial
> pressure only.
>
> Do you see "inconsistent task state" warnings in dmesg | grep psi?
>
> A fix is queued in the scheduler tree, should be sent to Linus shortly:
> https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=c6508124193d42bbc3224571eb75bfa4c1821fbb
Workaround for #32730.
Diffstat (limited to '')
-rwxr-xr-x | test/units/TEST-55-OOMD.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/test/units/TEST-55-OOMD.sh b/test/units/TEST-55-OOMD.sh index 10b3777df6..6eb066e57e 100755 --- a/test/units/TEST-55-OOMD.sh +++ b/test/units/TEST-55-OOMD.sh @@ -95,6 +95,21 @@ else systemd-run -t -p MemoryMax=10M -p MemorySwapMax=0 -p MemoryZSwapMax=0 /bin/true fi +check_killed() { + local unit="${1:?}" + shift + + systemctl "$@" status "$unit" || return 0 # Yay! The service has been expectedly killed. + + # Workaround for the regression in kernel 6.12-rcX, explained in issue #32730. + if journalctl --no-hostname -k -t kernel --grep 'psi: inconsistent task state!'; then + echo "$unit is unexpectedly still alive, and inconsistency in PSI is reported by the kernel, skipping." >/skipped + exit 77 + fi + + return 1 # Huh? Something borked. +} + test_basic() { local cgroup_path="${1:?}" shift @@ -121,7 +136,7 @@ test_basic() { done # testbloat should be killed and testchill should be fine - if systemctl "$@" status TEST-55-OOMD-testbloat.service; then exit 42; fi + if ! check_killed TEST-55-OOMD-testbloat.service "$@"; then exit 42; fi if ! systemctl "$@" status TEST-55-OOMD-testchill.service; then exit 24; fi systemctl "$@" kill --signal=KILL TEST-55-OOMD-testbloat.service || : @@ -172,7 +187,7 @@ EOF # testmunch should be killed since testbloat had the avoid xattr on it if ! systemctl status TEST-55-OOMD-testbloat.service; then exit 25; fi - if systemctl status TEST-55-OOMD-testmunch.service; then exit 43; fi + if ! check_killed TEST-55-OOMD-testmunch.service; then exit 43; fi if ! systemctl status TEST-55-OOMD-testchill.service; then exit 24; fi systemctl kill --signal=KILL TEST-55-OOMD-testbloat.service || : @@ -248,7 +263,7 @@ EOF sleep 2 done - if systemctl status TEST-55-OOMD-testmunch.service; then exit 44; fi + if ! check_killed TEST-55-OOMD-testmunch.service; then exit 44; fi if ! systemctl status TEST-55-OOMD-testchill.service; then exit 23; fi systemctl kill --signal=KILL TEST-55-OOMD-testmunch.service || : |