FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Crash Utility

 
 
LinkBack Thread Tools
 
Old 04-26-2010, 01:40 PM
Michael Holzheu
 
Default Use only tasks on online CPUs for bt -a

Hello Dave,

Currently for "bt -a" also swapper tasks on offline CPUs are printed
(at least on s390). Wouldn't it be better to only print a backtrace,
when the task is running on an online CPU?

My suggestion would be to implement that with the following patch
by only setting the panic threads for online CPUs. I also attached a
second alternative patch that fills the active set array only with
tasks on online CPUs.

What do you think?

Michael
---
task.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

--- a/task.c
+++ b/task.c
@@ -5658,8 +5658,12 @@ populate_panic_threads(void)
struct task_context *tc;

if (get_active_set()) {
- for (i = 0; i < NR_CPUS; i++)
- tt->panic_threads[i] = tt->active_set[i];
+ for (i = 0; i < NR_CPUS; i++) {
+ if (kt->cpu_flags[i] & ONLINE)
+ tt->panic_threads[i] = tt->active_set[i];
+ else
+ tt->panic_threads[i] = 0;
+ }
return;
}
--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 04-26-2010, 02:29 PM
Dave Anderson
 
Default Use only tasks on online CPUs for bt -a

----- "Michael Holzheu" <holzheu@linux.vnet.ibm.com> wrote:

> Hello Dave,
>
> Currently for "bt -a" also swapper tasks on offline CPUs are printed
> (at least on s390). Wouldn't it be better to only print a backtrace,
> when the task is running on an online CPU?
>
> My suggestion would be to implement that with the following patch
> by only setting the panic threads for online CPUs. I also attached a
> second alternative patch that fills the active set array only with
> tasks on online CPUs.
>
> What do you think?
>
> Michael

I'd prefer not to leave them out of the various internal task arrays,
especially the active_set[] array. Regardless of their on/offline
status, they do still exist as tasks, have runqueues, etc.

If you're just worried about "bt -a", then why not just catch
the offline status in the for loop inside "if (active)" section
of cmd_bt()? Or just indicate some kind of "OFFLINE" status in
the output?

Dave


> ---
> task.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> --- a/task.c
> +++ b/task.c
> @@ -5658,8 +5658,12 @@ populate_panic_threads(void)
> struct task_context *tc;
>
> if (get_active_set()) {
> - for (i = 0; i < NR_CPUS; i++)
> - tt->panic_threads[i] = tt->active_set[i];
> + for (i = 0; i < NR_CPUS; i++) {
> + if (kt->cpu_flags[i] & ONLINE)
> + tt->panic_threads[i] = tt->active_set[i];
> + else
> + tt->panic_threads[i] = 0;
> + }
> return;
> }
>
> --
> Crash-utility mailing list
> Crash-utility@redhat.com
> https://www.redhat.com/mailman/listinfo/crash-utility

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 04-26-2010, 02:52 PM
Michael Holzheu
 
Default Use only tasks on online CPUs for bt -a

Hello Dave,

On Mon, 2010-04-26 at 10:29 -0400, Dave Anderson wrote:
> I'd prefer not to leave them out of the various internal task arrays,
> especially the active_set[] array. Regardless of their on/offline
> status, they do still exist as tasks, have runqueues, etc.

Ok, fine.

> If you're just worried about "bt -a", then why not just catch
> the offline status in the for loop inside "if (active)" section
> of cmd_bt()?

Good idea! The following attached patch also works for me.

Michael

---
kernel.c | 2 ++
1 file changed, 2 insertions(+)

