[Devel] [PATCH rh7 2/2] Revert "x86: vdso: add sysctl to disable vdso for gettime monotonic"

Andrey Ryabinin aryabinin at virtuozzo.com
Wed May 24 08:21:43 PDT 2017


This reverts commit 97fb49e1c44ce50390d1aa27bc1badda2962b68d.

We don't need this sysctl anymore because __vdso_gettime for monotonic
clocks in containers works fine now.

https://jira.sw.ru/browse/PSBM-66451
Signed-off-by: Andrey Ryabinin <aryabinin at virtuozzo.com>
---
 arch/x86/include/asm/vgtod.h   |  1 -
 arch/x86/kernel/vsyscall_64.c  | 23 +----------------------
 arch/x86/vdso/vclock_gettime.c |  6 ++----
 3 files changed, 3 insertions(+), 27 deletions(-)

diff --git a/arch/x86/include/asm/vgtod.h b/arch/x86/include/asm/vgtod.h
index 8e18603c5905..46e24d36b7da 100644
--- a/arch/x86/include/asm/vgtod.h
+++ b/arch/x86/include/asm/vgtod.h
@@ -21,7 +21,6 @@ struct vsyscall_gtod_data {
 	u64		monotonic_time_snsec;
 	time_t		monotonic_time_sec;
 
-	int		gettime_monotonic_enabled;
 	struct timezone sys_tz;
 	struct timespec wall_time_coarse;
 	struct timespec monotonic_time_coarse;
diff --git a/arch/x86/kernel/vsyscall_64.c b/arch/x86/kernel/vsyscall_64.c
index 2d53d3b4c27d..805272cc1e9c 100644
--- a/arch/x86/kernel/vsyscall_64.c
+++ b/arch/x86/kernel/vsyscall_64.c
@@ -54,7 +54,7 @@
 #include "vsyscall_trace.h"
 
 DEFINE_VVAR(int, vgetcpu_mode);
-DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data) = { .gettime_monotonic_enabled = 0, };
+DEFINE_VVAR(struct vsyscall_gtod_data, vsyscall_gtod_data);
 
 static enum { EMULATE, NATIVE, NONE } vsyscall_mode = EMULATE;
 
@@ -327,24 +327,6 @@ sigsegv:
 	force_sig(SIGSEGV, current);
 	return true;
 }
-#ifdef CONFIG_SYSCTL
-static ctl_table kernel_table2[] = {
-	{ .procname = "vsyscall64_gettime_monotonic",
-	  .data = &vsyscall_gtod_data.gettime_monotonic_enabled, .maxlen = sizeof(int),
-	  .mode = 0644,
-	  .proc_handler = proc_dointvec
-	},
-	{
-	},
-};
-static ctl_table kernel_root_table2[] = {
-	{ .procname = "kernel", .mode = 0555,
-	  .child = kernel_table2
-	},
-	{
-	}
-};
-#endif
 
 /*
  * Assume __initcall executes before all user space. Hopefully kmod
@@ -412,9 +394,6 @@ static int __init vsyscall_init(void)
 {
 	BUG_ON(VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE));
 
-#ifdef CONFIG_SYSCTL
-	register_sysctl_table(kernel_root_table2);
-#endif
 	cpu_notifier_register_begin();
 
 	on_each_cpu(cpu_vsyscall_init, NULL, 1);
diff --git a/arch/x86/vdso/vclock_gettime.c b/arch/x86/vdso/vclock_gettime.c
index 3a5b319984c7..e3f80badc5ac 100644
--- a/arch/x86/vdso/vclock_gettime.c
+++ b/arch/x86/vdso/vclock_gettime.c
@@ -270,14 +270,12 @@ notrace int __vdso_clock_gettime(clockid_t clock, struct timespec *ts)
 		ret = do_realtime(ts);
 		break;
 	case CLOCK_MONOTONIC:
-		if (gtod->gettime_monotonic_enabled)
-			ret = do_monotonic(ts);
+		ret = do_monotonic(ts);
 		break;
 	case CLOCK_REALTIME_COARSE:
 		return do_realtime_coarse(ts);
 	case CLOCK_MONOTONIC_COARSE:
-		if (gtod->gettime_monotonic_enabled)
-			return do_monotonic_coarse(ts);
+		return do_monotonic_coarse(ts);
 	}
 
 	if (ret == VCLOCK_NONE)
-- 
2.13.0



More information about the Devel mailing list