[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHvAHW-vog2aEAQNgPOOVBNyBqmTiJf-xvwmptszx4mC+jOQCg@mail.gmail.com>
Date: Wed, 5 Jul 2017 18:29:06 -0500
From: Leon Yang <leon.gh.yang@...il.com>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>
Subject: Re: Way to Know When cleanup_net() Calls Are Done
In my case, as I know the number of unshare(2) calls (say 10000), I
think there should be same number of net_drop_ns() calls regardless of
the userns counter. So the 10000th call to net_drop_ns() should be the
last one.
After some investigation I figure out my problem. When I was running
the program, I read the debug/tracing/trace file for a couple times to
check if ftrace was working. This read seems to prevent the ftrace
ring buffer from being written so that some entries are missing from
the ftrace results.
Therefore the problem is completely unrelated to net namespace. Sorry
for the confusion.
On Wed, Jul 5, 2017 at 6:14 PM, Cong Wang <xiyou.wangcong@...il.com> wrote:
> On Sat, Jul 1, 2017 at 10:50 PM, Leon Yang <leon.gh.yang@...il.com> wrote:
>> Hi,
>>
>> I am measuring the time cost of parallel creation and destruction of
>> net namespaces.
>>
>> As cleanup_net() is invoked from workqueue, the exit of a net
>> namespace does not mean the cleanup is completed. Therefore I use
>> ftrace to count the number of net_drop_ns() are called. But I found
>> that the number of namespaces created does not match with the number
>> of net_drop_ns() calls even after a long wait.
>>
>> Can you give some hints on why this is happening? and what would be
>> the correct way to know when the last cleanup_net() is done?
>
> Probably no way to know this in user-space, netns is refcount'ed,
> we don't know which is the last one releasing it.
>
> There is a per-userns counter for netns, but I don't see it is ever
> exposed to user-space.
Powered by blists - more mailing lists