mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] print_cfq_rq: per_cpu(xx, 0) may not exist
@ 2010-11-18 10:23 Sonny Rao
  2010-11-18 10:23 ` [PATCH] Fix crash in sym53c8xx_2 error path Sonny Rao
  0 siblings, 1 reply; 2+ messages in thread
From: Sonny Rao @ 2010-11-18 10:23 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sonny Rao, Milton Miller, Ingo Molnar, Peter Zijlstra

Per cpu variables only exist for possible cpus.  On some architectures
and platforms, cpu 0 may not be possible, and this debug code generates
an oops.

As a variable for the boot cpu seems to be architecture dependent, replace
this aparently arbitrary choice of reference for spread of min vruntime
across run queues from that of cpu 0 to that of the first online cpu.

Signed-off-by: Milton Miller <miltonm@bga.com>
Signed-off-by: Sonny Rao <sonnyrao@linux.vnet.ibm.com>
---
 kernel/sched_debug.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/sched_debug.c b/kernel/sched_debug.c
index 2e1b0d1..be586db 100644
--- a/kernel/sched_debug.c
+++ b/kernel/sched_debug.c
@@ -163,7 +163,7 @@ static void task_group_path(struct task_group *tg, char *buf, int buflen)
 void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 {
 	s64 MIN_vruntime = -1, min_vruntime, max_vruntime = -1,
-		spread, rq0_min_vruntime, spread0;
+		spread, spread0;
 	struct rq *rq = cpu_rq(cpu);
 	struct sched_entity *last;
 	unsigned long flags;
@@ -188,7 +188,6 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 	if (last)
 		max_vruntime = last->vruntime;
 	min_vruntime = cfs_rq->min_vruntime;
-	rq0_min_vruntime = cpu_rq(0)->cfs.min_vruntime;
 	raw_spin_unlock_irqrestore(&rq->lock, flags);
 	SEQ_printf(m, "  .%-30s: %Ld.%06ld\n", "MIN_vruntime",
 			SPLIT_NS(MIN_vruntime));
@@ -199,7 +198,8 @@ void print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq)
 	spread = max_vruntime - MIN_vruntime;
 	SEQ_printf(m, "  .%-30s: %Ld.%06ld\n", "spread",
 			SPLIT_NS(spread));
-	spread0 = min_vruntime - rq0_min_vruntime;
+	spread0 = min_vruntime - per_cpu(runqueues,
+			cpumask_first(cpu_online_mask)).cfs.min_vruntime;
 	SEQ_printf(m, "  .%-30s: %Ld.%06ld\n", "spread0",
 			SPLIT_NS(spread0));
 	SEQ_printf(m, "  .%-30s: %ld\n", "nr_running", cfs_rq->nr_running);
-- 
1.5.6.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-18 19:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-18 10:23 [PATCH] print_cfq_rq: per_cpu(xx, 0) may not exist Sonny Rao
2010-11-18 10:23 ` [PATCH] Fix crash in sym53c8xx_2 error path Sonny Rao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®