Bug 335591 - [RFE] openoffice.org wakes up the CPU while doing nothing
Summary: [RFE] openoffice.org wakes up the CPU while doing nothing
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: libreoffice
Version: rawhide
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Caolan McNamara
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: bzcl34nup
Depends On:
Blocks: wakeup
TreeView+ depends on / blocked
 
Reported: 2007-10-17 03:55 UTC by William Lovaton
Modified: 2012-09-12 13:24 UTC (History)
9 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-09-12 13:24:00 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
FreeDesktop.org 38837 0 None None None 2012-09-12 13:24:00 UTC
OpenOffice.org 82726 0 None None None Never
OpenOffice.org 83195 0 None None None Never
OpenOffice.org 106485 0 None None None Never
OpenOffice.org 106487 0 None None None Never
OpenOffice.org 106490 0 None None None Never
OpenOffice.org 106492 0 None None None Never
OpenOffice.org 106502 0 None None None Never

Description William Lovaton 2007-10-17 03:55:09 UTC
Description of problem:
According to powertop openoffice.org is waking up the CPU 4 times per second
while there is no activity on the application, this way preventing the system
from saving power.

The test is done with a fresh start up, no file loaded and the window unfocused.
 This way openoffice (swriter.bin and scalc.bin too) shows up on the top of the
list as the worst offenders on a very quiet system.

Doing an "strace -tt -p <pid-of-OO.o>" reveals the following:

[william@localhost ~]$ strace -tt -p 31819
Process 31819 attached - interrupt to quit
22:34:44.435944 gettimeofday({1192592084, 436457}, NULL) = 0
22:34:44.436722 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:44.437152 gettimeofday({1192592084, 437357}, NULL) = 0
22:34:44.437523 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 0) = 0
22:34:44.437987 gettimeofday({1192592084, 438191}, NULL) = 0
22:34:44.438364 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:44.438753 gettimeofday({1192592084, 438956}, NULL) = 0
22:34:44.439119 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 53) = 0
22:34:44.492033 gettimeofday({1192592084, 492235}, NULL) = 0
22:34:44.492442 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:44.492849 gettimeofday({1192592084, 492985}, NULL) = 0
22:34:44.493221 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 0) = 0
22:34:44.493676 gettimeofday({1192592084, 493813}, NULL) = 0
22:34:44.494051 gettimeofday({1192592084, 494186}, NULL) = 0
22:34:44.494420 gettimeofday({1192592084, 494554}, NULL) = 0
22:34:44.494826 gettimeofday({1192592084, 494961}, NULL) = 0
22:34:44.495190 gettimeofday({1192592084, 495324}, NULL) = 0
22:34:44.495737 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:44.496129 gettimeofday({1192592084, 496261}, NULL) = 0
22:34:44.496497 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 0) = 0
22:34:44.496942 gettimeofday({1192592084, 497074}, NULL) = 0
22:34:44.497316 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:44.497625 gettimeofday({1192592084, 497756}, NULL) = 0
22:34:44.497846 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 597) = 0
22:34:45.095073 gettimeofday({1192592085, 95368}, NULL) = 0
22:34:45.095553 gettimeofday({1192592085, 95781}, NULL) = 0
22:34:45.095951 gettimeofday({1192592085, 96158}, NULL) = 0
22:34:45.096326 gettimeofday({1192592085, 96530}, NULL) = 0
22:34:45.096733 gettimeofday({1192592085, 96938}, NULL) = 0
22:34:45.097099 gettimeofday({1192592085, 97302}, NULL) = 0
22:34:45.097473 gettimeofday({1192592085, 97689}, NULL) = 0
22:34:45.097853 gettimeofday({1192592085, 98058}, NULL) = 0
22:34:45.098258 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:45.098656 gettimeofday({1192592085, 98862}, NULL) = 0
22:34:45.099030 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 0) = 0
22:34:45.099466 gettimeofday({1192592085, 99684}, NULL) = 0
22:34:45.099859 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:45.100231 gettimeofday({1192592085, 100435}, NULL) = 0
22:34:45.100609 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 344) = 0
22:34:45.445067 gettimeofday({1192592085, 445309}, NULL) = 0
22:34:45.445491 gettimeofday({1192592085, 445721}, NULL) = 0
22:34:45.445889 gettimeofday({1192592085, 446092}, NULL) = 0
22:34:45.446259 gettimeofday({1192592085, 446461}, NULL) = 0
22:34:45.446644 gettimeofday({1192592085, 446849}, NULL) = 0
22:34:45.447396 gettimeofday({1192592085, 447722}, NULL) = 0
22:34:45.447926 gettimeofday({1192592085, 448136}, NULL) = 0
22:34:45.448306 gettimeofday({1192592085, 448509}, NULL) = 0
22:34:45.448738 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:45.449124 gettimeofday({1192592085, 449329}, NULL) = 0
22:34:45.449496 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 0) = 0
22:34:45.449952 gettimeofday({1192592085, 450155}, NULL) = 0
22:34:45.450328 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:45.450709 gettimeofday({1192592085, 450913}, NULL) = 0
22:34:45.451078 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 246) = 0
22:34:45.697087 gettimeofday({1192592085, 697360}, NULL) = 0
22:34:45.697543 gettimeofday({1192592085, 697769}, NULL) = 0
22:34:45.697939 gettimeofday({1192592085, 698145}, NULL) = 0
22:34:45.698311 gettimeofday({1192592085, 698514}, NULL) = 0
22:34:45.698718 gettimeofday({1192592085, 698924}, NULL) = 0
22:34:45.699084 gettimeofday({1192592085, 699287}, NULL) = 0
22:34:45.699457 gettimeofday({1192592085, 699671}, NULL) = 0
22:34:45.699836 gettimeofday({1192592085, 700039}, NULL) = 0
22:34:45.700238 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:45.700635 gettimeofday({1192592085, 700841}, NULL) = 0
22:34:45.701007 poll([{fd=6, events=POLLIN}, {fd=5, events=POLLIN}, {fd=21,
events=POLLIN|POLLPRI}, {fd=23, events=POLLIN|POLLPRI}, {fd=24,
events=POLLIN|POLLPRI}, {fd=25, events=POLLIN|POLLPRI}], 6, 0) = 0
22:34:45.701440 gettimeofday({1192592085, 701662}, NULL) = 0
22:34:45.701839 read(5, 0x8c1ec80, 4096) = -1 EAGAIN (Resource temporarily
unavailable)
22:34:45.702208 gettimeofday({1192592085, 702412}, NULL) = 0
22:34:45.702577 poll( <unfinished ...>
Process 31819 detached


If you start both, -writer and -calc, things gets a lot worse.  If you load a
file, wps stays the same.  And if you focus the window, the blinking cursor will
add 1 wps to the count.  So it would be a good idea to stop the blinking after
an amount of inactivity.

As a comparison Gnumeric doesn't do anything while inactive.  There is no
powertop activity and strace doesn't show any system call at all.

Is there something that could be done to solve this??

Comment 1 Caolan McNamara 2007-10-17 17:00:14 UTC
I see a good few problems already, so this looks like it is going to be
something of an umbrella task.

Firstly we've got what looks like a straight forward bug in the first idle timer
which waits until something is loaded into the frame before running some goo,
empty frame -> wake up continuously forever

Comment 2 William Lovaton 2007-10-17 22:59:08 UTC
Mmmhhh... you have me lost  =)  but thanks for the response.

