Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Crash Utility (http://www.linux-archive.org/crash-utility/)
-   -   CFS runqueue loop detection (http://www.linux-archive.org/crash-utility/627894-cfs-runqueue-loop-detection.html)

David Mair 02-01-2012 07:56 PM

CFS runqueue loop detection
 
Here is a patch against crash v6.0.2 that adds duplicate node detection
per-CPU for the CFS runqueue display in dump_CFS_runqueues() for the
runq command.

This resolves the failure to bail-out of the unending looping display I
get with the crash dump I have that has a corrupted CFS runqueue
containing a loop.

Signed-off-by: David Mair <dmair@suse.com>
---

task.c | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/task.c b/task.c
index 433a043..0333fe8 100755
--- a/task.c
+++ b/task.c
@@ -7050,7 +7050,12 @@ dump_tasks_in_cfs_rq(ulong cfs_rq, ulong skip)
OFFSET(sched_entity_run_node));
if (!tc)
continue;
- dump_task_runq_entry(tc);
+ if (hq_enter((ulong)tc)) {
+ dump_task_runq_entry(tc);
+ } else {
+ error(WARNING, "Duplicate CFS runqueue node, task %lx, probable
loop
", tc->task);
+ return total;
+ }
total++;
}

@@ -7217,10 +7222,12 @@ dump_CFS_runqueues(void)
fprintf(fp, " CFS RB_ROOT: %lx
", (ulong)root);

tot = 0;
+ hq_open();
if (curr_cfs_rq)
tot += dump_tasks_in_cfs_rq(curr_cfs_rq, 0);
if (cfs_rq != curr_cfs_rq)
tot += dump_tasks_in_cfs_rq(cfs_rq, curr_cfs_rq);
+ hq_close();
if (!tot) {
INDENT(5);
fprintf(fp, "[no tasks queued]
");

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

Dave Anderson 02-01-2012 08:18 PM

CFS runqueue loop detection
 
----- Original Message -----
> Here is a patch against crash v6.0.2 that adds duplicate node detection
> per-CPU for the CFS runqueue display in dump_CFS_runqueues() for the
> runq command.
>
> This resolves the failure to bail-out of the unending looping display I
> get with the crash dump I have that has a corrupted CFS runqueue
> containing a loop.
>
> Signed-off-by: David Mair <dmair@suse.com>
> ---

That was quick!

I'm going to have to re-work this patch slightly because of the queued
changes for crash-6.0.3 that are based upon Daisuke's runq patch:

[Crash-utility] [PATCH] runq: search current task's runqueue explicitly
https://www.redhat.com/archives/crash-utility/2012-January/msg00009.html

I'm going to try to get a release out in the next day or two.

Thanks,
Dave


>
> task.c | 9 ++++++++-
> 1 files changed, 8 insertions(+), 1 deletions(-)
>
> diff --git a/task.c b/task.c
> index 433a043..0333fe8 100755
> --- a/task.c
> +++ b/task.c
> @@ -7050,7 +7050,12 @@ dump_tasks_in_cfs_rq(ulong cfs_rq, ulong skip)
> OFFSET(sched_entity_run_node));
> if (!tc)
> continue;
> - dump_task_runq_entry(tc);
> + if (hq_enter((ulong)tc)) {
> + dump_task_runq_entry(tc);
> + } else {
> + error(WARNING, "Duplicate CFS runqueue node, task %lx, probable
> loop
", tc->task);
> + return total;
> + }
> total++;
> }
>
> @@ -7217,10 +7222,12 @@ dump_CFS_runqueues(void)
> fprintf(fp, " CFS RB_ROOT: %lx
", (ulong)root);
>
> tot = 0;
> + hq_open();
> if (curr_cfs_rq)
> tot += dump_tasks_in_cfs_rq(curr_cfs_rq, 0);
> if (cfs_rq != curr_cfs_rq)
> tot += dump_tasks_in_cfs_rq(cfs_rq, curr_cfs_rq);
> + hq_close();
> if (!tot) {
> INDENT(5);
> fprintf(fp, "[no tasks queued]
");
>
> --
> 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


All times are GMT. The time now is 06:34 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.