This service will be undergoing maintenance at 00:00 UTC, 2016-08-01. It is expected to last about 1 hours
Bug 204862 - clock applet updates every second even when seconds aren't showing
clock applet updates every second even when seconds aren't showing
Status: CLOSED RAWHIDE
Product: Fedora
Classification: Fedora
Component: gnome-panel (Show other bugs)
rawhide
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ray Strode [halfline]
:
Depends On:
Blocks: wakeup
  Show dependency treegraph
 
Reported: 2006-08-31 18:21 EDT by Arjan van de Ven
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-09-01 14:22:15 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)
patch to poll less frequent when not showing seconds (416 bytes, patch)
2006-08-31 18:22 EDT, Arjan van de Ven
no flags Details | Diff
patch to make the clock applet wakeup event be at exactly the right time for redrawing rather than polling for it (1.35 KB, patch)
2006-09-01 03:33 EDT, Arjan van de Ven
no flags Details | Diff

  None (edit)
Description Arjan van de Ven 2006-08-31 18:21:54 EDT
Description of problem:

the clock applet updates itself every second, even when the clock isn't
configured to show seconds. This of course eats power when (tickless) idle.

Solution is simple, update less frequent when not showing seconds.. see attached
patch
Comment 1 Arjan van de Ven 2006-08-31 18:22:00 EDT
Created attachment 135345 [details]
patch to poll less frequent when not showing seconds
Comment 2 Arjan van de Ven 2006-09-01 03:31:45 EDT
ok that patch was a fugly hack; this one is nicer:
Instead of doing a repeating constant timer, calculate the time to the next
redraw event and just make the timer not rearm.

This has 2 advantages
1) it is more accurate; the old clock was only second accurate, the new clock is
much more accurate
2) there are no spurious timer wake events at all, the only wake events that
happen have real work to do


strace of the new clock to show how nice it works:
9:26:23.634270 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8,
events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11,
events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14,
events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15,
events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 36366) = 0
09:27:00.000822 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074,
...}) = 0
09:27:00.001303 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074,
...}) = 0
09:27:00.001485 ioctl(3, FIONREAD, [0]) = 0
09:27:00.001581 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8,
events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11,
events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14,
events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15,
events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 0) = 0
09:27:00.001998 write(3,
"5\20\4\0@\0\200\1!\0\200\1=\0\30\0\231\4\5\0A\0\200\1@"..., 652) = 652
09:27:00.002103 ioctl(3, FIONREAD, [0]) = 0
09:27:00.002170 poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8,
events=POLLIN|POLLPRI}, {fd=10, events=POLLIN|POLLPRI}, {fd=11,
events=POLLIN|POLLPRI}, {fd=12, events=POLLIN|POLLPRI}, {fd=14,
events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI}, {fd=15,
events=POLLIN|POLLPRI}, {fd=16, events=POLLIN|POLLPRI}], 10, 59999) = 0
09:28:00.001798 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074,
...}) = 0
09:28:00.002202 stat("/etc/localtime", {st_mode=S_IFREG|0644, st_size=1074,
...}) = 0


notice how all the procesing happens exactly in the first few microseconds of
the new minute
Comment 3 Arjan van de Ven 2006-09-01 03:33:12 EDT
Created attachment 135362 [details]
patch to make the clock applet wakeup event be at exactly the right time for redrawing rather than polling for it
Comment 4 Matthias Clasen 2006-09-01 13:33:22 EDT
Compare
http://bugzilla.gnome.org/show_bug.cgi?id=348749
Comment 5 Matthias Clasen 2006-09-01 14:22:15 EDT
Fixed in 2.15.92-6.fc6

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