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

rpms/kernel/devel linux-2.6-debug-detect-softlockups.patch, NONE, 1.1 linux-2.6-debug-taint-check.patch, NONE, 1.1 kernel-2.6.spec, 1.1458, 1.1459 linux-2.6.12-detect-softlockups.patch, 1.2, NONE linux-2.6.12-scsicam-geom-fix.patch, 1.1, NONE linux-2.6.3-printopen.patch, 1.20, NONE



Author: davej

Update of /cvs/dist/rpms/kernel/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv26232

Modified Files:
	kernel-2.6.spec 
Added Files:
	linux-2.6-debug-detect-softlockups.patch 
	linux-2.6-debug-taint-check.patch 
Removed Files:
	linux-2.6.12-detect-softlockups.patch 
	linux-2.6.12-scsicam-geom-fix.patch 
	linux-2.6.3-printopen.patch 
Log Message:
specfile cleanup, drop dead patches.



linux-2.6-debug-detect-softlockups.patch:
 linux-2.6.11/kernel/softirq.c |    2 
 linux/include/linux/sched.h   |   13 ++++
 linux/init/main.c             |    1 
 linux/kernel/Makefile         |    1 
 linux/kernel/softlockup.c     |  130 ++++++++++++++++++++++++++++++++++++++++++
 linux/kernel/timer.c          |    1 
 linux/lib/Kconfig.debug       |   19 ++++++
 7 files changed, 166 insertions(+), 1 deletion(-)

--- NEW FILE linux-2.6-debug-detect-softlockups.patch ---
--- linux/kernel/softlockup.c.orig
+++ linux/kernel/softlockup.c
@@ -0,0 +1,130 @@
+/*
+ * Detect Soft Lockups
+ *
+ * started by Ingo Molnar, (C) 2005, Red Hat
+ *
+ * this code detects soft lockups: incidents in where on a CPU
+ * the kernel does not reschedule for 10 seconds or more.
+ */
+
+#include <linux/mm.h>
+#include <linux/cpu.h>
+#include <linux/init.h>
+#include <linux/delay.h>
+#include <linux/kthread.h>
+#include <linux/notifier.h>
+
+static DEFINE_SPINLOCK(print_lock);
+
+static DEFINE_PER_CPU(unsigned long, timestamp) = 0;
+static DEFINE_PER_CPU(unsigned long, print_timestamp) = 0;
+static DEFINE_PER_CPU(struct task_struct *, watchdog_task);
+
+extern void takeover_tasklets(unsigned int cpu);
+
+/*
+ * This callback runs from the timer interrupt, and checks
+ * whether the watchdog thread has hung or not:
+ */
+void softlockup_tick(struct pt_regs *regs)
+{
+	int this_cpu = smp_processor_id();
+	unsigned long timestamp = per_cpu(timestamp, this_cpu);
+
+	if (per_cpu(print_timestamp, this_cpu) == timestamp)
+		return;
+
+	if (time_after(jiffies, timestamp + 10*HZ)) {
+		per_cpu(print_timestamp, this_cpu) = timestamp;
+
+		spin_lock(&print_lock);
+		printk(KERN_ERR "BUG: soft lockup detected on CPU#%d!\n",
+			this_cpu);
+		show_regs(regs);
+		dump_stack();
+		spin_unlock(&print_lock);
+	}
+}
+
+/*
+ * The watchdog thread - runs every second and touches the timestamp.
+ */
+static int watchdog(void * __bind_cpu)
+{
+	struct sched_param param = { .sched_priority = 99 };
+	int this_cpu = (long) __bind_cpu;
+
+	printk("softlockup thread %d started up.\n", this_cpu);
+
+	sched_setscheduler(current, SCHED_FIFO, &param);
+	current->flags |= PF_NOFREEZE;
+
+	set_current_state(TASK_INTERRUPTIBLE);
+
+	/*
+	 * Run briefly once per second - if this gets delayed for
+	 * more than 10 seconds then the debug-printout triggers
+	 * in softlockup_tick():
+	 */
+	while (!kthread_should_stop()) {
+		set_current_state(TASK_INTERRUPTIBLE);
+		msleep_interruptible(HZ);
+		per_cpu(timestamp, this_cpu) = jiffies;
+	}
+	__set_current_state(TASK_RUNNING);
+
+	return 0;
+}
+
+/*
+ * Create/destroy watchdog threads as CPUs come and go:
+ */
+static int __devinit
+cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+{
+	int hotcpu = (unsigned long)hcpu;
+	struct task_struct *p;
+
+	switch (action) {
+	case CPU_UP_PREPARE:
+		BUG_ON(per_cpu(watchdog_task, hotcpu));
+		p = kthread_create(watchdog, hcpu, "watchdog/%d", hotcpu);
+		if (IS_ERR(p)) {
+			printk("watchdog for %i failed\n", hotcpu);
+			return NOTIFY_BAD;
+		}
+  		per_cpu(watchdog_task, hotcpu) = p;
+		kthread_bind(p, hotcpu);
+ 		break;
+	case CPU_ONLINE:
+
+		wake_up_process(per_cpu(watchdog_task, hotcpu));
+		break;
+#ifdef CONFIG_HOTPLUG_CPU
+	case CPU_UP_CANCELED:
+		/* Unbind so it can run.  Fall thru. */
+		kthread_bind(per_cpu(watchdog_task, hotcpu), smp_processor_id());
+	case CPU_DEAD:
+		p = per_cpu(watchdog_task, hotcpu);
+		per_cpu(watchdog_task, hotcpu) = NULL;
+		kthread_stop(p);
+		takeover_tasklets(hotcpu);
+		break;
+#endif /* CONFIG_HOTPLUG_CPU */
+ 	}
+	return NOTIFY_OK;
+}
+
+static struct notifier_block __devinitdata cpu_nfb = {
+	.notifier_call = cpu_callback
+};
+
+__init void spawn_softlockup_task(void)
+{
+	void *cpu = (void *)(long)smp_processor_id();
+
+	cpu_callback(&cpu_nfb, CPU_UP_PREPARE, cpu);
+	cpu_callback(&cpu_nfb, CPU_ONLINE, cpu);
+	register_cpu_notifier(&cpu_nfb);
+}
+
--- linux/kernel/Makefile.orig
+++ linux/kernel/Makefile
@@ -25,6 +25,7 @@ obj-$(CONFIG_AUDIT) += audit.o
 obj-$(CONFIG_AUDITSYSCALL) += auditsc.o
 obj-$(CONFIG_KPROBES) += kprobes.o
 obj-$(CONFIG_SYSFS) += ksysfs.o
