+ add-another-clock-for-use-with-the-soft-lockup-watchdog.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: kernel/watchdog.c: add another clock for use with the soft lockup watchdog.
has been added to the -mm tree.  Its filename is
     add-another-clock-for-use-with-the-soft-lockup-watchdog.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/add-another-clock-for-use-with-the-soft-lockup-watchdog.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/add-another-clock-for-use-with-the-soft-lockup-watchdog.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Cyril Bur <cyrilbur@xxxxxxxxx>
Subject: kernel/watchdog.c: add another clock for use with the soft lockup watchdog.

When the hypervisor pauses a virtualised kernel the kernel will observe a
jump in timebase, this can cause spurious messages from the softlockup
detector.

Whilst these messages are harmless, they are accompanied with a stack
trace which causes undue concern and more problematically the stack trace
in the guest has nothing to do with the observed problem and can only be
misleading.

Futhermore, on POWER8 this is completely avoidable with the introduction
of the Virtual Time Base (VTB) register.


This patch (of 2):

This permits the use of arch specific clocks for which virtualised kernels
can use their notion of 'running' time, not the elpased wall time which
will include host execution time.

Signed-off-by: Cyril Bur <cyrilbur@xxxxxxxxx>
Cc: Michael Ellerman <mpe@xxxxxxxxxxxxxx>
Cc: Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>
Cc: Andrew Jones <drjones@xxxxxxxxxx>
Cc: Don Zickus <dzickus@xxxxxxxxxx>
Cc: Ingo Molnar <mingo@xxxxxxxxxx>
Cc: Ulrich Obergfell <uobergfe@xxxxxxxxxx>
Cc: chai wen <chaiw.fnst@xxxxxxxxxxxxxx>
Cc: Fabian Frederick <fabf@xxxxxxxxx>
Cc: Aaron Tomlin <atomlin@xxxxxxxxxx>
Cc: Ben Zhang <benzh@xxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 include/linux/sched.h |    1 +
 kernel/sched/clock.c  |   14 ++++++++++++++
 kernel/watchdog.c     |    2 +-
 3 files changed, 16 insertions(+), 1 deletion(-)

diff -puN include/linux/sched.h~add-another-clock-for-use-with-the-soft-lockup-watchdog include/linux/sched.h
--- a/include/linux/sched.h~add-another-clock-for-use-with-the-soft-lockup-watchdog
+++ a/include/linux/sched.h
@@ -2145,6 +2145,7 @@ extern unsigned long long notrace sched_
  */
 extern u64 cpu_clock(int cpu);
 extern u64 local_clock(void);
+extern u64 running_clock(void);
 extern u64 sched_clock_cpu(int cpu);
 
 
diff -puN kernel/sched/clock.c~add-another-clock-for-use-with-the-soft-lockup-watchdog kernel/sched/clock.c
--- a/kernel/sched/clock.c~add-another-clock-for-use-with-the-soft-lockup-watchdog
+++ a/kernel/sched/clock.c
@@ -74,6 +74,20 @@ unsigned long long __weak sched_clock(vo
 }
 EXPORT_SYMBOL_GPL(sched_clock);
 
+/*
+ * Running clock - returns the time that has elapsed while a guest has been
+ * running.
+ * On a guest this value should be sched_clock minus the time the
+ * guest was suspended by the hypervisor (for any reason).
+ * On bare metal this function should return the same as sched_clock.
+ * Architectures and sub-architectures can override this.
+ */
+unsigned long long __weak running_clock(void)
+{
+	return sched_clock();
+}
+EXPORT_SYMBOL_GPL(running_clock);
+
 __read_mostly int sched_clock_running;
 
 #ifdef CONFIG_HAVE_UNSTABLE_SCHED_CLOCK
diff -puN kernel/watchdog.c~add-another-clock-for-use-with-the-soft-lockup-watchdog kernel/watchdog.c
--- a/kernel/watchdog.c~add-another-clock-for-use-with-the-soft-lockup-watchdog
+++ a/kernel/watchdog.c
@@ -154,7 +154,7 @@ static int get_softlockup_thresh(void)
  */
 static unsigned long get_timestamp(void)
 {
-	return local_clock() >> 30LL;  /* 2^30 ~= 10^9 */
+	return running_clock() >> 30LL;  /* 2^30 ~= 10^9 */
 }
 
 static void set_sample_period(void)
_

Patches currently in -mm which might be from cyrilbur@xxxxxxxxx are

add-another-clock-for-use-with-the-soft-lockup-watchdog.patch
add-another-clock-for-use-with-the-soft-lockup-watchdog-fix.patch
powerpc-add-running_clock-for-powerpc-to-prevent-spurious-softlockup-warnings.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux