Re: unregister_netdevice: waiting for DEV to become free (2)

From: David Ahern
Date: Wed May 01 2019 - 10:52:59 EST

On 5/1/19 7:38 AM, Tetsuo Handa wrote:
> On 2019/04/30 3:43, David Ahern wrote:
>>> The attached patch adds a tracepoint to notifier_call_chain. If you have
>>> KALLSYMS enabled it will show the order of the function handlers:
>>> perf record -e notifier:* -a -g &
>>> ip netns del <NAME>
>>> <wait a few seconds>
>>> fg
>>> <ctrl-c on perf-record>
>>> perf script
>> with the header file this time.
> What is the intent of your patch? I can see that many notifiers are called. But
> how does this help identify which event is responsible for dropping the refcount?

In a previous response you stated: "Since I'm not a netdev person, I
appreciate if you can explain that shutdown sequence using a flow chart."

The notifier sequence tells you the order of cleanup handlers and what
happens when a namespace is destroyed.

The dev_hold / dev_put tracepoint helps find the refcnt leak but
requires some time analyzing the output to match up hold / put stack traces.