libvirtd polling /etc/modprobe.d every second

Bug #1164414 reported by Colin Ian King
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
The Ubuntu Power Consumption Project
New
Undecided
Unassigned
libvirt
Confirmed
Medium
Unassigned
virt-manager
Confirmed
Medium
Unassigned
libvirt (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

libvirtd is polling /etc/modprobe.d every second with opendir() .. closedir() calls:

fatrace reports:

libvirtd(1405): O /etc/modprobe.d
libvirtd(1405): C /etc/modprobe.d
libvirtd(1405): O /etc/modprobe.d
libvirtd(1405): C /etc/modprobe.d
libvirtd(1405): O /etc/modprobe.d
libvirtd(1405): C /etc/modprobe.d
libvirtd(1405): O /etc/modprobe.d
libvirtd(1405): C /etc/modprobe.d
libvirtd(1405): O /etc/modprobe.d
libvirtd(1405): C /etc/modprobe.d
libvirtd(1405): CO /etc/modprobe.d
libvirtd(1405): O /etc/modprobe.d
libvirtd(1405): C /etc/modprobe.d
libvirtd(1405): O /etc/modprobe.d
libvirtd(1405): C /etc/modprobe.d
libvirtd(1405): CO /etc/modprobe.d

debugging this a bit deeper:

Breakpoint 6, __opendir (name=0x7f668f1af1a0 "/sys/class/net") at ../sysdeps/posix/opendir.c:158
158 ../sysdeps/posix/opendir.c: No such file or directory.
(gdb) where
#0 __opendir (name=0x7f668f1af1a0 "/sys/class/net") at ../sysdeps/posix/opendir.c:158
#1 0x00007f6694c1a75c in glob_in_dir (pattern=pattern@entry=0x7f668f1af45f "*",
    directory=directory@entry=0x7f668f1af1a0 "/sys/class/net", flags=flags@entry=8196,
    errfunc=errfunc@entry=0x0, pglob=pglob@entry=0x7f668f1af550, alloca_used=560, alloca_used@entry=32)
    at ../posix/glob.c:1541
#2 0x00007f6694c1bf1c in __GI_glob (pattern=pattern@entry=0x7f668f1af450 "/sys/class/net/*",
    flags=flags@entry=8196, errfunc=errfunc@entry=0x0, pglob=pglob@entry=0x7f668f1af550)
    at ../posix/glob.c:1192
#3 0x00007f6694c1b4b5 in __GI_glob (pattern=0x7f667000a970 "/sys/class/net/*/address",
    flags=<optimised out>, errfunc=0x0, pglob=<optimised out>) at ../posix/glob.c:1050
#4 0x00007f6687af1328 in ?? () from /usr/lib/libaugeas.so.0
#5 0x00007f6687af2fc0 in ?? () from /usr/lib/libaugeas.so.0
#6 0x00007f6687ac6e7e in aug_load () from /usr/lib/libaugeas.so.0
#7 0x00007f6687d27af0 in ?? () from /usr/lib/libnetcf.so.1
#8 0x00007f6687d281ce in ?? () from /usr/lib/libnetcf.so.1
#9 0x00007f6687d29dd7 in ?? () from /usr/lib/libnetcf.so.1
#10 0x00007f6687f3889c in ?? () from /usr/lib/libvirt/connection-driver/libvirt_driver_interface.so
#11 0x00007f669525de6c in virConnectNumOfInterfaces () from /usr/lib/libvirt.so.0
#12 0x0000000000421ad7 in ?? ()
#13 0x00007f66952b4a62 in virNetServerProgramDispatch () from /usr/lib/libvirt.so.0
#14 0x00007f66952aecd8 in ?? () from /usr/lib/libvirt.so.0
#15 0x00007f66951c852e in ?? () from /usr/lib/libvirt.so.0
#16 0x00007f66951c7be6 in ?? () from /usr/lib/libvirt.so.0
#17 0x00007f6694f26f8e in start_thread (arg=0x7f668f1b0700) at pthread_create.c:311
#18 0x00007f6694c50e1d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:113

so it appears be be kicked off from virConnectNumOfInterfaces (libvirt.c) probable from:

     ret = conn->interfaceDriver->numOfInterfaces(conn);

This seems to me to be unneccessary polling and directory read overhead.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Thanks for reporting this bug. Did you by any chance have virt-manager connected to that libvirtd instance while you were taking these measurements?

It's not obvious where libvirt itself is calling this (outside of the remote driver) so I'm wondering whether virt-manager may actually be asking for these results every second.

Revision history for this message
Colin Ian King (colin-king) wrote :

I'm not sure about the virt-manager connected question, what do I need to do to check that?

Revision history for this message
Colin Ian King (colin-king) wrote :

@Serge, I only see this polling if virt-manager is connected.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote : Re: [Bug 1164414] Re: libvirtd polling /etc/modprobe.d every second

Quoting Colin King (<email address hidden>):
> @Serge, I only see this polling if virt-manager is connected.

Thanks. Checking every second seems somewhat gratuitous there, marking
this bug as affecting virt-manager.

 affects: libvirt
 status: confirmed
 importance: medium
 affects: virt-manager
 status: confirmed
 importance: medium

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Marking invalid against libvirt, since libvirt is simply responding to requests from virt-manager.

Changed in libvirt (Ubuntu):
status: New → Invalid
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.