Re: [PATCH] sched: reduce /proc/schedstat access times

From: Ingo Molnar
Date: Fri Feb 03 2012 - 02:52:54 EST



* Eric Dumazet <eric.dumazet@xxxxxxxxx> wrote:

> On a 16 cpus NUMA machine, we can have quite a long /proc/schedstat
>
> # wc -c /proc/schedstat
> 8355 /proc/schedstat

Btw., the long-term goal would be to make the schedstats info
fully available via perf and integrate it into 'perf sched' - or
'perf stat --sched' or 'perf schedstat' (whichever variant suits
the person who first implements it).

> @@ -47,9 +43,9 @@ static int show_schedstat(struct seq_file *seq, void *v)
> for_each_domain(cpu, sd) {
> enum cpu_idle_type itype;
>
> - cpumask_scnprintf(mask_str, mask_len,
> - sched_domain_span(sd));
> - seq_printf(seq, "domain%d %s", dcount++, mask_str);
> + seq_printf(seq, "domain%d ", dcount++);
> + seq_bitmap(seq, cpumask_bits(sched_domain_span(sd)),
> + nr_cpumask_bits);
> for (itype = CPU_IDLE; itype < CPU_MAX_IDLE_TYPES;
> itype++) {
> seq_printf(seq, " %u %u %u %u %u %u %u %u",

that way, via perf, all information gets passed in a binary
fashion through the perf ring-buffer, so there's no formatting
overhead (only during post-processing), no restart artifacts due
to seqfile limitations, etc.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/