Skip to contentSkip to conversation

x86, clocksource, fix !CONFIG_CLOCKSOURCE_WATCHDOG compile

PATCH In review Prarit Bhargava 3 participants 9 messages Feb 22, 2013 – Jul 22, 2013 Timekeeping, clocksource core, NTP, alarmtimer

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86, clocksource, fix !CONFIG_CLOCKSOURCE_WATCHDOG compile

If I explicitly disable the clocksource watchdog in the x86 Kconfig, the x86 kernel will not compile unless this is properly defined.

---
 kernel/time/clocksource.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/clocksource.c +1 -0
index c958338..e04821f 100644
@@ -450,6 +450,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
 static inline void clocksource_dequeue_watchdog(struct clocksource *cs) { }
 static inline void clocksource_resume_watchdog(void) { }
 static inline int clocksource_watchdog_kthread(void *data) { return 0; }
+void clocksource_mark_unstable(struct clocksource *cs) { }
 
 #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */
 
Signature · 1 line
1.7.9.3
#1 lore raw
Quoted 2 lines · Prarit Bhargava

If I explicitly disable the clocksource watchdog in the x86 Kconfig, the x86 kernel will not compile unless this is properly defined.

You shouldn't do that. :)

Quoted 13 lines
---
 kernel/time/clocksource.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/clocksource.c +0 -0
index c958338..e04821f 100644

kernel/time/clocksource.c static void clocksource_enqueue_watchdog(struct clocksource *cs) · line 453

Quoted 4 lines
kernel/time/clocksource.c +1 -0
@@ -450,6 +450,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
 static inline void clocksource_dequeue_watchdog(struct clocksource *cs) { }
 static inline void clocksource_resume_watchdog(void) { }
 static inline int clocksource_watchdog_kthread(void *data) { return 0; }
+void clocksource_mark_unstable(struct clocksource *cs) { }

Unless this is defined as

kernel/time/clocksource.c static void clocksource_enqueue_watchdog(struct clocksource *cs) · line 454

Quoted 1 line
kernel/time/clocksource.c +1 -0
+static inline void clocksource_mark_unstable(struct clocksource *cs) { }

Right?

tglx

#2 lore raw
Quoted 7 lines · Thomas Gleixner
Quoted 1 line

+void clocksource_mark_unstable(struct clocksource *cs) { }

Unless this is defined as

Quoted 1 line

+static inline void clocksource_mark_unstable(struct clocksource *cs) { }

Right?

Whups. Of course ... new patch ...

-----8<----

If I explicitly disable the clocksource watchdog in the x86 Kconfig, the x86 kernel will not compile unless this is properly defined.

---
 kernel/time/clocksource.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/clocksource.c +1 -0
index c958338..3d81a76 100644
@@ -450,6 +450,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
 static inline void clocksource_dequeue_watchdog(struct clocksource *cs) { }
 static inline void clocksource_resume_watchdog(void) { }
 static inline int clocksource_watchdog_kthread(void *data) { return 0; }
+static inline void clocksource_mark_unstable(struct clocksource *cs) { }
 
 #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */
 
Signature · 1 line
1.7.9.3
#3 lore raw
Quoted 29 lines · Prarit Bhargava
Quoted 7 lines · Thomas Gleixner
Quoted 1 line

+void clocksource_mark_unstable(struct clocksource *cs) { }

Unless this is defined as

Quoted 1 line

+static inline void clocksource_mark_unstable(struct clocksource *cs) { }

Right?

Whups. Of course ... new patch ...

-----8<----

If I explicitly disable the clocksource watchdog in the x86 Kconfig, the x86 kernel will not compile unless this is properly defined.

---
 kernel/time/clocksource.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/clocksource.c +0 -0
index c958338..3d81a76 100644

kernel/time/clocksource.c static void clocksource_enqueue_watchdog(struct clocksource *cs) · line 455

Quoted 6 lines
kernel/time/clocksource.c +1 -0
@@ -450,6 +450,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
 static inline void clocksource_dequeue_watchdog(struct clocksource *cs) { }
 static inline void clocksource_resume_watchdog(void) { }
 static inline int clocksource_watchdog_kthread(void *data) { return 0; }
+static inline void clocksource_mark_unstable(struct clocksource *cs) { }
 
 #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */

Yuck. Self NACK this one ... sorry Thomas. I'm going to have to do more work on this patch ...

P.

