summaryrefslogtreecommitdiff
path: root/kernel/time/timer_list.c
diff options
context:
space:
mode:
authorNathan Zimmer <nzimmer@sgi.com>2013-02-20 13:13:46 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2013-02-26 13:41:23 +1100
commitbd8c25b6c6ede0fc5190c6c835e52966886a1785 (patch)
tree482b23b97ec4a9434ae3b0d3439575956161cf49 /kernel/time/timer_list.c
parent9caca24823da2c5a4fc1166c57c8f9618f1bff7c (diff)
timer_list-convert-timer-list-to-be-a-proper-seq_file-v2
v2: Added comments on the iteration. Signed-off-by: Nathan Zimmer <nzimmer@sgi.com> Cc: John Stultz <johnstul@us.ibm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Dave Jones <davej@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'kernel/time/timer_list.c')
-rw-r--r--kernel/time/timer_list.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/kernel/time/timer_list.c b/kernel/time/timer_list.c
index c438d759228d..1098ee4d23c8 100644
--- a/kernel/time/timer_list.c
+++ b/kernel/time/timer_list.c
@@ -274,6 +274,19 @@ static int timer_list_show(struct seq_file *m, void *v)
return 0;
}
+/*
+ * This itererator really needs some explination since it is offset and has
+ * two passes one of which is controlled by a config option.
+ * In a hotplugged system some cpus, including cpu 0, may be missing so we have
+ * to use cpumask_* to iterate over the cpus.
+ * For the first pass:
+ * It returns 1 for the header position.
+ * For cpu 0 it returns 2 and the final possible cpu would be nr_cpu_ids + 1.
+ * On the second pass:
+ * It returnes nr_cpu_ids + 1 for the second header position.
+ * For cpu 0 it returns nr_cpu_ids + 2
+ * The final possible cpu would be nr_cpu_ids + nr_cpu_ids + 2.
+ */
static void *timer_list_start(struct seq_file *file, loff_t *offset)
{
unsigned long n = *offset;