• Krister Johansen's avatar
    Fix an intermittent pr_emerg warning about lo becoming free. · c1b19feb
    Krister Johansen authored
    BugLink: http://bugs.launchpad.net/bugs/1702863
    
    [ Upstream commit f186ce61 ]
    
    It looks like this:
    
    Message from syslogd@flamingo at Apr 26 00:45:00 ...
     kernel:unregister_netdevice: waiting for lo to become free. Usage count = 4
    
    They seem to coincide with net namespace teardown.
    
    The message is emitted by netdev_wait_allrefs().
    
    Forced a kdump in netdev_run_todo, but found that the refcount on the lo
    device was already 0 at the time we got to the panic.
    
    Used bcc to check the blocking in netdev_run_todo.  The only places
    where we're off cpu there are in the rcu_barrier() and msleep() calls.
    That behavior is expected.  The msleep time coincides with the amount of
    time we spend waiting for the refcount to reach zero; the rcu_barrier()
    wait times are not excessive.
    
    After looking through the list of callbacks that the netdevice notifiers
    invoke in this path, it appears that the dst_dev_event is the most
    interesting...
    c1b19feb
dst.c 12.2 KB