linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH RT] x86/tsc: Add option to disable tsc clocksource watchdog
@ 2019-03-07 12:09 Juri Lelli
  2019-03-14  7:09 ` Juri Lelli
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Lelli @ 2019-03-07 12:09 UTC (permalink / raw)
  To: tglx, bigeasy
  Cc: linux-rt-users, peterz, linux-kernel, bristot, williams,
	Juri Lelli

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>
---
Sending this out as an RFC after yesterday discussion with Thomas on IRC.

AFAICT, CLOCK_SOURCE_MUST_VERIFY only controls enqueue\dequeue of the
watchdog. TSC sync checks are still done if tsc_clocksource_reliable is
set (booting w/o tsc=reliable).

Thomas, is this anywhere close to what you had in mind?
---
 Documentation/admin-guide/kernel-parameters.txt | 4 ++++
 arch/x86/kernel/tsc.c                           | 5 ++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt
index f5acf35c712f..ea7c4967aa80 100644
--- a/Documentation/admin-guide/kernel-parameters.txt
+++ b/Documentation/admin-guide/kernel-parameters.txt
@@ -4619,6 +4619,10 @@
 			[x86] unstable: mark the TSC clocksource as unstable, this
 			marks the TSC unconditionally unstable at bootup and
 			avoids any further wobbles once the TSC watchdog notices.
+			[x86] nowatchdog: disable clocksource watchdog. Used
+			in situations with strict latency requirements (where
+			interruptions from clocksource watchdog are not
+			acceptable).
 
 	turbografx.map[2|3]=	[HW,JOY]
 			TurboGraFX parallel port interface
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 6d5dc5dabfd7..4b753d057aee 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -283,6 +283,7 @@ int __init notsc_setup(char *str)
 __setup("notsc", notsc_setup);
 
 static int no_sched_irq_time;
+static int no_tsc_watchdog;
 
 static int __init tsc_setup(char *str)
 {
@@ -292,6 +293,8 @@ static int __init tsc_setup(char *str)
 		no_sched_irq_time = 1;
 	if (!strcmp(str, "unstable"))
 		mark_tsc_unstable("boot parameter");
+	if (!strcmp(str, "nowatchdog"))
+		no_tsc_watchdog = 1;
 	return 1;
 }
 
@@ -1347,7 +1350,7 @@ static int __init init_tsc_clocksource(void)
 	if (tsc_unstable)
 		goto unreg;
 
-	if (tsc_clocksource_reliable)
+	if (tsc_clocksource_reliable || no_tsc_watchdog)
 		clocksource_tsc.flags &= ~CLOCK_SOURCE_MUST_VERIFY;
 
 	if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC_S3))
-- 
2.17.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH RT] x86/tsc: Add option to disable tsc clocksource watchdog
  2019-03-07 12:09 [RFC PATCH RT] x86/tsc: Add option to disable tsc clocksource watchdog Juri Lelli
@ 2019-03-14  7:09 ` Juri Lelli
  2019-03-20 11:51   ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 3+ messages in thread
From: Juri Lelli @ 2019-03-14  7:09 UTC (permalink / raw)
  To: tglx, bigeasy; +Cc: linux-rt-users, peterz, linux-kernel, bristot, williams

Hi,

On 07/03/19 13:09, Juri Lelli wrote:
> 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.

Gentle ping.

Does this make any sense?

Thanks,

- Juri

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [RFC PATCH RT] x86/tsc: Add option to disable tsc clocksource watchdog
  2019-03-14  7:09 ` Juri Lelli
@ 2019-03-20 11:51   ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 3+ messages in thread
From: Sebastian Andrzej Siewior @ 2019-03-20 11:51 UTC (permalink / raw)
  To: Juri Lelli; +Cc: tglx, linux-rt-users, peterz, linux-kernel, bristot, williams

On 2019-03-14 08:09:51 [+0100], Juri Lelli wrote:
> Hi,
> 
> On 07/03/19 13:09, Juri Lelli wrote:
> > 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.
> 
> Gentle ping.
> 
> Does this make any sense?

I have to reroute this ping to tglx since I wasn't involved.

> Thanks,
> 
> - Juri

Sebastian

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-20 11:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-07 12:09 [RFC PATCH RT] x86/tsc: Add option to disable tsc clocksource watchdog Juri Lelli
2019-03-14  7:09 ` Juri Lelli
2019-03-20 11:51   ` Sebastian Andrzej Siewior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).