The patch titled uts: copy nsproxy only when needed has been removed from the -mm tree. Its filename is uts-copy-nsproxy-only-when-needed.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ Subject: uts: copy nsproxy only when needed From: Serge Hallyn <serue@xxxxxxxxxx> The nsproxy was being copied in unshare() when anything was being unshared, even if it was something not referenced from nsproxy. This should end up in some cases with far more memory usage than necessary. Signed-off-by: Serge Hallyn <serue@xxxxxxxxxx> Cc: Kirill Korotaev <dev@xxxxxxxxxx> Cc: "Eric W. Biederman" <ebiederm@xxxxxxxxxxxx> Cc: Herbert Poetzl <herbert@xxxxxxxxxxxx> Cc: Andrey Savochkin <saw@xxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- kernel/fork.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff -puN kernel/fork.c~uts-copy-nsproxy-only-when-needed kernel/fork.c --- a/kernel/fork.c~uts-copy-nsproxy-only-when-needed +++ a/kernel/fork.c @@ -1606,7 +1606,7 @@ asmlinkage long sys_unshare(unsigned lon struct mm_struct *mm, *new_mm = NULL, *active_mm = NULL; struct files_struct *fd, *new_fd = NULL; struct sem_undo_list *new_ulist = NULL; - struct nsproxy *new_nsproxy, *old_nsproxy; + struct nsproxy *new_nsproxy = NULL, *old_nsproxy = NULL; struct uts_namespace *uts, *new_uts = NULL; check_unshare_flags(&unshare_flags); @@ -1634,18 +1634,24 @@ asmlinkage long sys_unshare(unsigned lon if ((err = unshare_utsname(unshare_flags, &new_uts))) goto bad_unshare_cleanup_semundo; - if (new_fs || new_ns || new_sigh || new_mm || new_fd || new_ulist || - new_uts) { - + if (new_ns || new_uts) { old_nsproxy = current->nsproxy; new_nsproxy = dup_namespaces(old_nsproxy); if (!new_nsproxy) { err = -ENOMEM; goto bad_unshare_cleanup_uts; } + } + + if (new_fs || new_ns || new_sigh || new_mm || new_fd || new_ulist || + new_uts) { task_lock(current); - current->nsproxy = new_nsproxy; + + if (new_nsproxy) { + current->nsproxy = new_nsproxy; + new_nsproxy = old_nsproxy; + } if (new_fs) { fs = current->fs; @@ -1687,9 +1693,11 @@ asmlinkage long sys_unshare(unsigned lon } task_unlock(current); - put_nsproxy(old_nsproxy); } + if (new_nsproxy) + put_nsproxy(new_nsproxy); + bad_unshare_cleanup_uts: if (new_uts) put_uts_ns(new_uts); _ Patches currently in -mm which might be from serue@xxxxxxxxxx are origin.patch namespaces-utsname-introduce-temporary-helpers.patch kthread-update-arch-mips-kernel-apmc.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html