With version of 0.9.8.8-0ubuntu5 I still see one of the threads doing:

inotify_add_watch(8, "/var/lib/ofono", 
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=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 3997) = 0 (Timeout)
inotify_add_watch(8, "/var/lib/ofono", 
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=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 3998) = 0 (Timeout)
inotify_add_watch(8, "/var/lib/ofono", 
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=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 3995) = 0 (Timeout)
inotify_add_watch(8, "/var/lib/ofono", 
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=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 3996) = 0 (Timeout)
inotify_add_watch(8, "/var/lib/ofono", 
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=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 3996) = 0 (Timeout)

So a 0.25 Hz timeout and an inotify watch being added each time which
seems redundant on the desktop.

This is on a cleanly installed machine as of last week so I'm confident
that my laptop is relatively sane when it comes to installed packages.

To track this down I did:

sudo health-check -p NetworkManager

this showed up as:


System calls traced:
  PID  Process              Syscall               Count    Rate/Sec    Total 
μSecs  % Call Time
   949 NetworkManager       recvmsg                 211       3.5167          
2520      0.0021
   949 NetworkManager       sendmsg                 108       1.8000          
2044      0.0017
   949 NetworkManager       poll                     97       1.6167      
53977531     45.3342
   949 NetworkManager       write                    77       1.2833           
873      0.0007
   949 NetworkManager       read                     52       0.8667           
606      0.0005
   949 NetworkManager       restart_syscall           1       0.0167       
5542655      4.6551
   952 NetworkManager       rt_sigtimedwait           1       0.0167            
 0      0.0000
   959 NetworkManager       inotify_add_watch        15       0.2500           
301      0.0003
   959 NetworkManager       poll                     15       0.2500      
56001456     47.0340
   959 NetworkManager       restart_syscall           1       0.0167       
3537933      2.9714
   963 NetworkManager       restart_syscall           1       0.0167            
 0      0.0000
 Total                                              579       9.6500     
119065919

and also:

Inotify watches added:
  PID  Process              Rate/Sec File
   959 NetworkManager          0.250 /var/lib/ofono


so then I just strace'd pid 959 and the rogue polling and inotify watch is 
apparent.  Hope that clarifies.

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to network-manager in Ubuntu.
https://bugs.launchpad.net/bugs/1289532

Title:
  NetworkManager is polling every 4 seconds on the Desktop looking for
  /var/lib/ofono

Status in “network-manager” package in Ubuntu:
  Triaged

Bug description:
  I was looking at what's sucking power on the Trusty desktop and found
  that NetworkManager is polling every 4 seconds adding an inotify watch
  on /var/lib/ofono (which does not exist on the desktop - isn't that a
  phone related component?).

  Anyhow, strace on one of the threads of NetworkManager shows:

  sudo strace  -p 710
  Process 710 attached
  restart_syscall(<... resuming interrupted call ...>) = 0
  inotify_add_watch(8, "/var/lib/ofono", 
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=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 3996) = 0 (Timeout)
  inotify_add_watch(8, "/var/lib/ofono", 
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=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 3995) = 0 (Timeout)
  inotify_add_watch(8, "/var/lib/ofono", 
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=9, events=POLLIN}, {fd=8, events=POLLIN}], 2, 3995) = 0 (Timeout)
  inotify_add_watch(8, "/var/lib/ofono", 
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:

  1. The polling is rather heavy - every 4 seconds? Is that really necessary?
  2. Surely we can avoid repeatedly adding a watch on a directory that does not 
exist.  Are there better ways than doing this so frequently, especially because 
it does not seem relevant on my desktop install.

  Anyhow, can this be investigated, it's one of the final big causes of
  wakeups on an idle desktop image.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1289532/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to