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?

Thanks,

Leon

*psudo code of my program:

n = 0;
while (1) {
        pid = fork();
        if (pid == 0) {
                unshare(CLONE_NEWNET);
                exit(0);
        } else if (/* run out of PID */) {
                /* wait for all the children */
                /* get total time for n creations+destructions */
                n = 0;
        } else { /* do nothing */ }
        n++;
}

Reply via email to