All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Michal Piotrowski <michal.k.k.piotrowski@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: 2.6.21-rc2-git3 soft lockup detected on CPU#0 (crash dump kernel)
Date: Mon, 5 Mar 2007 11:31:42 +0100	[thread overview]
Message-ID: <20070305103141.GA18404@elte.hu> (raw)
In-Reply-To: <1173090869.24738.198.camel@localhost.localdomain>


* Thomas Gleixner <tglx@linutronix.de> wrote:

> > shouldnt that be 'R' instead of the question mark?
> 
> ? are dead ones,  

ok.

> The interesting part is here:
> 
> 1 lock held by udevd/918:
>  #0:  (&mm->mmap_sem){----}, at: [<c161135b>] do_page_fault+0x150/0x50d
> 
> But udevd/918 is nowhere in the sysrq-t output.

also below is a softlockup-debug patch that might be useful, which adds 
a tick/tock output so it spams the console once per second but can show 
the dynamics of lockups (and other delays).

	Ingo

------------------->
Subject: [patch] softlockup: add /proc/sys/kernel/softlockup_print_tick
From: Ingo Molnar <mingo@elte.hu>

/proc/sys/kernel/softlockup_print_tick tunable:

 0: off
 1: print tick/tock messages in softlockup irq and task.
 2: also print stack dump

Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
 Documentation/kernel-parameters.txt |    5 +++++
 include/linux/sched.h               |    2 ++
 kernel/softlockup.c                 |   13 ++++++++++++-
 kernel/sysctl.c                     |   10 ++++++++++
 4 files changed, 29 insertions(+), 1 deletion(-)

Index: linux/Documentation/kernel-parameters.txt
===================================================================
--- linux.orig/Documentation/kernel-parameters.txt
+++ linux/Documentation/kernel-parameters.txt
@@ -1659,6 +1659,11 @@ and is between 256 and 4096 characters. 
 
 	snd-ymfpci=	[HW,ALSA]
 
+	softlockup_print_tick
+			[KNL] Print softlockup tick in the irq and in the
+			watchdog task. If value 2 then print stackdump too.
+			Format: <0/1/2>
+
 	sonycd535=	[HW,CD]
 			Format: <io>[,<irq>]
 
Index: linux/include/linux/sched.h
===================================================================
--- linux.orig/include/linux/sched.h
+++ linux/include/linux/sched.h
@@ -223,6 +223,8 @@ extern void update_process_times(int use
 extern void scheduler_tick(void);
 
 #ifdef CONFIG_DETECT_SOFTLOCKUP
+extern int softlockup_print_tick;
+
 extern void softlockup_tick(void);
 extern void spawn_softlockup_task(void);
 extern void touch_softlockup_watchdog(void);
Index: linux/kernel/softlockup.c
===================================================================
--- linux.orig/kernel/softlockup.c
+++ linux/kernel/softlockup.c
@@ -21,6 +21,7 @@ static DEFINE_PER_CPU(unsigned long, pri
 static DEFINE_PER_CPU(struct task_struct *, watchdog_task);
 
 static int did_panic = 0;
+int softlockup_print_tick = 2;
 
 static int
 softlock_panic(struct notifier_block *this, unsigned long event, void *ptr)
@@ -62,8 +63,15 @@ void softlockup_tick(void)
 	}
 
 	/* Wake up the high-prio watchdog task every second: */
-	if (time_after(jiffies, touch_timestamp + HZ))
+	if (time_after(jiffies, touch_timestamp + HZ)) {
+		if (softlockup_print_tick) {
+			printk("softlockup tick on CPU#%d, %s:%d\n",
+				this_cpu, current->comm, current->pid);
+			if (softlockup_print_tick == 2)
+				dump_stack();
+		}
 		wake_up_process(per_cpu(watchdog_task, this_cpu));
+	}
 
 	/* Warn about unreasonable 10+ seconds delays: */
 	if (time_after(jiffies, touch_timestamp + 10*HZ)) {
@@ -83,6 +91,7 @@ void softlockup_tick(void)
 static int watchdog(void * __bind_cpu)
 {
 	struct sched_param param = { .sched_priority = 99 };
+	int this_cpu = (int)(long)__bind_cpu;
 
 	sched_setscheduler(current, SCHED_FIFO, &param);
 	current->flags |= PF_NOFREEZE;
@@ -96,6 +105,8 @@ static int watchdog(void * __bind_cpu)
 		set_current_state(TASK_INTERRUPTIBLE);
 		touch_softlockup_watchdog();
 		schedule();
+		if (softlockup_print_tick)
+			printk("softlockup tock on CPU#%d\n", this_cpu);
 	}
 
 	return 0;
Index: linux/kernel/sysctl.c
===================================================================
--- linux.orig/kernel/sysctl.c
+++ linux/kernel/sysctl.c
@@ -231,6 +231,16 @@ static ctl_table kern_table[] = {
 		.proc_handler	= &proc_dostring,
 		.strategy	= &sysctl_string,
 	},
+#ifdef CONFIG_DETECT_SOFTLOCKUP
+	{
+		.ctl_name	= CTL_UNNUMBERED,
+		.procname	= "softlockup_print_tick",
+		.data		= &softlockup_print_tick,
+		.maxlen		= sizeof(int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec,
+	},
+#endif
 #ifdef CONFIG_PROC_SYSCTL
 	{
 		.ctl_name	= KERN_TAINTED,

  reply	other threads:[~2007-03-05 10:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-03 23:31 2.6.21-rc2-git3 soft lockup detected on CPU#0 (crash dump kernel) Michal Piotrowski
2007-03-04 14:23 ` Thomas Gleixner
2007-03-04 14:36   ` Michal Piotrowski
2007-03-04 15:37     ` Thomas Gleixner
2007-03-04 16:28       ` Michal Piotrowski
2007-03-04 16:40         ` Thomas Gleixner
2007-03-04 16:47           ` Michal Piotrowski
2007-03-04 17:03             ` Thomas Gleixner
2007-03-04 17:15               ` Michal Piotrowski
2007-03-04 17:44                 ` Thomas Gleixner
2007-03-05  8:08                 ` Ingo Molnar
2007-03-05 10:34                   ` Thomas Gleixner
2007-03-05 10:31                     ` Ingo Molnar [this message]
2007-03-05 11:47                       ` Michal Piotrowski
2007-03-05 11:51                         ` Ingo Molnar
2007-03-05 12:04                           ` Michal Piotrowski
2007-03-05 12:21                             ` Michal Piotrowski
2007-03-05 12:17                               ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070305103141.GA18404@elte.hu \
    --to=mingo@elte.hu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.k.k.piotrowski@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.