From: Nathan Zimmer Date: Wed, 20 Feb 2013 02:13:49 +0000 (+1100) Subject: sched-proc-sched_stat-fails-on-very-very-large-machines-v2 X-Git-Tag: next-20130220~1^2~622 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c3e55783c52e9ee4a1045d1d7c1ce01f258c5bff;p=karo-tx-linux.git sched-proc-sched_stat-fails-on-very-very-large-machines-v2 v2: Took Andrew's suggestion to add comments, fix memleak Signed-off-by: Nathan Zimmer Cc: Ingo Molnar Cc: Peter Zijlstra Cc: Dave Jones Signed-off-by: Andrew Morton --- diff --git a/kernel/sched/stats.c b/kernel/sched/stats.c index 7eecdc7bb775..80226cc1798c 100644 --- a/kernel/sched/stats.c +++ b/kernel/sched/stats.c @@ -81,6 +81,13 @@ static int show_schedstat(struct seq_file *seq, void *v) return 0; } +/* + * This itererator needs some explination. + * It returns 1 for the header position. + * This means 2 is cpu 0. + * In a hotplugged system some cpus, including cpu 0, may be missing so we have + * to use cpumask_* to iterate over the cpus. + */ static void *schedstat_start(struct seq_file *file, loff_t *offset) { unsigned long n = *offset;