ns: Introduce collect_namespaces routine

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ns: Introduce collect_net_namespaces

And move sockets collection there.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
net: Do walk net namespaces to collect

Right now we don't support multiple net namespaces,
but some day we will. Other than this we have a logic
to distinguish cases with no namespaces vs one namespace,
so this walking already makes sence.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
net: Pre-create nl diag sk

The setns() syscall (called by switch_ns()) can be extremely
slow. If we call it two or more times from the same task the
kernel will synchonously go on a very slow routine called
synchronize_rcu() trying to put a reference on old namespaces.

To avoid doing this more than once I propose to create all
per-ns sockets in one place with one setns call. In this
patch there's on nl diag socket used to collect other sockets
is created this way.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
rst: Rework the rst_info referencing

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pstree: Introduce item's dump info

Empty for now, will be filled soon.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
ns: Reshuffle nsid generation code

To make it possible to get ns_id object together
with its ID.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
pstree: Store task's netns on pstree-item

Will be needed for parasite sockets.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: Reshuffle tsock creation

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>
parasite: Precreate daemon control sockets

Now we have netns on pstree-item and have the place
where to pre-create daemon socket in needed namespace.

Signed-off-by: Pavel Emelyanov <xemul@parallels.com>