+ reserve-the-right-performance-counter-for-the-intel-perfmon-nmi-watchdog.patch added to -mm tree

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

 



The patch titled
     x86: reserve the right performance counter for the Intel PerfMon NMI watchdog
has been added to the -mm tree.  Its filename is
     reserve-the-right-performance-counter-for-the-intel-perfmon-nmi-watchdog.patch

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

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: x86: reserve the right performance counter for the Intel PerfMon NMI watchdog
From: Björn Steinbrink <B.Steinbrink@xxxxxx>

The Intel PerfMon NMI watchdog was using the generic reservation function
which always reserves the first performance counter.  But the watchdog
actually uses the second performance counter, thus we need a specialised
function.

Signed-off-by: Björn Steinbrink <B.Steinbrink@xxxxxx>
Cc: Andi Kleen <ak@xxxxxxx>
Cc: Stephane Eranian <eranian@xxxxxxxxxx>
Cc: John Levon <levon@xxxxxxxxxxxxxxxxx>
Cc: Philippe Elie <phil.el@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 arch/i386/kernel/cpu/perfctr-watchdog.c |   22 ++++++++++++++++++++--
 1 files changed, 20 insertions(+), 2 deletions(-)

diff -puN arch/i386/kernel/cpu/perfctr-watchdog.c~reserve-the-right-performance-counter-for-the-intel-perfmon-nmi-watchdog arch/i386/kernel/cpu/perfctr-watchdog.c
--- a/arch/i386/kernel/cpu/perfctr-watchdog.c~reserve-the-right-performance-counter-for-the-intel-perfmon-nmi-watchdog
+++ a/arch/i386/kernel/cpu/perfctr-watchdog.c
@@ -562,9 +562,27 @@ static int setup_intel_arch_watchdog(uns
 	return 1;
 }
 
+static int intel_arch_reserve(void)
+{
+	if (!reserve_perfctr_nmi(MSR_ARCH_PERFMON_PERFCTR1))
+		return 0;
+
+	if (!reserve_evntsel_nmi(MSR_ARCH_PERFMON_EVENTSEL1)) {
+		release_perfctr_nmi(MSR_ARCH_PERFMON_PERFCTR1);
+		return 0;
+	}
+	return 1;
+}
+
+static void intel_arch_unreserve(void)
+{
+	release_evntsel_nmi(MSR_ARCH_PERFMON_EVENTSEL1);
+	release_perfctr_nmi(MSR_ARCH_PERFMON_PERFCTR1);
+}
+
 static struct wd_ops intel_arch_wd_ops = {
-	.reserve = single_msr_reserve,
-	.unreserve = single_msr_unreserve,
+	.reserve = intel_arch_reserve,
+	.unreserve = intel_arch_unreserve,
 	.setup = setup_intel_arch_watchdog,
 	.rearm = p6_rearm,
 	.stop = single_msr_stop_watchdog,
_

Patches currently in -mm which might be from B.Steinbrink@xxxxxx are

always-probe-the-nmi-watchdog.patch
reserve-the-right-performance-counter-for-the-intel-perfmon-nmi-watchdog.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