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
Warn about long delays #754
Conversation
`HowLong` refers to different units in both functions, so make it more clear, what unit they expect. That also makes one comment superfluous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is a spec violation, the commit log should at least mention which section of the spec is violated and how.
Values greater than 100 microseconds violate the ACPI specification, so warn users about it. From ACPI Specification version 6.2 Errata A, 19.6.128 *Stall (Stall for a Short Time)*: > The implementation of Stall is OS-specific, but must not relinquish > control of the processor. Because of this, delays longer than 100 > microseconds must use Sleep instead of Stall.
5c3dbc3
to
e2d68b5
Compare
Only the stall is a specification violation. The sleep warning is just for good implementation, so sleeps longer than 10 ms hopefully get reimplemented by a polling approach or something similar. |
I’m seeing some long sleeps in existing ASL code, some examples:
MSI/MS/MS-7752/14FAD414B696: Sleep (0x64)
TONK/TN/TN1402/ABC6298CB633: Sleep (0x64)
ZOTAC/NM/NM10/27F12A855946: Sleep (0x0BB8)
TONK/C/C31/7F7E8D75C7FF: Sleep (0xFA)
Supermicro/X8/X8SIL/40AECBFF4573: Sleep (0x0BB8)
MSI/MS-7/MS-7A38/53B5D217D45C: Sleep (0x012C)
MSI/MS/MS-7721/3EF15301B047: Sleep (0xFA)
From: Paul Menzel ***@***.***>
Sent: Saturday, March 12, 2022 11:54 PM
To: acpica/acpica ***@***.***>
Cc: Subscribed ***@***.***>
Subject: Re: [acpica/acpica] Warn about long delays (PR #754)
@paulmenzel commented on this pull request.
________________________________
In source/components/executer/exsystem.c<#754 (comment)>:
@@ -338,6 +338,12 @@ AcpiExSystemDoSleep (
AcpiExExitInterpreter ();
+ if (HowLongMs > 50)
Indeed. Fixed.
—
Reply to this email directly, view it on GitHub<#754 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAHL7LB22QRF73UWRGDRRZDU7WNLHANCNFSM5PWTFSTA>.
Triage notifications on the go with GitHub Mobile for iOS<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675> or Android<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you are subscribed to this thread.Message ID: ***@***.******@***.***>>
|
[If replying to GitHub emails, please always remove the citation.]
Yes, and these should be warned/notified about. For example, 0x64 ms is 100 ms, 0xfa ms is 250 ms and 0xbb8 ms is 3000 ms greater than the current 2 second maximum. It’s non-optimal, that means bad, implementation in firmware, and gives a bad experience. (The question remains, if the OS like GNU/Linux hits these code paths.) |
This of course means that these machines will always generate warnings from ACPI. This is discouraged, especially in Linux. Perhaps implementing this warning in the iASL compiler would be better. |
Did you test, that these code paths from your examples are actually executed (all the time). Nevertheless, if these delays are always happening, the user should be made aware of them and the firmware should be fixed, so it’s exactly the wanted outcome of these changes.
Where is that documented, that it’s discouraged? Elaborate log messages, and actionable warnings are encouraged in my experience.
It would not hurt, but then only folks using an iASL with that patch will see the warning, and would be able to fix it. The user should still be informed about the bad implementation. |
No, I didn’t test for actual execution. We can try adding this warning, but if we get too many complaints about it, we will need to back it out. |
Understood. By the way, https://bugzilla.kernel.org/show_bug.cgi?id=208705 motivated me to look into this. Also to figure out, which of these sleeps is actually executed. |
A couple things: The description and the warning mention 10ms, but the code checks for >50ms: executer/exsystem: Warn about sleeps greater than 10 ms
The comment appears after the code that checks the time:
Also, I would say "Excessive sleep" instead of "excessive delay". |
Hmm, yes, that was in the first revision, but after @rafaeljw’s comment I force pushed the fixed code. Did I miss something?
Hmm, that comment was already there, and is the for the time limitation (to currently two seconds), isn’t it.
Will fix. |
I would add a comment at the start of the new code. |
I am happy to do that. I thought the – hopefully understandable warning – would make a comment obsolete. Do you have a suggestion? Do you mean something like:
|
Yes, this is ok. Probably split it into 2 lines, however. |
Quick boottime is important, so warn about sleeps greater than 10 ms. Distribution Linux kernels reach initrd in 350 ms, so excessive delays should be called out. 10 ms is chosen randomly, but three of such delays would already make up ten percent of the boottime.
e2d68b5
to
2a0d1d4
Compare
I force pushed the improved commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All 3 commits look good to me now.
Ok, got it. Thanks, Bob |
Sorry for the mistakes that crept in, and thank you all for fixing them: For the record, on the Acer TravelMate 5735Z/BA51_MV, BIOS V1.14 07/26/2011, there are some sleeps related to brightness configuration, that take 100 ms (0x64):
|
No description provided.