rpms/kernel/F-8 linux-2.6-x86-fix-oprofile-and-hibernation-issues.patch, NONE, 1.1 kernel.spec, 1.518, 1.519

Chuck Ebbert cebbert at fedoraproject.org
Sat Aug 30 09:01:53 UTC 2008


Author: cebbert

Update of /cvs/pkgs/rpms/kernel/F-8
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22749

Modified Files:
	kernel.spec 
Added Files:
	linux-2.6-x86-fix-oprofile-and-hibernation-issues.patch 
Log Message:
x86: fix oprofile + hibernation badness (F9#459413)

linux-2.6-x86-fix-oprofile-and-hibernation-issues.patch:

--- NEW FILE linux-2.6-x86-fix-oprofile-and-hibernation-issues.patch ---
From: Andi Kleen <ak at linux.intel.com>
Date: Tue, 19 Aug 2008 01:13:38 +0000 (+0200)
Subject: x86: fix oprofile + hibernation badness
X-Git-Tag: v2.6.27-rc5~5^2~30
X-Git-Url: http://git.kernel.org/?p=linux%2Fkernel%2Fgit%2Ftorvalds%2Flinux-2.6.git;a=commitdiff_plain;h=80a8c9fffa78f57d7d4351af2f15a56386805ceb

x86: fix oprofile + hibernation badness

Vegard Nossum reported oprofile + hibernation problems:

> Now some warnings:
>
> ------------[ cut here ]------------
> WARNING: at /uio/arkimedes/s29/vegardno/git-working/linux-2.6/kernel/smp.c:328 s
> mp_call_function_mask+0x194/0x1a0()

The usual problem: the suspend function when interrupts are
already disabled calls smp_call_function which is not allowed with
interrupt off. But at this point all the other CPUs should be already
down anyways, so it should be enough to just drop that.

This patch should fix that problem at least by fixing cpu hotplug&
suspend support.

[ mingo at elte.hu: fixed 5 coding style errors. ]

Signed-off-by: Andi Kleen <ak at linux.intel.com>
Tested-by: Vegard Nossum <vegard.nossum at gmail.com>
Signed-off-by: Ingo Molnar <mingo at elte.hu>
---
BZ 459413

diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c
index 3f90289..0227694 100644
--- a/arch/x86/oprofile/nmi_int.c
+++ b/arch/x86/oprofile/nmi_int.c
@@ -15,6 +15,7 @@
 #include <linux/slab.h>
 #include <linux/moduleparam.h>
 #include <linux/kdebug.h>
+#include <linux/cpu.h>
 #include <asm/nmi.h>
 #include <asm/msr.h>
 #include <asm/apic.h>
@@ -28,23 +29,48 @@ static DEFINE_PER_CPU(unsigned long, saved_lvtpc);
 
 static int nmi_start(void);
 static void nmi_stop(void);
+static void nmi_cpu_start(void *dummy);
+static void nmi_cpu_stop(void *dummy);
 
 /* 0 == registered but off, 1 == registered and on */
 static int nmi_enabled = 0;
 
+#ifdef CONFIG_SMP
+static int oprofile_cpu_notifier(struct notifier_block *b, unsigned long action,
+				 void *data)
+{
+	int cpu = (unsigned long)data;
+	switch (action) {
+	case CPU_DOWN_FAILED:
+	case CPU_ONLINE:
+		smp_call_function_single(cpu, nmi_cpu_start, NULL, 0);
+		break;
+	case CPU_DOWN_PREPARE:
+		smp_call_function_single(cpu, nmi_cpu_stop, NULL, 1);
+		break;
+	}
+	return NOTIFY_DONE;
+}
+
+static struct notifier_block oprofile_cpu_nb = {
+	.notifier_call = oprofile_cpu_notifier
+};
+#endif
+
 #ifdef CONFIG_PM
 
 static int nmi_suspend(struct sys_device *dev, pm_message_t state)
 {
+	/* Only one CPU left, just stop that one */
 	if (nmi_enabled == 1)
-		nmi_stop();
+		nmi_cpu_stop(NULL);
 	return 0;
 }
 
 static int nmi_resume(struct sys_device *dev)
 {
 	if (nmi_enabled == 1)
-		nmi_start();
+		nmi_cpu_start(NULL);
 	return 0;
 }
 
@@ -463,6 +489,9 @@ int __init op_nmi_init(struct oprofile_operations *ops)
 	}
 
 	init_sysfs();
+#ifdef CONFIG_SMP
+	register_cpu_notifier(&oprofile_cpu_nb);
+#endif
 	using_nmi = 1;
 	ops->create_files = nmi_create_files;
 	ops->setup = nmi_setup;
@@ -476,6 +505,10 @@ int __init op_nmi_init(struct oprofile_operations *ops)
 
 void op_nmi_exit(void)
 {
-	if (using_nmi)
+	if (using_nmi) {
 		exit_sysfs();
+#ifdef CONFIG_SMP
+		unregister_cpu_notifier(&oprofile_cpu_nb);
+#endif
+	}
 }


Index: kernel.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel/F-8/kernel.spec,v
retrieving revision 1.518
retrieving revision 1.519
diff -u -r1.518 -r1.519
--- kernel.spec	30 Aug 2008 04:49:57 -0000	1.518
+++ kernel.spec	30 Aug 2008 09:01:23 -0000	1.519
@@ -580,6 +580,7 @@
 Patch87: linux-2.6-x86-apic-dump-all-regs-v3.patch
 Patch88: linux-2.6-x86-64-fix-overlap-of-modules-and-fixmap-areas.patch
 Patch89: linux-2.6-x86-fdiv-bug-detection-fix.patch
+Patch91: linux-2.6-x86-fix-oprofile-and-hibernation-issues.patch
 
 #ALSA
 
@@ -996,6 +997,8 @@
 ApplyPatch linux-2.6-x86-64-fix-overlap-of-modules-and-fixmap-areas.patch
 # x86 f00f bug not handled properly (#197455)
 ApplyPatch linux-2.6-x86-fdiv-bug-detection-fix.patch
+# oprofile / hibernation fix
+ApplyPatch linux-2.6-x86-fix-oprofile-and-hibernation-issues.patch
 
 #
 # PowerPC
@@ -1782,6 +1785,9 @@
 
 
 %changelog
+* Sat Aug 30 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.3-9
+- x86: fix oprofile + hibernation badness (F9#459413)
+
 * Fri Aug 29 2008 Chuck Ebbert <cebbert at redhat.com> 2.6.26.3-8
 - USB: fix hcd interrupt disabling (F9#457165)
 




More information about the fedora-extras-commits mailing list