2
0
mirror of https://github.com/checkpoint-restore/criu synced 2025-09-03 07:45:17 +00:00

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>
This commit is contained in:
Pavel Emelyanov
2014-09-29 22:04:25 +04:00
parent 4f9acb6a7c
commit 3c7d01f6a7
5 changed files with 79 additions and 27 deletions

View File

@@ -21,6 +21,11 @@ struct ns_id {
struct mount_info *mntinfo_list;
struct mount_info *mntinfo_tree;
} mnt;
struct {
int nlsk; /* for sockets collection */
int seqsk; /* to talk to parasite daemons */
} net;
};
};
extern struct ns_id *ns_ids;