gnome-settings-daemon is polling for seemingly no good reason at all

Bug #1266873 reported by Colin Ian King on 2014-01-07
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu Power Consumption Project
Undecided
Unassigned
fontconfig (Ubuntu)
Low
Unassigned
gnome-settings-daemon (Ubuntu)
Low
Unassigned

Bug Description

One of the threads in gnome-settings-deamon is polling every 4 seconds trying to add a watch onto a non-existent directory /usr/X11R6/lib/X11:

inotify_add_watch(16, "/usr/X11R6/lib/X11", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOENT (No such file or directory)
poll([{fd=17, events=POLLIN}, {fd=16, events=POLLIN}], 2, 3999) = 0 (Timeout)
inotify_add_watch(16, "/usr/X11R6/lib/X11", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOENT (No such file or directory)
poll([{fd=17, events=POLLIN}, {fd=16, events=POLLIN}], 2, 3996) = 0 (Timeout)
inotify_add_watch(16, "/usr/X11R6/lib/X11", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOENT (No such file or directory)
poll([{fd=17, events=POLLIN}, {fd=16, events=POLLIN}], 2, 3999) = 0 (Timeout)
inotify_add_watch(16, "/usr/X11R6/lib/X11", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOENT (No such file or directory)
poll([{fd=17, events=POLLIN}, {fd=16, events=POLLIN}], 2, 3996) = 0 (Timeout)
inotify_add_watch(16, "/usr/X11R6/lib/X11", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOENT (No such file or directory)
poll([{fd=17, events=POLLIN}, {fd=16, events=POLLIN}], 2, 3998) = 0 (Timeout)
inotify_add_watch(16, "/usr/X11R6/lib/X11", IN_MODIFY|IN_ATTRIB|IN_CLOSE_WRITE|IN_MOVED_FROM|IN_MOVED_TO|IN_CREATE|IN_DELETE|IN_DELETE_SELF|IN_MOVE_SELF|IN_UNMOUNT|IN_ONLYDIR) = -1 ENOENT (No such file or directory)

is that intentional, or a bug? As it stands, it's causing some wakeups that seem unnecessary and this is keeping the system from deep C state idle, which is wasting power.

Tim Lunn (darkxst) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal:

  apport-collect 1266873

When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Also can you get a log with debugging by running:
gnome-settings-daemon --debug -r

Changed in gnome-settings-daemon (Ubuntu):
status: New → Incomplete
Sebastien Bacher (seb128) wrote :

The issue is coming from the xsettings code, it has a loop doing

" while ((str = (const char *) FcStrListNext (list))) {
...
                file = g_file_new_for_path (str);
                monitor = g_file_monitor (file, G_FILE_MONITOR_NONE, NULL, NULL);
"

That lists includes /usr/X11R6/lib/X11/fonts, we should probably just don't monitor non existing directories (that means that if they get created the system is not going to pick them up, but that seems unlikely to happen anyway, or not frequently enough that it would be an important issue)

Changed in gnome-settings-daemon (Ubuntu):
importance: Undecided → Low
status: Incomplete → Confirmed
Tim Lunn (darkxst) wrote :

The list comes from fontconfig, we should probably just remove '/usr/X11R6/lib/X11/fonts' from there. Its pretty unlikely that folder will ever exist these days.

Sebastien Bacher (seb128) wrote :

@Tim: I'm not sure I agree with that, while it's probably fine to drop that directory from fontconfig, we should probably not have g-s-d pooling endlessly on non existing directories anyway, the same issue might be happening with other ones depending of your configuration and what you have installed

Changed in fontconfig (Ubuntu):
importance: Undecided → Low
Tim Lunn (darkxst) wrote :

There is probably a deeper issue here in that 'monitor_files' should only get called when the Fontconfig config changes (Based on the return value of 'FcConfigUptoDate'). That should not be happening every 4 seconds.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package fontconfig - 2.11.0-0ubuntu4

---------------
fontconfig (2.11.0-0ubuntu4) trusty; urgency=medium

  * debian/rules:
    - don't add /usr/X11R6/lib/X11/fonts to the fonts path, that's a
      deprecated location and it leads to polling on the directory,
      which means wakeups and extra power usage (lp: #1266873)
 -- Sebastien Bacher <email address hidden> Thu, 16 Jan 2014 15:47:25 +0100

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

Other bug subscribers