public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Larry Woodman <lwoodman@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Rik van Riel <riel@surriel.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -mm] extend sysrq-p functionality to cover all CPUs
Date: Mon, 10 Mar 2008 09:58:06 -0500	[thread overview]
Message-ID: <47D54C7E.3010304@redhat.com> (raw)
In-Reply-To: <20080309224759.6fead9af.akpm@linux-foundation.org>

Andrew Morton wrote:

>On Sun, 9 Mar 2008 22:14:58 -0400 Rik van Riel <riel@surriel.com> wrote:
>
>  
>
>>SysRP-P is not all that useful on SMP systems, since the sysrq
>>irq rarely ends up on the CPU that we actually want to investigate.
>>
>>This patch extends sysrq-p to print a backtrace for every CPU,
>>not just the lucky one that gets the sysrq irq.  With this patch,
>>"echo p > /proc/sysrq-trigger" does something useful.
>>
>>Signed-off-by: Rik van Riel <riel@redhat.com>
>>
>>diff -up linux-2.6.25-rc3-mm1/drivers/char/sysrq.c.multicpu linux-2.6.25-rc3-mm1/drivers/char/sysrq.c
>>--- linux-2.6.25-rc3-mm1/drivers/char/sysrq.c.multicpu	2008-03-09 20:22:17.000000000 -0400
>>+++ linux-2.6.25-rc3-mm1/drivers/char/sysrq.c	2008-03-09 21:54:02.000000000 -0400
>>@@ -196,11 +196,29 @@ static struct sysrq_key_op sysrq_showloc
>> #define sysrq_showlocks_op (*(struct sysrq_key_op *)0)
>> #endif
>> 
>>+static DEFINE_SPINLOCK(show_lock);
>>+static void showacpu(void *dummy)
>>+{
>>+	struct pt_regs *regs = get_irq_regs();
>>+
>>+	spin_lock(&show_lock);
>>+	printk("CPU%d:\n", smp_processor_id());
>>+	show_stack(NULL, NULL);
>>+	spin_unlock(&show_lock);
>>+}
>>+static void sysrq_showregs_othercpus(struct work_struct *dummy)
>>+{
>>+	smp_call_function(showacpu, NULL, 0, 0);
>>+}
>>+static DECLARE_WORK(sysrq_showregs, sysrq_showregs_othercpus);
>> static void sysrq_handle_showregs(int key, struct tty_struct *tty)
>> {
>> 	struct pt_regs *regs = get_irq_regs();
>>-	if (regs)
>>+	if (regs) {
>>+		printk("CPU%d:\n", smp_processor_id());
>> 		show_regs(regs);
>>+	}
>>+	schedule_work(&sysrq_showregs);
>> }
>> static struct sysrq_key_op sysrq_showregs_op = {
>> 	.handler	= sysrq_handle_showregs,
>>    
>>
>
>Doesn't everyone have a copy of this somewhere? ;)
>

Yes, but we use W instead of P.  Dont you want to keep the old AlsSysrq 
P and add
a new SPM version using a defferent letter ?

Larry

>
>However it does have the downside that info can scroll away on large cpu
>counts.  Maybe it should be a new sysrq command?
>
>  
>



      parent reply	other threads:[~2008-03-10 15:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-10  2:14 [PATCH -mm] extend sysrq-p functionality to cover all CPUs Rik van Riel
2008-03-10  5:47 ` Andrew Morton
2008-03-10 13:30   ` Rik van Riel
2008-03-10 16:24     ` Andrew Morton
2008-03-10 17:03       ` Rik van Riel
2008-03-10 14:58   ` Larry Woodman [this message]

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=47D54C7E.3010304@redhat.com \
    --to=lwoodman@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=riel@surriel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox