public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] x86_64: Avoid too many remote cpu references due to /proc/stat
@ 2007-07-13  0:06 Ravikiran G Thirumalai
  2007-07-13  0:09 ` [patch] " Ravikiran G Thirumalai
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Ravikiran G Thirumalai @ 2007-07-13  0:06 UTC (permalink / raw)
  To: Andi Kleen; +Cc: Andrew Morton, linux-kernel, Shai Fultheim (Shai@scalex86.org)

Too many remote cpu references due to /proc/stat.

On x86_64, with newer kernel versions, kstat_irqs is a bit of a problem.
On every call to kstat_irqs, the process brings in per-cpu data from all
online cpus.  Doing this for NR_IRQS, which is now 256 + 32 * NR_CPUS
results in (256+32*63) * 63 remote cpu references on a 64 cpu config.
/proc/stat is parsed by common commands like top, who etc, causing
lots of cacheline transfers

This statistic seems useless. Other 'big iron' arches disable this.
Can we disable computing/reporting this statistic?  This piece of
statistic is not human readable on x86_64 anymore,

If not, can we optimize computing this statistic so as to avoid
too many remote references (patch to follow)

Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>

Index: linux-2.6.22/fs/proc/proc_misc.c
===================================================================
--- linux-2.6.22.orig/fs/proc/proc_misc.c	2007-07-12 16:31:02.000000000 -0700
+++ linux-2.6.22/fs/proc/proc_misc.c	2007-07-12 16:33:45.226221759 -0700
@@ -498,7 +498,8 @@ static int show_stat(struct seq_file *p,
 	}
 	seq_printf(p, "intr %llu", (unsigned long long)sum);
 
-#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64)
+#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64) \
+					&& !defined(CONFIG_X86_64)
 	for (i = 0; i < NR_IRQS; i++)
 		seq_printf(p, " %u", kstat_irqs(i));
 #endif

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

end of thread, other threads:[~2007-07-13 10:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-13  0:06 [patch] x86_64: Avoid too many remote cpu references due to /proc/stat Ravikiran G Thirumalai
2007-07-13  0:09 ` [patch] " Ravikiran G Thirumalai
2007-07-13  2:13 ` [patch] x86_64: " Andrew Morton
2007-07-13  6:50   ` Ravikiran G Thirumalai
2007-07-13 10:03 ` Christoph Hellwig

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