uts namespace : remove CONFIG_UTS_NS
PATCH 1/1 uts namespace : remove CONFIG_UTS_NS
CONFIG_UTS_NS has very little value as it only deactivates the unshare of the uts namespace and does not improve performance.
--- include/linux/utsname.h | 19 ------------------- init/Kconfig | 8 -------- kernel/Makefile | 3 +-- kernel/sysctl.c | 3 +-- 4 files changed, 2 insertions(+), 31 deletions(-)
include/linux/utsname.h +0 -19
@@ -48,7 +48,6 @@ static inline void get_uts_ns(struct utskref_get (&ns->kref); } -#ifdef CONFIG_UTS_NS extern int unshare_utsname (unsigned long unshare_flags,struct uts_namespace **new_uts);extern int copy_utsname (int flags,struct task_struct *tsk);
@@ -58,24 +57,6 @@ static inline void put_uts_ns(struct uts {kref_put (&ns->kref, free_uts_ns); } -#else -static inline int unshare_utsname (unsigned long unshare_flags, -struct uts_namespace **new_uts) -{ -if (unshare_flags &CLONE_NEWUTS ) -return -EINVAL ; - -return 0 ; -} - -static inline int copy_utsname (int flags,struct task_struct *tsk) -{ -return 0 ; -} -static inline void put_uts_ns (struct uts_namespace *ns) -{ -} -#endif static inline struct new_utsname *utsname (void ) {
init/Kconfig +0 -8
@@ -205,14 +205,6 @@ config TASK_DELAY_ACCT Say N if unsure. -config UTS_NS - bool "UTS Namespaces" - default n - help - Support uts namespaces. This allows containers, i.e. - vservers, to use uts namespaces to provide different - uts info for different servers. If unsure, say N. - config AUDIT bool "Auditing support" depends on NET
kernel/Makefile +1 -2
@@ -8,7 +8,7 @@ obj-y = sched.o fork.o exec_domain.o signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o extable.o params.o posix-timers.o \ kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ - hrtimer.o rwsem.o latency.o nsproxy.o srcu.o + hrtimer.o rwsem.o latency.o nsproxy.o srcu.o utsname.o obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-y += time/
@@ -48,7 +48,6 @@ obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o obj-$(CONFIG_DEBUG_SYNCHRO_TEST) += synchro-test.o obj-$(CONFIG_RELAY) += relay.o -obj-$(CONFIG_UTS_NS) += utsname.o obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.o
kernel/sysctl.c +1 -2
@@ -187,10 +187,9 @@ int sysctl_legacy_va_layout;static void *get_uts (ctl_table *table,int write) {char *which = table->data; -#ifdef CONFIG_UTS_NS struct uts_namespace *uts_ns = current->nsproxy->uts_ns; which = (which - (char *)&init_uts_ns) + (char *)uts_ns; -#endif +if (!write)down_read (&uts_sem);else
Quoted 4 lines · Cedric Le Goater
CONFIG_UTS_NShas very little value as it only deactivates the unshare of the uts namespace and does not improve performance.Signed-off-by Cedric Le Goater <[email protected]>
It really is worthless complication, with the sole effect being to complicate testing...
Quoted 100 lines
--- include/linux/utsname.h | 19 ------------------- init/Kconfig | 8 -------- kernel/Makefile | 3 +-- kernel/sysctl.c | 3 +-- 4 files changed, 2 insertions(+), 31 deletions(-)Index:
2.6.20-rc4-mm1/include/linux/utsname.h
===================================================================include/linux/utsname.h +0
-19@@ -48,7 +48,6 @@ static inline void get_uts_ns(struct utskref_get (&ns->kref); } -#ifdef CONFIG_UTS_NS extern int unshare_utsname (unsigned long unshare_flags,struct uts_namespace **new_uts);extern int copy_utsname (int flags,struct task_struct *tsk);@@ -58,24 +57,6 @@ static inline void put_uts_ns(struct uts {kref_put (&ns->kref, free_uts_ns); } -#else -static inline int unshare_utsname (unsigned long unshare_flags, -struct uts_namespace **new_uts) -{ -if (unshare_flags &CLONE_NEWUTS ) -return -EINVAL ; - -return 0 ; -} - -static inline int copy_utsname (int flags,struct task_struct *tsk) -{ -return 0 ; -} -static inline void put_uts_ns (struct uts_namespace *ns) -{ -} -#endif static inline struct new_utsname *utsname (void ) {Index: 2.6.20-rc4-mm1/init/Kconfig
===================================================================init/Kconfig +0
-8@@ -205,14 +205,6 @@ config TASK_DELAY_ACCT Say N if unsure. -config UTS_NS - bool "UTS Namespaces" - default n - help - Support uts namespaces. This allows containers, i.e. - vservers, to use uts namespaces to provide different - uts info for different servers. If unsure, say N. - config AUDIT bool "Auditing support" depends on NETIndex: 2.6.20-rc4-mm1/kernel/Makefile
===================================================================kernel/Makefile +1
-2@@ -8,7 +8,7 @@ obj-y = sched.o fork.o exec_domain.o signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o extable.o params.o posix-timers.o \ kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ - hrtimer.o rwsem.o latency.o nsproxy.o srcu.o + hrtimer.o rwsem.o latency.o nsproxy.o srcu.o utsname.o obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-y += time/@@ -48,7 +48,6 @@ obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o obj-$(CONFIG_DEBUG_SYNCHRO_TEST) += synchro-test.o obj-$(CONFIG_RELAY) += relay.o -obj-$(CONFIG_UTS_NS) += utsname.o obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.oIndex:
2.6.20-rc4-mm1/kernel/sysctl.c
===================================================================kernel/sysctl.c +1
-2@@ -187,10 +187,9 @@ int sysctl_legacy_va_layout;static void *get_uts (ctl_table *table,int write) {char *which = table->data; -#ifdef CONFIG_UTS_NS struct uts_namespace *uts_ns = current->nsproxy->uts_ns; which = (which - (char *)&init_uts_ns) + (char *)uts_ns; -#endif +if (!write)down_read (&uts_sem);else
Quoted 8 lines · Serge E. Hallyn
Quoted 4 lines · Cedric Le Goater
CONFIG_UTS_NShas very little value as it only deactivates the unshare of the uts namespace and does not improve performance.Signed-off-by Cedric Le Goater <[email protected]>It really is worthless complication, with the sole effect being to complicate testing...
we already force that on by default (in Linux-VServer) and I don't think the code can be considered critical enough for special casing that ...
so I'm perfectly fine with removing that for UTS
best,
Herbert
Quoted 106 lines
Acked-by Serge Hallyn <[email protected]>Quoted 90 lines
--- include/linux/utsname.h | 19 ------------------- init/Kconfig | 8 -------- kernel/Makefile | 3 +-- kernel/sysctl.c | 3 +-- 4 files changed, 2 insertions(+), 31 deletions(-)Index:
2.6.20-rc4-mm1/include/linux/utsname.h
===================================================================include/linux/utsname.h +0
-19@@ -48,7 +48,6 @@ static inline void get_uts_ns(struct utskref_get (&ns->kref); } -#ifdef CONFIG_UTS_NS extern int unshare_utsname (unsigned long unshare_flags,struct uts_namespace **new_uts);extern int copy_utsname (int flags,struct task_struct *tsk);@@ -58,24 +57,6 @@ static inline void put_uts_ns(struct uts {kref_put (&ns->kref, free_uts_ns); } -#else -static inline int unshare_utsname (unsigned long unshare_flags, -struct uts_namespace **new_uts) -{ -if (unshare_flags &CLONE_NEWUTS ) -return -EINVAL ; - -return 0 ; -} - -static inline int copy_utsname (int flags,struct task_struct *tsk) -{ -return 0 ; -} -static inline void put_uts_ns (struct uts_namespace *ns) -{ -} -#endif static inline struct new_utsname *utsname (void ) {Index: 2.6.20-rc4-mm1/init/Kconfig
===================================================================init/Kconfig +0
-8@@ -205,14 +205,6 @@ config TASK_DELAY_ACCT Say N if unsure. -config UTS_NS - bool "UTS Namespaces" - default n - help - Support uts namespaces. This allows containers, i.e. - vservers, to use uts namespaces to provide different - uts info for different servers. If unsure, say N. - config AUDIT bool "Auditing support" depends on NETIndex: 2.6.20-rc4-mm1/kernel/Makefile
===================================================================kernel/Makefile +1
-2@@ -8,7 +8,7 @@ obj-y = sched.o fork.o exec_domain.o signal.o sys.o kmod.o workqueue.o pid.o \ rcupdate.o extable.o params.o posix-timers.o \ kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \ - hrtimer.o rwsem.o latency.o nsproxy.o srcu.o + hrtimer.o rwsem.o latency.o nsproxy.o srcu.o utsname.o obj-$(CONFIG_STACKTRACE) += stacktrace.o obj-y += time/@@ -48,7 +48,6 @@ obj-$(CONFIG_SECCOMP) += seccomp.o obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o obj-$(CONFIG_DEBUG_SYNCHRO_TEST) += synchro-test.o obj-$(CONFIG_RELAY) += relay.o -obj-$(CONFIG_UTS_NS) += utsname.o obj-$(CONFIG_TASK_DELAY_ACCT) += delayacct.o obj-$(CONFIG_TASKSTATS) += taskstats.o tsacct.oIndex:
2.6.20-rc4-mm1/kernel/sysctl.c
===================================================================kernel/sysctl.c +0
-0@@ -187,10 +187,9 @@ int sysctl_legacy_va_layout;static void *get_uts (ctl_table *table,int write)kernel/sysctl.c int sysctl_legacy_va_layout; · line 195
Quoted 10 lines
kernel/sysctl.c +1
-2{char *which = table->data; -#ifdef CONFIG_UTS_NS struct uts_namespace *uts_ns = current->nsproxy->uts_ns; which = (which - (char *)&init_uts_ns) + (char *)uts_ns; -#endif +if (!write)down_read (&uts_sem);else _______________________________________________
Containers mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/containers