gvfs-afc-volume-monitor is stat'ing /var/run/usbmuxd every second

Bug #934137 reported by Colin Ian King
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
The Ubuntu Power Consumption Project
New
Undecided
Unassigned

Bug Description

I've observed that gvfs-afc-volume-monitor is polling at ~1Hz stat'ing /var/run/usbmuxd

Using eventstat from my PPA: https://launchpad.net/~colin-king/+archive/powermanagement as follows one can identify the thread that is waking up every second:

sudo eventstat 1 1 | grep gvfs-afc
    1.00 2027 gvfs-afc-volume hrtimer_start_range_ns hrtimer_wakeup

and a strace shows:

stat("/var/run/usbmuxd", 0x7faf78339cd0) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0}, 8) = 0
rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0
nanosleep({1, 0}, 0x7faf78339dd0) = 0
stat("/var/run/usbmuxd", 0x7faf78339cd0) = -1 ENOENT (No such file or directory)
rt_sigprocmask(SIG_BLOCK, [CHLD], [], 8) = 0
rt_sigaction(SIGCHLD, NULL, {SIG_DFL, [], 0},

Rather than continually polling for /var/run/usbmuxd it is more efficient to use inotify on /var/run and observe any new files appearing and then do the check for /var/run/usbmuxd

Frequent periodical polling reads on the filesystem waste power and reduce the running time on battery.

description: updated
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.