+obj-$(CONFIG_DETECT_SOFTLOCKUP) += softlockup.o
 obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
 
 ifneq ($(CONFIG_IA64),y)
--- linux/kernel/timer.c.orig
+++ linux/kernel/timer.c
@@ -921,6 +921,7 @@ void do_timer(struct pt_regs *regs)
 {
 	jiffies_64++;
 	update_times();
+	softlockup_tick(regs);
 }
 
 #ifdef __ARCH_WANT_SYS_ALARM
--- linux/init/main.c.orig
+++ linux/init/main.c
@@ -596,6 +596,7 @@ static void do_pre_smp_initcalls(void)
 	migration_init();
 #endif
 	spawn_ksoftirqd();
+	spawn_softlockup_task();
 }
 
 static void run_init_process(char *init_filename)
--- linux/include/linux/sched.h.orig
+++ linux/include/linux/sched.h
@@ -176,6 +176,19 @@ extern void update_process_times(int use
 extern void scheduler_tick(void);
 extern unsigned long cache_decay_ticks;
 
+#ifdef CONFIG_DETECT_SOFTLOCKUP
+extern void softlockup_tick(struct pt_regs *regs);
+extern void spawn_softlockup_task(void);
+#else
+static inline void softlockup_tick(struct pt_regs *regs)
+{
+}
+static inline void spawn_softlockup_task(void)
+{
+}
+#endif
+
+
 /* Attach to any functions which should be ignored in wchan output. */
 #define __sched		__attribute__((__section__(".sched.text")))
 /* Is this address in the __sched functions? */
--- linux/lib/Kconfig.debug.orig
+++ linux/lib/Kconfig.debug
@@ -27,6 +27,25 @@ config MAGIC_SYSRQ
 	  Enables console device to interpret special characters as
 	  commands to dump state information.
 
+config DETECT_SOFTLOCKUP
+	bool "Detect Soft Lockups"
+	depends on DEBUG_KERNEL
+	default y
+	help
+	  Say Y here to enable the kernel to detect "soft lockups",
+	  which are bugs that cause the kernel to loop in kernel
+	  mode for more than 10 seconds, without giving other tasks a
+	  chance to run.
+
+	  When a soft-lockup is detected, the kernel will print the
+	  current stack trace (which you should report), but the
+	  system will stay locked up. This feature has negligible
+	  overhead.
+
+	  (Note that "hard lockups" are separate type of bugs that
+	   can be detected via the NMI-watchdog, on platforms that
+	   support it.)
+
 config SCHEDSTATS
 	bool "Collect scheduler statistics"
 	depends on DEBUG_KERNEL && PROC_FS
--- linux-2.6.11/kernel/softirq.c~	2005-05-11 21:47:38.000000000 -0400
+++ linux-2.6.11/kernel/softirq.c	2005-05-11 21:47:53.000000000 -0400
@@ -455,7 +455,7 @@ void tasklet_kill_immediate(struct taskl
 	BUG();
 }
 
-static void takeover_tasklets(unsigned int cpu)
+void takeover_tasklets(unsigned int cpu)
 {
 	struct tasklet_struct **i;
 

linux-2.6-debug-taint-check.patch:
 arch/i386/kernel/traps.c |    5 ++++-
 include/linux/kernel.h   |    1 +
 kernel/panic.c           |    7 +++++++
 mm/slab.c                |   12 +++++++++++-
 4 files changed, 23 insertions(+), 2 deletions(-)

--- NEW FILE linux-2.6-debug-taint-check.patch ---
--- linux-2.6.11/kernel/panic.c~	2005-04-20 03:48:57.000000000 -0400
+++ linux-2.6.11/kernel/panic.c	2005-04-20 03:49:28.000000000 -0400
@@ -159,3 +159,10 @@ void add_taint(unsigned flag)
 	tainted |= flag;
 }
 EXPORT_SYMBOL(add_taint);
+
+int check_tainted(void)
+{
+	return tainted;
+}
+EXPORT_SYMBOL_GPL(check_tainted);
+
--- linux-2.6.11/include/linux/kernel.h~	2005-04-20 03:49:49.000000000 -0400
+++ linux-2.6.11/include/linux/kernel.h	2005-04-20 03:49:56.000000000 -0400
@@ -156,6 +156,7 @@ extern int panic_on_oops;
 extern int tainted;
 extern const char *print_tainted(void);
 extern void add_taint(unsigned);
+extern int check_tainted(void);
 
 #define crashdump_mode()       unlikely(netdump_mode || diskdump_mode)
 
--- linux-2.6.11/arch/i386/kernel/traps.c~	2005-04-20 03:57:00.000000000 -0400
+++ linux-2.6.11/arch/i386/kernel/traps.c	2005-04-20 03:58:23.000000000 -0400
@@ -182,7 +182,10 @@ void show_stack(struct task_struct *task
 			break;
 		if (i && ((i % 8) == 0))
 			printk("\n       ");
-		printk("%08lx ", *stack++);
+		if ((check_tainted() != 0) && (i==0))
+			printk("badc0ded ");
+		else
+			printk("%08lx ", *stack++);
 	}
 	printk("\nCall Trace:\n");
 	show_trace(task, esp);
--- linux-2.6.11/mm/slab.c~	2005-04-21 00:48:06.000000000 -0400
+++ linux-2.6.11/mm/slab.c	2005-04-21 00:57:00.000000000 -0400
@@ -1006,7 +1006,17 @@ static void dump_line(char *data, int of
 	int i;
 	printk(KERN_ERR "%03x:", offset);
 	for (i=0;i<limit;i++) {
-		printk(" %02x", (unsigned char)data[offset+i]);
+		if (check_tainted() == 0)
+			printk(" %02x", (unsigned char)data[offset+i]);
+		else {
+			switch (i) {
+			case 0:	printk(" f3 3d");
+					break;
+			case 1: break;
+			default:
+				printk(" %02x", (unsigned char)data[offset+i]);
+			}
+		}
 	}
 	printk("\n");
 }


Index: kernel-2.6.spec
===================================================================
RCS file: /cvs/dist/rpms/kernel/devel/kernel-2.6.spec,v
retrieving revision 1.1458
retrieving revision 1.1459
diff -u -r1.1458 -r1.1459
--- kernel-2.6.spec	8 Aug 2005 21:59:34 -0000	1.1458
+++ kernel-2.6.spec	8 Aug 2005 22:10:40 -0000	1.1459
@@ -288,6 +288,7 @@
 Patch1013: linux-2.6-debug-taint-vm.patch
 Patch1014: linux-2.6-debug-taint-check.patch
 Patch1015: linux-2.6-debug-singlebiterror.patch
+Patch1016: linux-2.6-debug-detect-softlockups.patch
 
 Patch1050: linux-2.6.11-devmem.patch
 Patch1051: linux-2.6.8-devmem-xen.patch
@@ -300,8 +301,7 @@
 Patch1101: linux-2.6.9-scsi-advansys-enabler.patch
 Patch1102: linux-2.6.9-scsi-megaraid-legacy.patch
 Patch1103: linux-2.6.12-scsi-blacklist.patch
-Patch1104: linux-2.6.12-scsicam-geom-fix.patch
-Patch1105: linux-2.6.12-scsi-advansys-pcitable.patch
+Patch1104: linux-2.6.12-scsi-advansys-pcitable.patch
 
 # NFS bits.
 Patch1200: linux-2.6.9-NFSD-non-null-getxattr.patch
@@ -309,12 +309,12 @@
 # NIC driver updates
 Patch1300: linux-2.6.9-net-tr-irqlock-fix.patch
 Patch1301: linux-2.6.12-net-sundance-ip100A.patch
-Patch1304: linux-2.6.12-net-atm-lanai-nodev-rmmod.patch
+Patch1302: linux-2.6.12-net-atm-lanai-nodev-rmmod.patch
 
 # USB bits
 Patch1400: linux-2.6.12-usb-old_scheme_first.patch
-Patch1402: linux-2.6.11-random-ehci-patch.patch
-Patch1403: linux-2.6-usbmon-deficiency-workaround.patch
+Patch1401: linux-2.6.11-random-ehci-patch.patch
+Patch1402: linux-2.6-usbmon-deficiency-workaround.patch
 
 # Netdump and Diskdump bits.
 Patch1500: linux-2.6.10-crashdump-common.patch
@@ -334,7 +334,6 @@
 Patch1710: linux-2.6.11-parport-sysctl-perms.patch
 Patch1720: linux-2.6.11-libata-promise-pata-on-sata.patch
 Patch1730: linux-2.6.12-input-kill-stupid-messages.patch
-Patch1740: linux-2.6.12-detect-softlockups.patch
 Patch1750: linux-2.6.11-serial-tickle-nmi.patch
 Patch1760: linux-2.6.12-missing-exports.patch
 Patch1770: linux-2.6.11-radeon-backlight.patch
@@ -346,16 +345,14 @@
 # VM bits.
 Patch2000: linux-2.6.9-vm-oomkiller-debugging.patch
 
-Patch2999: linux-2.6.3-printopen.patch
-
 #
 # External drivers that are about to get accepted upstream
 #
 
 # Intel Centrino wireless drivers.
-Patch3020: linux-2.6.9-ipw2100.patch
-Patch3021: linux-2.6.9-ipw2200.patch
-Patch3022: linux-2.6.9-ieee80211.patch 
+Patch3000: linux-2.6.9-ipw2100.patch
+Patch3001: linux-2.6.9-ipw2200.patch
+Patch3002: linux-2.6.9-ieee80211.patch 
 
 #
 # 10000 to 20000 is for stuff that has to come last due to the
@@ -648,6 +645,7 @@
 %patch1013 -p1
 %patch1014 -p1
 %patch1015 -p1
+%patch1016 -p1
 
 #
 # Make /dev/mem a need-to-know function 
@@ -679,10 +677,8 @@
 %patch1102 -p1
 # Blacklist some SCSI devices that don't like having LUNs probed.
 %patch1103 -p1
-# SCSI CAM geometry fix.
-%patch1104 -p1
 # Add a pci table to advansys driver.
-%patch1105 -p1
+%patch1104 -p1
 
 #
 # Various upstream NFS/NFSD fixes.
@@ -695,14 +691,14 @@
 # New PCI ID for sundance driver.
 %patch1301 -p1
 # Fix rmmod lanai
-%patch1304 -p1
+%patch1302 -p1
 
 # USB Bits.
 # Enable both old and new style USB initialisation.
 %patch1400 -p1
 # Do something else originally described as "Alan's hint for ehci"
+%patch1401 -p1
 %patch1402 -p1
-%patch1403 -p1
 
 # netdump bits
 #%patch1500 -p1
@@ -738,8 +734,6 @@
 %patch1720 -p1
 # The input layer spews crap no-one cares about.
 %patch1730 -p1
-# Detect soft lockups.
-%patch1740 -p1
 # Tickle the NMI whilst doing serial writes.
 %patch1750 -p1
 # Missing EXPORT_SYMBOL's
@@ -763,20 +757,13 @@
 
 
 #
-# Local hack (off for any shipped kernels) to printk all files opened 
-# the first 180 seconds after boot for debugging userspace startup 
-# speeds
-#
-#%patch2999 -p1
-
-#
 # External drivers that are about to get accepted upstream
 #
 
 # Intel wireless
-%patch3020 -p1
-%patch3021 -p1
-%patch3022 -p1
+%patch3000 -p1
+%patch3001 -p1
+%patch3002 -p1
 
 #
 # Patches 5000 to 6000 are reserved for new drivers that are about to


--- linux-2.6.12-detect-softlockups.patch DELETED ---


--- linux-2.6.12-scsicam-geom-fix.patch DELETED ---


--- linux-2.6.3-printopen.patch DELETED ---


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