← Back to team overview

dx-packages team mailing list archive

[Bug 934156] Re: zeitgeist-datahub is calling inotify_add_watch() on .kde RecentDocuments every 4 seconds and failing

 

OK, it's got worse in Trusty, now it's polling even more directories
that don't exist:

inotify_add_watch(9, "/usr/local/share/applications", 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)
inotify_add_watch(9, "/usr/share/ubuntu/applications", 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)
inotify_add_watch(9, "/home/king/.kde/share/apps/RecentDocuments", 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=10, events=POLLIN}, {fd=9, events=POLLIN}], 2, 3997) = 0 (Timeout)

Why does this have to be every 4 seconds?  That's sucking power on an
idle system.


** Changed in: zeitgeist (Ubuntu)
   Importance: Undecided => High

** Changed in: ubuntu-power-consumption
   Importance: Undecided => High

-- 
You received this bug notification because you are a member of DX
Packages, which is subscribed to zeitgeist in Ubuntu.
Matching subscriptions: dx-packages
https://bugs.launchpad.net/bugs/934156

Title:
  zeitgeist-datahub is calling inotify_add_watch() on .kde
  RecentDocuments every 4 seconds and failing

Status in The Ubuntu Power Consumption Project:
  New
Status in “zeitgeist” package in Ubuntu:
  New

Bug description:
  zeitgeist-datahub is adding inotify_add_watch on
  /home/$USER/.kde/share/apps/RecentDocuments every ~4 seconds and
  failing with -ENOENT since it does not exist.

  strace shows:

  poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 3998) = 0 (Timeout)
  read(3, 0x7fffcfb823d0, 16)             = -1 EAGAIN (Resource temporarily unavailable)
  inotify_add_watch(8, "/home/king/.kde/share/apps/RecentDocuments", 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=3, events=POLLIN}, {fd=7, events=POLLIN}, {fd=8, events=POLLIN}], 3, 3995) = 0 (Timeout)
  read(3, 0x7fffcfb823d0, 16)             = -1 EAGAIN (Resource temporarily unavailable)
  inotify_add_watch(8, "/home/king/.kde/share/apps/RecentDocuments", 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)

  So clearly we have a ~4000 millesecond poll that times out followed by
  a inotify_add_watch on a directory that does not exist. I don't have
  any ~/.kde path to add the watch on to.   So this seems a little bit
  wasteful to do this every 4 seconds.

  Not sure about this, but the poll times out but we still do a read on
  fd 3, which is clearly not in a read state because the poll timed out
  rather than indicating fd 3 is read to read, so perhaps this is a bug.

  Anyhow,  my points are:

  1. Is the ~4000ms poll really required?
  2. Is the read on fd 3 required considering we just poll'd on it and it does not indicated it is read to read
  3. Why is a watch being added for a path that does not exist every 4 seconds?

  Although these wakeups are infrequent, they still contribute to
  probably unnecessarily keeping the CPU from a deep C state and hence
  this wastes power.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu-power-consumption/+bug/934156/+subscriptions