Quoted 1 line
#4 lore raw
In reply to Thomas Gleixner
Quoted 27 lines · Thomas Gleixner
Quoted 2 lines · Prarit Bhargava

If I explicitly disable the clocksource watchdog in the x86 Kconfig, the x86 kernel will not compile unless this is properly defined.

You shouldn't do that. :)

Quoted 13 lines
---
 kernel/time/clocksource.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/clocksource.c +0 -0
index c958338..e04821f 100644

kernel/time/clocksource.c static void clocksource_enqueue_watchdog(struct clocksource *cs) · line 453

Quoted 4 lines
kernel/time/clocksource.c +1 -0
@@ -450,6 +450,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
 static inline void clocksource_dequeue_watchdog(struct clocksource *cs) { }
 static inline void clocksource_resume_watchdog(void) { }
 static inline int clocksource_watchdog_kthread(void *data) { return 0; }
+void clocksource_mark_unstable(struct clocksource *cs) { }

Unless this is defined as

Quoted 3 lines

kernel/time/clocksource.c static void clocksource_enqueue_watchdog(struct clocksource *cs) · line 454

Quoted 1 line
kernel/time/clocksource.c +1 -0
+static inline void clocksource_mark_unstable(struct clocksource *cs) { }

Right?

Thomas,

Actually that needs to be "void clocksource_mark_unstable()" as it is exported in include/linux/clocksource.h as such.

The other static inline functions above it are only used in clocksource.c.

So I think my patch is correct ...

P.

Quoted 2 lines

tglx

#5 lore raw
In reply to Prarit Bhargava
Quoted 1 line · Prarit Bhargava

If I explicitly disable the clocksource watchdog in the x86 Kconfig,

And why do you want to do that?

Quoted 26 lines

the x86 kernel will not compile unless this is properly defined.

---
 kernel/time/clocksource.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/clocksource.c +1 -0
index c958338..e04821f 100644
@@ -450,6 +450,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
 static inline void clocksource_dequeue_watchdog(struct clocksource *cs) { }
 static inline void clocksource_resume_watchdog(void) { }
 static inline int clocksource_watchdog_kthread(void *data) { return 0; }
+void clocksource_mark_unstable(struct clocksource *cs) { }
 
 #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */
 
Signature · 1 line
1.7.9.3
#6 lore raw
Quoted 5 lines · Thomas Gleixner
Quoted 1 line · Prarit Bhargava

If I explicitly disable the clocksource watchdog in the x86 Kconfig,

And why do you want to do that?

Hey Thomas, I was debugging something and stumbled across this.

IIRC the issue was that there some weirdness on a series of new AMD systems and unfortunately the watchdog would fire and switch clocksources on me :( That resulted in me not being able to debug the HW because the clocksource I wanted was no longer available.

P.

Quoted 27 lines
Quoted 27 lines

the x86 kernel will not compile unless this is properly defined.

---
 kernel/time/clocksource.c |    1 +
 1 file changed, 1 insertion(+)
kernel/time/clocksource.c +1 -0
index c958338..e04821f 100644
@@ -450,6 +450,7 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs)
 static inline void clocksource_dequeue_watchdog(struct clocksource *cs) { }
 static inline void clocksource_resume_watchdog(void) { }
 static inline int clocksource_watchdog_kthread(void *data) { return 0; }
+void clocksource_mark_unstable(struct clocksource *cs) { }
 
 #endif /* CONFIG_CLOCKSOURCE_WATCHDOG */
 
Signature · 1 line
1.7.9.3
#7 lore raw
Quoted 7 lines · Prarit Bhargava
Quoted 4 lines · Thomas Gleixner
Quoted 1 line · Prarit Bhargava

If I explicitly disable the clocksource watchdog in the x86 Kconfig,

Quoted 8 lines
Quoted 1 line

And why do you want to do that?

Hey Thomas, I was debugging something and stumbled across this.

IIRC the issue was that there some weirdness on a series of new AMD systems and unfortunately the watchdog would fire and switch clocksources on me :( That resulted in me not being able to debug the HW because the clocksource I wanted was no longer available.

tsc=reliable on the kernel command line kills the watchdog requirement.

Thanks,

tglx

#8 lore raw
In reply to Prarit Bhargava
Quoted 2 lines · Prarit Bhargava

If I explicitly disable the clocksource watchdog in the x86 Kconfig, the x86 kernel will not compile unless this is properly defined.

Going through my backlog, I noticed I never picked this up. Queued for 3.12.

thanks
-john