Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get suspends from logind to ignore watchdog then #29

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jmerdich
Copy link

@jmerdich jmerdich commented Sep 2, 2022

On every resume, the watchdog thread happily reports that there has been
a deadlock since the canary hasn't responded since before the computer
resumed. Get notifications from logind over dbus to tell when suspend
happens and ignore the one watchdog violation that might happen then.

On start-suspend, this ignores a single timeout indefinitely. On resume, that
ignore gets a timeout of 2 seconds in the future (configurable), if it hasn't
already been tripped. At any point if a real deadlock occurs, it will take a max
of two watchdog periods to recognize it. If the configurable timeout is zero,
no ignores happen and the extra dbus work is skipped.

This code is not Y2038 safe... but neither is the old code.

Addresses #13, which has apparently been around for almost 10 years in some form.

On every resume, the watchdog thread happily reports that there has been
a deadlock since the canary hasn't responded since before the computer
resumed. Get notifications from logind over dbus to tell when suspend
happens and ignore the one watchdog violation that might happen then.

Depending on how threads are scheduled on resume (canary scheduled
first), the watchdog after resume might not happen and the next real
deadlock will take two watchdog cycles to hit, which is not horrible in
my mind but might be fixable by having the ignore condition have a
timeout for N seconds after resume.
On my personal computer, the scheduling race condition mentioned in the
last commit happens about ~1/4 of the time. That's too often to ignore.

Only make the resume-ignore condition apply for a few seconds after
resume. Additionally, this feature can now be disabled by setting a
threshold of zero.
@melvyn2
Copy link

melvyn2 commented Jul 13, 2023

Annoying that this has been open for almost a year, especially for such a simple fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants