[PATCH] Drop per-irq counters from /proc/stat (Was: Reading /proc/stat is slooow)

From: Luck, Tony <tony.luck_at_intel.com>
Date: 2005-12-08 06:54:52
On Tue, Dec 06, 2005 at 06:10:40PM +0100, Andreas Schwab wrote:
> "Luck, Tony" <tony.luck@intel.com> writes:
> > 2) The problem loop is already #ifdef'd out for PPC64 and ALPHA.  We could add
> > IA64 to that exclusive club and just not include the per irq sums.  Since kstat_irqs()
> > computes the sums in an "int", they will wrap frequently on a large system
> > (512 cpus * default 250Hz = 128000 ... which wraps a 32-bit unsigned in 9 hours
> > and 19 minutes) ... so their usefulness is questionable.  Does xosview use
> > the per-irq values?
> It doesn't use them, it uses /proc/interrupts instead.  So IMHO this would
> be the preferred solution.

Anyone know of any applications that *DO* depend on the per-irq counters
in /proc/stat?

I could just add IA64 to the ugly #ifdef:

-#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA)
+#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64)

But perhaps it might be simpler to skip straight to this:

[PATCH] Drop per-irq counters from /proc/stat

It is very expensive to produce the per-irq counter values in /proc/stat
(the code does a very cache unfriendly walk across all percpu structures
for each irq).  Some architectures (PPC64, ALPHA) don't provide this
information in this file.  Applications which do want this can derive it
by adding the percpu values in /proc/interrupts.

Signed-off-by: Tony Luck <tony.luck@intel.com>


diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 5b6b0b6..64d96bf 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -396,15 +396,10 @@ static int show_stat(struct seq_file *p,
 			(unsigned long long)cputime64_to_clock_t(softirq),
 			(unsigned long long)cputime64_to_clock_t(steal));
-	seq_printf(p, "intr %llu", (unsigned long long)sum);
-#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA)
-	for (i = 0; i < NR_IRQS; i++)
-		seq_printf(p, " %u", kstat_irqs(i));
+	seq_printf(p, "intr %llu\n", (unsigned long long)sum);
-		"\nctxt %llu\n"
+		"ctxt %llu\n"
 		"btime %lu\n"
 		"processes %lu\n"
 		"procs_running %lu\n"

To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Dec 08 06:55:30 2005

This archive was generated by hypermail 2.1.8 : 2005-12-08 06:55:37 EST