Are you planning to report this bug upstream??

Comment 3 Caolan McNamara 2007-10-18 06:52:55 UTC
An umbrella task is a task that contains lots of other tasks in in. So there are
at least 5, probably lots more, wake-up bugs. The first one is linked to the
upstream report at the bottom of this issue in "external bugzilla references"

Comment 4 Caolan McNamara 2007-10-18 09:46:26 UTC
No 2 is NextJob_Impl in sfx2/source/control/bindings.cxx. Now, what on earth is
it trying to do, it's another never ending timer loop that "invalidates volatile
slots" on every execution. Totally disabling it shows no immediate obvious
ill-effects. Mail sent to sfx2 maintainer.

Comment 5 Caolan McNamara 2007-10-18 09:47:48 UTC
No 3 is in starmath, there we have a loop that constantly re-lays-out the
equation, we could probably fairly easily change that to only get triggered when
the equation content changes at SmDocShell::SetText

Comment 6 Caolan McNamara 2007-11-01 10:37:11 UTC
No 1 is fixable and now fixed upstream, moving to no 2. This is trickier we're
polling the state of stuff like "has the clipboard contents changed", we need to
move away from that and reseat it on an event on the initial state change. i.e.
http://www.openoffice.org/issues/show_bug.cgi?id=83195

Comment 7 Bug Zapper 2008-04-04 14:08:42 UTC
Based on the date this bug was created, it appears to have been reported
during the development of Fedora 8. In order to refocus our efforts as
a project we are changing the version of this bug to '8'.

If this bug still exists in rawhide, please change the version back to
rawhide.
(If you're unable to change the bug's version, add a comment to the bug
and someone will change it for you.)

Thanks for your help and we apologize for the interruption.

The process we're following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

Comment 8 Caolan McNamara 2008-04-18 12:42:44 UTC
We're currently looking at using libXfixes to avoid polling for the selection
continously which removed the need for "volatile" sfx2 slots which removes the
first layer of wakeups

Comment 9 Jon Stanley 2008-04-23 20:29:36 UTC
Adding FutureFeature keyword to RFE's.

Comment 10 Caolan McNamara 2009-06-09 17:04:50 UTC
sub parts of this are upstream with 3.2 target, though there's loads of other bits which need to be taken care of after those ones are through (I shudder especially at impress/draw's etc spellchecking timers)

Comment 11 Caolan McNamara 2009-10-30 12:23:11 UTC
stage 1 framework complete, 
stage 2 simple apps timeouts in progress (e.g. starmath)

Comment 12 Caolan McNamara 2009-11-28 18:03:30 UTC
stage 3, patches submitted to fix the drawing layer, i.e. draw and impress


Note You need to log in before you can comment on or make changes to this bug.