: Resubmit Fix bogus softlockup warning with sysrq-t
Subsystems (5)
PATCH 1/1 : Resubmit Fix bogus softlockup warning with sysrq-t
New patch to replace
fix-bogus-softlockup-warning-with-sysrq-t.patch in -mm tree.
(Andi Kleen set me straight on the the touch_nmi_watchdog issue below. I should reset the softlockup watchdog for the calling cpu, not all of them as I had originally coded before).
Please re-ack ...
P.
--
There are some situations when soft lockup warnings are expected in the kernel. For example, when doing an alt-sysrq-t on a large number of processes, the dump to console can take a long time and the tasklist_lock is held over that period. This results in a bogus soft lockup warning.
This patch reworks touch_softlockup_watchdog to touch ALL cpu's touch_timestamp. It also introduces touch_cpu_softlockup_watchdog to touch a single cpu's touch_timestamp. This makes it functionally equivalent to touch_nmi_watchdog (suggestion by davej).
nmi_watchdog is modified to touch only a single cpu's softlockup watchdog (suggestion by Andi Kleen).
/drivers/ide/ide-iops.c does not need to call touch_softlockup_watchdog as it is done in the call to touch_nmi_watchdog.
The EXPORT_SYMBOL for touch_softlockup_watchdog is needed by drivers/scsi/ips.ko
arch/i386/kernel/nmi.c +1 -1
@@ -928,7 +928,7 @@ void touch_nmi_watchdog (void)/* * Tickle the softlockup detector too: */ -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog (); }EXPORT_SYMBOL (touch_nmi_watchdog);
arch/ia64/kernel/uncached.c +1 -1
@@ -254,7 +254,7 @@ static int __init uncached_build_memmap(unsigned long uc_start,struct gen_pool *pool = uncached_pools[nid].pool;size_t size = uc_end - uc_start; -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog ();if (pool !=NULL ) {memset ((char *)uc_start,0 , size);
arch/x86_64/kernel/nmi.c +1 -1
@@ -811,7 +811,7 @@ void touch_nmi_watchdog (void)per_cpu (nmi_touch, cpu) =1 ; } -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog (); }int __kprobes nmi_watchdog_tick (struct pt_regs * regs,unsigned reason)
drivers/ide/ide-iops.c +0 -1
@@ -1232,7 +1232,6 @@ int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout)*/ if (stat ==0xff )return -ENODEV ; -touch_softlockup_watchdog ();touch_nmi_watchdog (); }return -EBUSY ;
drivers/ide/ide-taskfile.c +1 -1
@@ -313,7 +313,7 @@ static void ide_pio_datablock(ide_drive_t *drive, struct request *rq,if (rq->bio)/* fs request */ rq->errors =0 ; -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog ();switch (drive->hwif->data_phase) {case TASKFILE_MULTI_IN :
drivers/mtd/nand/nand_base.c +1 -1
@@ -425,7 +425,7 @@ void nand_wait_ready(struct mtd_info *mtd)do {if (chip->dev_ready (mtd))break ; -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog (); }while (time_before (jiffies, timeo));led_trigger_event (nand_led_trigger,LED_OFF ); }
include/linux/sched.h +4 -0
@@ -225,6 +225,7 @@ extern void scheduler_tick(void);#ifdef CONFIG_DETECT_SOFTLOCKUP extern void softlockup_tick (void );extern void spawn_softlockup_task (void ); +extern void touch_cpu_softlockup_watchdog (void );extern void touch_softlockup_watchdog (void );#else static inline void softlockup_tick (void )
@@ -233,6 +234,9 @@ static inline void softlockup_tick(void)static inline void spawn_softlockup_task (void ) { } +static inline void touch_cpu_softlockup_watchdog (void ) +{ +}static inline void touch_softlockup_watchdog (void ) { }
kernel/panic.c +1 -1
@@ -132,7 +132,7 @@ NORET_TYPE void panic(const char * fmt, ...)#endif local_irq_enable ();for (i =0 ;;) { -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog (); i +=panic_blink (i);mdelay (1 ); i++;
kernel/power/swsusp.c +1 -1
@@ -323,7 +323,7 @@ int swsusp_resume(void)*/ swsusp_free ();restore_processor_state (); -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog ();device_power_up ();local_irq_enable ();return error;
kernel/sched.c +1 -0
@@ -4783,6 +4783,7 @@ void show_state_filter(unsigned long state_filter)if (p->state & state_filter)show_task (p); }while_each_thread (g, p); +touch_softlockup_watchdog ();read_unlock (&tasklist_lock);/*
kernel/softlockup.c +13 -3
@@ -8,6 +8,7 @@*/ #include <linux/mm.h> #include <linux/cpu.h> +#include <linux/cpumask.h> #include <linux/init.h> #include <linux/delay.h> #include <linux/kthread.h>
@@ -34,10 +35,19 @@ static struct notifier_block panic_block = { .notifier_call = softlock_panic, }; -void touch_softlockup_watchdog (void ) +void touch_cpu_softlockup_watchdog (void ) {__raw_get_cpu_var (touch_timestamp) = jiffies; } +EXPORT_SYMBOL (touch_cpu_softlockup_watchdog); + +void touch_softlockup_watchdog (void ) +{ +int cpu; + +for_each_online_cpu (cpu) +per_cpu (touch_timestamp, cpu) = jiffies; +}EXPORT_SYMBOL (touch_softlockup_watchdog);/*
@@ -57,7 +67,7 @@ void softlockup_tick(void)/* do not print during early bootup: */ if (unlikely (system_state !=SYSTEM_RUNNING )) { -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog ();return ; }
@@ -94,7 +104,7 @@ static int watchdog(void * __bind_cpu)*/ while (!kthread_should_stop ()) {set_current_state (TASK_INTERRUPTIBLE ); -touch_softlockup_watchdog (); +touch_cpu_softlockup_watchdog ();schedule (); }