* [PATCH RESEND] x86_dump_trace: avoiding endless " <IRQ> " is printed
@ 2012-08-27 1:56 Liu, Chuansheng
2012-08-27 15:49 ` Gross, Mark
0 siblings, 1 reply; 3+ messages in thread
From: Liu, Chuansheng @ 2012-08-27 1:56 UTC (permalink / raw)
To: 'linux-kernel@vger.kernel.org' (linux-kernel@vger.kernel.org)
Cc: hpa, Gross, Mark, alan
From: liu chuansheng <chuansheng.liu@intel.com>
Subject: [PATCH] x86_dump_trace: avoiding endless " <IRQ> " is printed
Found the case that endless " <IRQ> " printing in dump_trace,
and no real meaningful stack traces are output, so there should
be one rare case that possibly context->previous_esp = context or
other cases.
The endless " <IRQ> " is as below:
...
[ 82.215244,0] <IRQ>
[ 82.215399,0] <IRQ>
[ 82.215554,0] <IRQ>
[ 82.215710,0] <IRQ>
[ 82.215865,0] <IRQ>
[ 82.216022,0] <IRQ>
[ 82.216178,0] <IRQ>
[ 82.216333,0] <IRQ>
[ 82.216488,0] <IRQ>
[ 82.216643,0] <IRQ>
[ 82.216798,0] <IRQ>
[ 82.216953,0] <IRQ>
...
This patch aim is:
1/ Limiting the " <IRQ> " outputing, currently the max IRQ contexts
is 2(softirq+harirq combination);
2/ When the max IRQ contexts 2 is reached, print the context content
to confirm;
Change-Id: I6d72aa71c4c5ff8f9e6ae133b3f6bfec8887750d
Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
---
arch/x86/kernel/dumpstack_32.c | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/dumpstack_32.c b/arch/x86/kernel/dumpstack_32.c
index 1038a41..410fa38 100644
--- a/arch/x86/kernel/dumpstack_32.c
+++ b/arch/x86/kernel/dumpstack_32.c
@@ -22,6 +22,7 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
const struct stacktrace_ops *ops, void *data)
{
int graph = 0;
+ int dump_irq_count = 0;
if (!task)
task = current;
@@ -47,8 +48,18 @@ void dump_trace(struct task_struct *task, struct pt_regs *regs,
stack = (unsigned long *)context->previous_esp;
if (!stack)
break;
+
+ if (dump_irq_count > 2) {
+ pr_warn("break multi-IRQ print,"
+ "context=%p, stack=%p\n",
+ context,
+ stack);
+ break;
+ }
+
if (ops->stack(data, "IRQ") < 0)
break;
+ dump_irq_count++;
touch_nmi_watchdog();
}
}
--
1.7.0.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [PATCH RESEND] x86_dump_trace: avoiding endless " <IRQ> " is printed
2012-08-27 1:56 [PATCH RESEND] x86_dump_trace: avoiding endless " <IRQ> " is printed Liu, Chuansheng
@ 2012-08-27 15:49 ` Gross, Mark
2012-08-27 23:47 ` Liu, Chuansheng
0 siblings, 1 reply; 3+ messages in thread
From: Gross, Mark @ 2012-08-27 15:49 UTC (permalink / raw)
To: Liu, Chuansheng,
'linux-kernel@vger.kernel.org'
(linux-kernel@vger.kernel.org)
Cc: hpa, alan, Pan, Jacob jun
Do you think we should add the same change to dumpstack_64.c too.
Looks like you addressed Alan's comments already (i.e. use of unlikely not needed, us %p, and use pr_warn instead of printk)
--mark
> -----Original Message-----
> From: Liu, Chuansheng
> Sent: Sunday, August 26, 2012 6:56 PM
> To: 'linux-kernel@vger.kernel.org' (linux-kernel@vger.kernel.org)
> Cc: hpa@linux.intel.com; Gross, Mark; alan@linux.intel.com
> Subject: [PATCH RESEND] x86_dump_trace: avoiding endless " <IRQ> " is
> printed
>
> From: liu chuansheng <chuansheng.liu@intel.com>
> Subject: [PATCH] x86_dump_trace: avoiding endless " <IRQ> " is printed
>
> Found the case that endless " <IRQ> " printing in dump_trace, and no real
> meaningful stack traces are output, so there should be one rare case that
> possibly context->previous_esp = context or other cases.
>
> The endless " <IRQ> " is as below:
> ...
> [ 82.215244,0] <IRQ>
> [ 82.215399,0] <IRQ>
> [ 82.215554,0] <IRQ>
> [ 82.215710,0] <IRQ>
> [ 82.215865,0] <IRQ>
> [ 82.216022,0] <IRQ>
> [ 82.216178,0] <IRQ>
> [ 82.216333,0] <IRQ>
> [ 82.216488,0] <IRQ>
> [ 82.216643,0] <IRQ>
> [ 82.216798,0] <IRQ>
> [ 82.216953,0] <IRQ>
> ...
>
> This patch aim is:
> 1/ Limiting the " <IRQ> " outputing, currently the max IRQ contexts is
> 2(softirq+harirq combination); 2/ When the max IRQ contexts 2 is reached,
> print the context content to confirm;
>
> Change-Id: I6d72aa71c4c5ff8f9e6ae133b3f6bfec8887750d
> Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
> ---
> arch/x86/kernel/dumpstack_32.c | 11 +++++++++++
> 1 files changed, 11 insertions(+), 0 deletions(-)
>
> diff --git a/arch/x86/kernel/dumpstack_32.c
> b/arch/x86/kernel/dumpstack_32.c index 1038a41..410fa38 100644
> --- a/arch/x86/kernel/dumpstack_32.c
> +++ b/arch/x86/kernel/dumpstack_32.c
> @@ -22,6 +22,7 @@ void dump_trace(struct task_struct *task, struct pt_regs
> *regs,
> const struct stacktrace_ops *ops, void *data) {
> int graph = 0;
> + int dump_irq_count = 0;
>
> if (!task)
> task = current;
> @@ -47,8 +48,18 @@ void dump_trace(struct task_struct *task, struct
> pt_regs *regs,
> stack = (unsigned long *)context->previous_esp;
> if (!stack)
> break;
> +
> + if (dump_irq_count > 2) {
> + pr_warn("break multi-IRQ print,"
> + "context=%p, stack=%p\n",
> + context,
> + stack);
> + break;
> + }
> +
> if (ops->stack(data, "IRQ") < 0)
> break;
> + dump_irq_count++;
> touch_nmi_watchdog();
> }
> }
> --
> 1.7.0.4
^ permalink raw reply [flat|nested] 3+ messages in thread
* RE: [PATCH RESEND] x86_dump_trace: avoiding endless " <IRQ> " is printed
2012-08-27 15:49 ` Gross, Mark
@ 2012-08-27 23:47 ` Liu, Chuansheng
0 siblings, 0 replies; 3+ messages in thread
From: Liu, Chuansheng @ 2012-08-27 23:47 UTC (permalink / raw)
To: Gross, Mark,
'linux-kernel@vger.kernel.org'
(linux-kernel@vger.kernel.org)
Cc: hpa, alan, Pan, Jacob jun
> Do you think we should add the same change to dumpstack_64.c too.
Feels dumpstack_64.c has different with dumpstack_32 which just has three types stacks for normal thread, hardirq and softirq,
so just want to use this patch to cover x86_32 case and it is the real case I meet also, thanks.
> -----Original Message-----
> From: Gross, Mark
> Sent: Monday, August 27, 2012 11:50 PM
> To: Liu, Chuansheng; 'linux-kernel@vger.kernel.org'
> (linux-kernel@vger.kernel.org)
> Cc: hpa@linux.intel.com; alan@linux.intel.com; Pan, Jacob jun
> Subject: RE: [PATCH RESEND] x86_dump_trace: avoiding endless " <IRQ> " is
> printed
>
> Do you think we should add the same change to dumpstack_64.c too.
>
> Looks like you addressed Alan's comments already (i.e. use of unlikely not
> needed, us %p, and use pr_warn instead of printk)
>
> --mark
>
> > -----Original Message-----
> > From: Liu, Chuansheng
> > Sent: Sunday, August 26, 2012 6:56 PM
> > To: 'linux-kernel@vger.kernel.org' (linux-kernel@vger.kernel.org)
> > Cc: hpa@linux.intel.com; Gross, Mark; alan@linux.intel.com
> > Subject: [PATCH RESEND] x86_dump_trace: avoiding endless " <IRQ> " is
> > printed
> >
> > From: liu chuansheng <chuansheng.liu@intel.com>
> > Subject: [PATCH] x86_dump_trace: avoiding endless " <IRQ> " is printed
> >
> > Found the case that endless " <IRQ> " printing in dump_trace, and no
> > real meaningful stack traces are output, so there should be one rare
> > case that possibly context->previous_esp = context or other cases.
> >
> > The endless " <IRQ> " is as below:
> > ...
> > [ 82.215244,0] <IRQ>
> > [ 82.215399,0] <IRQ>
> > [ 82.215554,0] <IRQ>
> > [ 82.215710,0] <IRQ>
> > [ 82.215865,0] <IRQ>
> > [ 82.216022,0] <IRQ>
> > [ 82.216178,0] <IRQ>
> > [ 82.216333,0] <IRQ>
> > [ 82.216488,0] <IRQ>
> > [ 82.216643,0] <IRQ>
> > [ 82.216798,0] <IRQ>
> > [ 82.216953,0] <IRQ>
> > ...
> >
> > This patch aim is:
> > 1/ Limiting the " <IRQ> " outputing, currently the max IRQ contexts is
> > 2(softirq+harirq combination); 2/ When the max IRQ contexts 2 is
> > reached, print the context content to confirm;
> >
> > Change-Id: I6d72aa71c4c5ff8f9e6ae133b3f6bfec8887750d
> > Signed-off-by: liu chuansheng <chuansheng.liu@intel.com>
> > ---
> > arch/x86/kernel/dumpstack_32.c | 11 +++++++++++
> > 1 files changed, 11 insertions(+), 0 deletions(-)
> >
> > diff --git a/arch/x86/kernel/dumpstack_32.c
> > b/arch/x86/kernel/dumpstack_32.c index 1038a41..410fa38 100644
> > --- a/arch/x86/kernel/dumpstack_32.c
> > +++ b/arch/x86/kernel/dumpstack_32.c
> > @@ -22,6 +22,7 @@ void dump_trace(struct task_struct *task, struct
> > pt_regs *regs,
> > const struct stacktrace_ops *ops, void *data) {
> > int graph = 0;
> > + int dump_irq_count = 0;
> >
> > if (!task)
> > task = current;
> > @@ -47,8 +48,18 @@ void dump_trace(struct task_struct *task, struct
> > pt_regs *regs,
> > stack = (unsigned long *)context->previous_esp;
> > if (!stack)
> > break;
> > +
> > + if (dump_irq_count > 2) {
> > + pr_warn("break multi-IRQ print,"
> > + "context=%p, stack=%p\n",
> > + context,
> > + stack);
> > + break;
> > + }
> > +
> > if (ops->stack(data, "IRQ") < 0)
> > break;
> > + dump_irq_count++;
> > touch_nmi_watchdog();
> > }
> > }
> > --
> > 1.7.0.4
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-08-27 23:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-27 1:56 [PATCH RESEND] x86_dump_trace: avoiding endless " <IRQ> " is printed Liu, Chuansheng
2012-08-27 15:49 ` Gross, Mark
2012-08-27 23:47 ` Liu, Chuansheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).