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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user