update-notifier is polling every 5 seconds

Bug #1227000 reported by Colin Ian King
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu Power Consumption Project
Fix Released
Undecided
Unassigned
update-notifier (Ubuntu)
Fix Released
Medium
Brian Murray

Bug Description

In order to reduce system wakeups to improve laptop battery life I've noticed that update-notifier is polling every 5 seconds, strace'ing the process shows:

recvfrom(6, 0x8b16e4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 3, 4373) = 0 (Timeout)
recvfrom(6, 0x8b16e4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 3, 4995) = 0 (Timeout)
recvfrom(6, 0x8b16e4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 3, 4994) = 0 (Timeout)
recvfrom(6, 0x8b16e4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 3, 4999) = 0 (Timeout)
recvfrom(6, 0x8b16e4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=5, events=POLLIN}, {fd=6, events=POLLIN}, {fd=3, events=POLLIN}], 3, 4995) = 0 (Timeout)
recvfrom(6, 0x8b16e4, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)

It appears that file_monitor_periodic_check() is being called every 5 seconds and it checks to see if variables such as un->crashreport is NULL or un->dpkg_was_run is true.

From a casual look at the code, these are set by monitor_cb() which is called when files are modified, so does this make the 5 second poll unnecessary? Can we remove the 5 second polling and just do the file_monitor_periodic_checks when monitor_cb detects something to act upon?

As it stands, polling every 5 seconds unnecessarily keeps the CPU out of deep sleep C states and consumes a small amount of power. This is a low priority issue, but it would be a nice to have fix to make the code a little more power optimal.

Related branches

affects: update-notifier (Ubuntu) → ubuntu-power-consumption
Revision history for this message
Brian Murray (brian-murray) wrote :

I was looking at this today and noticed that the things we are actually monitoring (if somebody is using an UPSTART_SESSION, which I understand most desktop environments to be doing) are all package related. Given that package operations are less frequent than crashes or things we were monitoring previous to the conversion to upstart session jobs, I'd say we could increase the poll interval significantly.

Changed in update-notifier (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → Brian Murray (brian-murray)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package update-notifier - 0.154

---------------
update-notifier (0.154) trusty; urgency=medium

  * Do not say that a partition will be checked when the check is disabled in
    fstab. Thanks to Nils Kassube for the patch. (LP: #1282760)
  * Use print function instead of statement (LP: #1256759)
  * Increase the poll interval from 5 seconds to 180 (LP: #1227000)
 -- Brian Murray <email address hidden> Fri, 14 Mar 2014 15:14:23 -0700

Changed in update-notifier (Ubuntu):
status: Triaged → Fix Released
Changed in ubuntu-power-consumption:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.