diff options
author | Juri Lelli <juri.lelli@redhat.com> | 2019-03-07 07:09:13 -0500 |
---|---|---|
committer | Thomas Gleixner <tglx@linutronix.de> | 2019-03-22 09:14:58 -0400 |
commit | 0f0b7e1cc7abf8e1a8b301f2868379d611d05ae2 (patch) | |
tree | 3a89ad3353ed398b71336b31fbd4856b99f87d92 | |
parent | 9e98c678c2d6ae3a17cb2de55d17f69dddaa231b (diff) |
x86/tsc: Add option to disable tsc clocksource watchdog
Clocksource watchdog has been found responsible for generating latency
spikes (in the 10-20 us range) when woken up to check for TSC stability.
Add an option to disable it at boot.
Signed-off-by: Juri Lelli <juri.lelli@redhat.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: bigeasy@linutronix.de
Cc: linux-rt-users@vger.kernel.org
Cc: peterz@infradead.org
Cc: bristot@redhat.com
Cc: williams@redhat.com
Link: https://lkml.kernel.org/r/20190307120913.13168-1-juri.lelli@redhat.com
-rw-r--r-- | Documentation/admin-guide/kernel-parameters.txt | 4 | ||||
-rw-r--r-- | arch/x86/kernel/tsc.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 2b8ee90bb644..c4d830003b21 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt | |||
@@ -4703,6 +4703,10 @@ | |||
4703 | [x86] unstable: mark the TSC clocksource as unstable, this | 4703 | [x86] unstable: mark the TSC clocksource as unstable, this |
4704 | marks the TSC unconditionally unstable at bootup and | 4704 | marks the TSC unconditionally unstable at bootup and |
4705 | avoids any further wobbles once the TSC watchdog notices. | 4705 | avoids any further wobbles once the TSC watchdog notices. |
4706 | [x86] nowatchdog: disable clocksource watchdog. Used | ||
4707 | in situations with strict latency requirements (where | ||
4708 | interruptions from clocksource watchdog are not | ||
4709 | acceptable). | ||
4706 | 4710 | ||
4707 | turbografx.map[2|3]= [HW,JOY] | 4711 | turbografx.map[2|3]= [HW,JOY] |
4708 | TurboGraFX parallel port interface | 4712 | TurboGraFX parallel port interface |
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c index 3fae23834069..aab0c82e0a0d 100644 --- a/arch/x86/kernel/tsc.c +++ b/arch/x86/kernel/tsc.c | |||
@@ -283,6 +283,7 @@ int __init notsc_setup(char *str) | |||
283 | __setup("notsc", notsc_setup); | 283 | __setup("notsc", notsc_setup); |
284 | 284 | ||
285 | static int no_sched_irq_time; | 285 | static int no_sched_irq_time; |
286 | static int no_tsc_watchdog; | ||
286 | 287 | ||
287 | static int __init tsc_setup(char *str) | 288 | static int __init tsc_setup(char *str) |
288 | { | 289 | { |
@@ -292,6 +293,8 @@ static int __init tsc_setup(char *str) | |||
292 | no_sched_irq_time = 1; | 293 | no_sched_irq_time = 1; |
293 | if (!strcmp(str, "unstable")) | 294 | if (!strcmp(str, "unstable")) |
294 | mark_tsc_unstable("boot parameter"); | 295 | mark_tsc_unstable("boot parameter"); |
296 | if (!strcmp(str, "nowatchdog")) | ||
297 | no_tsc_watchdog = 1; | ||
295 | return 1; | 298 | return 1; |
296 | } | 299 | } |
297 | 300 | ||
@@ -1349,7 +1352,7 @@ static int __init init_tsc_clocksource(void) | |||
1349 | if (tsc_unstable) | 1352 | if (tsc_unstable) |
1350 | goto unreg; | 1353 | goto unreg; |
1351 | 1354 | ||
1352 | if (tsc_clocksource_reliable) | 1355 | if (tsc_clocksource_reliable || no_tsc_watchdog) |
1353 | clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY; | 1356 | clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY; |
1354 | 1357 | ||
1355 | if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC_S3)) | 1358 | if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC_S3)) |