Reduce power consumption: timers must end eventually Background: We have a lot of timers, which constantly fire endlessly once started (calc has a particularly nasty one). So we chew up battery life on laptops when we're idling. When we're idle we should, after a short enough time, actually go idle and not wake up the laptop constantly. That means removing any leaked timers properly. This is a matter of tracking pending timers, and verifying that they are sensible, adding some infrastructure to help with this would be good too. See #i106485. Skills: building, C++
I'm sorry if i'm a newbie here, but I dont get it about "timers" and what they do. Any trail?
Created attachment 59907 [details] here's a patch to output "TICK" every time a timer timesout The problem is basically for battery life on e.g. a laptop. Ideally if office is open on a laptop and you're not doing anything with it you don't want the office to be running constantly waking up your processor and eating battery life if it has no work to do. This commit http://cgit.freedesktop.org/libreoffice/core/commit/?id=388486a510c8f5b04132a614fa5f2c330d229248 and this description https://issues.apache.org/ooo/show_bug.cgi?id=106487#c0 is a good example of what I mean, i.e. changed "always running a timer to layout equations" to "run the timer to layout equations only when the equation has changed"
Deleted "Easyhack" from summary.
Created attachment 71031 [details] better debugging patch
pkoroau pkoroau committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=7a5272dc29c6efdaa99f97a627e6d9b695ae32f6 fdo#38837: Timers must end eventually [Writer idle timer] The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
adding LibreOffice developer list as CC to unresolved EasyHacks for better visibility. see e.g. http://nabble.documentfoundation.org/minutes-of-ESC-call-td4076214.html for details
Is there still some scope on this bug where i can work..??because it sounds like an interesting bug but it would be great if someone would help me with the same. :)
The change: https://gerrit.libreoffice.org/gitweb?p=core.git;a=commitdiff;h=7a5272dc29c6efdaa99f97a627e6d9b695ae32f6;hp=4241ef2325d803914e9c29d8d6ec0e7c49f6996c done for this issue caused regression fdo#73165. Might need a close look, if the change is worth the regression (or if the regression can be healed).
Ashod Nakashian committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c57213764b387dddad946e78145cea607ca9f460 tdf#38837 Reduce power consumption by minimizing idle timers It will be available in 4.5.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ashod Nakashian committed a patch related to this issue. It has been pushed to "libreoffice-4-4": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2304bce084a87cdf2e0711f8408b53036f1d5d37&h=libreoffice-4-4 tdf#38837 Reduce power consumption by minimizing idle timers It will be available in 4.4.2. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Ashod Nakashian committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=b0fde7a912ff3aa370496802f20895b1158b072c tdf#38837 Reduce power consumption by minimizing idle timers It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Seems to have a positive effect on bug 91870. Will do more check. Is it planed to backport last commit (comment #11) to 5.0 ? Best regards. JBF
Ashod Nakashian committed a patch related to this issue. It has been pushed to "libreoffice-5-0": http://cgit.freedesktop.org/libreoffice/core/commit/?id=2113ee5491fa823b14b6c25b6d9a4f170452f9d3&h=libreoffice-5-0 tdf#38837 Reduce power consumption by minimizing idle timers It will be available in 5.0.1. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
@Ashod thanks for pushing it to 5.0.1 I think this deserves to be listed in the 5.0 release notes if you will be able to push it to 5.0.0 as well (another RC is scheduled before final release in august) https://wiki.documentfoundation.org/ReleaseNotes/5.0
what about the status of the issue? is the work done (so FIXED) or it has do be tweaked again to solve residual issues (leaving it as NEW)?
(In reply to tommy27 from comment #15) > what about the status of the issue? is the work done (so FIXED) or it has do > be tweaked again to solve residual issues (leaving it as NEW)? It's hard to tell if this concludes all cases, but there is one case that I'd like to investigate further. For now, I don't have any known cases to fix. We close it as fixed and reopen for new cases, or leave it open as a general high idle cpu usage cases.
I'd like to see it tagged FIXED and open a follow-up new report in case of remaining issues. anyway let's hear Bjorn's opinion about this.
(In reply to tommy27 from comment #17) > anyway let's hear Bjorn's opinion about this. No opinion at all on this. I didnt write this EasyHack, just copied it over from the wiki. @Michael: I assume this is yours, can it be killed?
This was my "easy" hack. I suspect that *calc* still has a timer that never ends. But if some one double checks that and finds that calc doesn't have an endless timer then this can be closed, and if calc does have one and writer doesn't then this could be renamed to "writer timers must end eventually" and closed off and a new one for the calc opened up in order to keep things tight and on-focus given the no of comments this now has
I guess there is some remaining timer related to automatic spelling (Shift+F7). Indeed with a large document opened while automatic spelling is disabled, I see CPU consumption even if I do nothing with the document. Then if I enable automatic spelling then disable it again, the CPU consumption of LO falls to zero. Best regards. JBF
(In reply to Jean-Baptiste Faure from comment #20) > I guess there is some remaining timer related to automatic spelling I've submitted a fix for this as part of tdf#92036.
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyBeginner SkillCpp ) [NinjaEdit]
JanI is default CC for Easy Hacks (Add Jan; remove LibreOffice Dev List from CC) [NinjaEdit]
seems solved