--- a/kernel.c
+++ b/kernel.c
@@ -1989,6 +1989,8 @@ cmd_bt(void)
free_all_bufs();
continue;
}
+ if (!(kt->cpu_flags[c] & ONLINE))
+ continue;
if ((tc = task_to_context(tt->panic_threads[c]))) {
pc->flags |= IN_FOREACH;
DO_TASK_BACKTRACE();

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 04-26-2010, 03:24 PM
Dave Anderson
 
Default Use only tasks on online CPUs for bt -a

----- "Michael Holzheu" <holzheu@linux.vnet.ibm.com> wrote:

> Hello Dave,
>
> On Mon, 2010-04-26 at 10:29 -0400, Dave Anderson wrote:
> > I'd prefer not to leave them out of the various internal task arrays,
> > especially the active_set[] array. Regardless of their on/offline
> > status, they do still exist as tasks, have runqueues, etc.
>
> Ok, fine.
>
> > If you're just worried about "bt -a", then why not just catch
> > the offline status in the for loop inside "if (active)" section
> > of cmd_bt()?
>
> Good idea! The following attached patch also works for me.
>
> Michael

That looks good -- queued for the next release.

Thanks,
Dave

> ---
> kernel.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> --- a/kernel.c
> +++ b/kernel.c
> @@ -1989,6 +1989,8 @@ cmd_bt(void)
> free_all_bufs();
> continue;
> }
> + if (!(kt->cpu_flags[c] & ONLINE))
> + continue;
> if ((tc = task_to_context(tt->panic_threads[c]))) {
> pc->flags |= IN_FOREACH;
> DO_TASK_BACKTRACE();

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 04-26-2010, 03:56 PM
Dave Anderson
 
Default Use only tasks on online CPUs for bt -a

----- "Dave Anderson" <anderson@redhat.com> wrote:

> ----- "Michael Holzheu" <holzheu@linux.vnet.ibm.com> wrote:
>
> > Hello Dave,
> >
> > On Mon, 2010-04-26 at 10:29 -0400, Dave Anderson wrote:
> > > I'd prefer not to leave them out of the various internal task
> arrays,
> > > especially the active_set[] array. Regardless of their on/offline
> > > status, they do still exist as tasks, have runqueues, etc.
> >
> > Ok, fine.
> >
> > > If you're just worried about "bt -a", then why not just catch
> > > the offline status in the for loop inside "if (active)" section
> > > of cmd_bt()?
> >
> > Good idea! The following attached patch also works for me.
> >
> > Michael
>
> That looks good -- queued for the next release.
>
> Thanks,
> Dave

Sorry -- I take it back. Running a test shows that it breaks "bt -a"
on Xen dumpfiles where the cpus are marked offline prior to dumping
the kernel memory.

I think this should be moved to the processor-specific backtrace functions,
which can just display "OFFLINE" or something to that effect.

Dave







>
> > ---
> > kernel.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > --- a/kernel.c
> > +++ b/kernel.c
> > @@ -1989,6 +1989,8 @@ cmd_bt(void)
> > free_all_bufs();
> > continue;
> > }
> > + if (!(kt->cpu_flags[c] & ONLINE))
> > + continue;
> > if ((tc = task_to_context(tt->panic_threads[c]))) {
> > pc->flags |= IN_FOREACH;
> > DO_TASK_BACKTRACE();

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 04-26-2010, 04:01 PM
Michael Holzheu
 
Default Use only tasks on online CPUs for bt -a

> > Good idea! The following attached patch also works for me.
> >
> > Michael
>
> That looks good -- queued for the next release.

Thanks!

Michael

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 04-26-2010, 05:28 PM
Michael Holzheu
 
Default Use only tasks on online CPUs for bt -a

Hi Dave,

On Mon, 2010-04-26 at 11:56 -0400, Dave Anderson wrote:
> Sorry -- I take it back. Running a test shows that it breaks "bt -a"
> on Xen dumpfiles where the cpus are marked offline prior to dumping
> the kernel memory.
>
> I think this should be moved to the processor-specific backtrace functions,
> which can just display "OFFLINE" or something to that effect.

Ok, fine. What about the following...
---
s390.c | 5 +++++
s390x.c | 5 +++++
2 files changed, 10 insertions(+)

--- a/s390.c
+++ b/s390.c
@@ -603,11 +603,16 @@ s390_back_trace_cmd(struct bt_info *bt)
unsigned long async_start = 0, async_end = 0;
unsigned long panic_start = 0, panic_end = 0;
unsigned long stack_end, stack_start, stack_base;
+ int cpu = bt->tc->processor;

if (bt->hp && bt->hp->eip) {
error(WARNING,
"instruction pointer argument ignored on this architecture!
");
}
+ if (is_task_active(bt->task) && (!(kt->cpu_flags[cpu] & ONLINE))) {
+ fprintf(fp, " CPU offline
");
+ return;
+ }
ksp = bt->stkptr;

/* print lowcore and get async stack when task has cpu */
--- a/s390x.c
+++ b/s390x.c
@@ -836,11 +836,16 @@ s390x_back_trace_cmd(struct bt_info *bt)
unsigned long panic_start = 0, panic_end = 0;
unsigned long stack_end, stack_start, stack_base;
unsigned long r14;
+ int cpu = bt->tc->processor;

if (bt->hp && bt->hp->eip) {
error(WARNING,
"instruction pointer argument ignored on this architecture!
");
}
+ if (is_task_active(bt->task) && (!(kt->cpu_flags[cpu] & ONLINE))) {
+ fprintf(fp, " CPU offline
");
+ return;
+ }
ksp = bt->stkptr;

/* print lowcore and get async stack when task has cpu */

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 
Old 04-26-2010, 05:53 PM
Dave Anderson
 
Default Use only tasks on online CPUs for bt -a

----- "Michael Holzheu" <holzheu@linux.vnet.ibm.com> wrote:

> Hi Dave,
>
> On Mon, 2010-04-26 at 11:56 -0400, Dave Anderson wrote:
> > Sorry -- I take it back. Running a test shows that it breaks "bt -a"
> > on Xen dumpfiles where the cpus are marked offline prior to dumping
> > the kernel memory.
> >
> > I think this should be moved to the processor-specific backtrace functions,
> > which can just display "OFFLINE" or something to that effect.
>
> Ok, fine. What about the following...

That's good -- queued for the next release.

Thanks,
Dave

> ---
> s390.c | 5 +++++
> s390x.c | 5 +++++
> 2 files changed, 10 insertions(+)
>
> --- a/s390.c
> +++ b/s390.c
> @@ -603,11 +603,16 @@ s390_back_trace_cmd(struct bt_info *bt)
> unsigned long async_start = 0, async_end = 0;
> unsigned long panic_start = 0, panic_end = 0;
> unsigned long stack_end, stack_start, stack_base;
> + int cpu = bt->tc->processor;
>
> if (bt->hp && bt->hp->eip) {
> error(WARNING,
> "instruction pointer argument ignored on this architecture!
");
> }
> + if (is_task_active(bt->task) && (!(kt->cpu_flags[cpu] & ONLINE))) {
> + fprintf(fp, " CPU offline
");
> + return;
> + }
> ksp = bt->stkptr;
>
> /* print lowcore and get async stack when task has cpu */
> --- a/s390x.c
> +++ b/s390x.c
> @@ -836,11 +836,16 @@ s390x_back_trace_cmd(struct bt_info *bt)
> unsigned long panic_start = 0, panic_end = 0;
> unsigned long stack_end, stack_start, stack_base;
> unsigned long r14;
> + int cpu = bt->tc->processor;
>
> if (bt->hp && bt->hp->eip) {
> error(WARNING,
> "instruction pointer argument ignored on this
> architecture!
");
> }
> + if (is_task_active(bt->task) && (!(kt->cpu_flags[cpu] & ONLINE))) {
> + fprintf(fp, " CPU offline
");
> + return;
> + }
> ksp = bt->stkptr;
>
> /* print lowcore and get async stack when task has cpu */

--
Crash-utility mailing list
Crash-utility@redhat.com
https://www.redhat.com/mailman/listinfo/crash-utility
 

Thread Tools




All times are GMT. The time now is 08:17 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org