2006-01-22 20:22:07

by Olaf Hering

[permalink] [raw]
Subject: [PATCH] disable per cpu intr in /proc/stat

(No bugzilla or benchmark)

From: [email protected]
Subject: Reading /proc/stat is slooow

Don't compute and display the per-irq sums on ia64 either, too much
overhead for mostly useless figures.

--- linux-2.6.14/fs/proc/proc_misc.c.~1~ 2005-12-06 18:12:28.840059961 +0100
+++ linux-2.6.14/fs/proc/proc_misc.c 2005-12-06 18:13:51.211896515 +0100
@@ -498,7 +498,7 @@ static int show_stat(struct seq_file *p,
}
seq_printf(p, "intr %llu", (unsigned long long)sum);

-#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA)
+#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64)
for (i = 0; i < NR_IRQS; i++)
seq_printf(p, " %u", kstat_irqs(i));
#endif
--
short story of a lazy sysadmin:
alias appserv=wotan


2006-01-22 20:32:42

by Andrew Morton

[permalink] [raw]
Subject: Re: [PATCH] disable per cpu intr in /proc/stat

Olaf Hering <[email protected]> wrote:
>
> (No bugzilla or benchmark)
>
> From: [email protected]
> Subject: Reading /proc/stat is slooow
>
> Don't compute and display the per-irq sums on ia64 either, too much
> overhead for mostly useless figures.
>
> --- linux-2.6.14/fs/proc/proc_misc.c.~1~ 2005-12-06 18:12:28.840059961 +0100
> +++ linux-2.6.14/fs/proc/proc_misc.c 2005-12-06 18:13:51.211896515 +0100
> @@ -498,7 +498,7 @@ static int show_stat(struct seq_file *p,
> }
> seq_printf(p, "intr %llu", (unsigned long long)sum);
>
> -#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA)
> +#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64)
> for (i = 0; i < NR_IRQS; i++)
> seq_printf(p, " %u", kstat_irqs(i));
> #endif

We'd need a big ack from the ia64 team for this, please.

2006-01-22 20:45:30

by Jesper Juhl

[permalink] [raw]
Subject: Re: [PATCH] disable per cpu intr in /proc/stat

On 1/22/06, Olaf Hering <[email protected]> wrote:
> (No bugzilla or benchmark)
>
> From: [email protected]
> Subject: Reading /proc/stat is slooow
>
> Don't compute and display the per-irq sums on ia64 either, too much
> overhead for mostly useless figures.
>
> --- linux-2.6.14/fs/proc/proc_misc.c.~1~ 2005-12-06 18:12:28.840059961 +0100
> +++ linux-2.6.14/fs/proc/proc_misc.c 2005-12-06 18:13:51.211896515 +0100
> @@ -498,7 +498,7 @@ static int show_stat(struct seq_file *p,
> }
> seq_printf(p, "intr %llu", (unsigned long long)sum);
>
> -#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA)
> +#if !defined(CONFIG_PPC64) && !defined(CONFIG_ALPHA) && !defined(CONFIG_IA64)
> for (i = 0; i < NR_IRQS; i++)
> seq_printf(p, " %u", kstat_irqs(i));
> #endif

Hmm, this changes userspace visible data... should we be doing that?

--
Jesper Juhl <[email protected]>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html

2006-01-22 21:06:00

by Luck, Tony

[permalink] [raw]
Subject: Re: [PATCH] disable per cpu intr in /proc/stat

On 1/22/06, Andrew Morton <[email protected]> wrote:
> Olaf Hering <[email protected]> wrote:
> > Don't compute and display the per-irq sums on ia64 either, too much
> > overhead for mostly useless figures.
>
> We'd need a big ack from the ia64 team for this, please.

This was found early in December. I proposed:
http://marc.theaimsgroup.com/?l=linux-kernel&m=113398553428807&w=2
dropping it for all architectures, but got no response.

The problem is the horribly cache unfriendly scan of all percpu
structures ... not too much of a problem for low cpu count, but
really bad when the count gets high (just configured high is
enough to cause the problem in a CONFIG_HOTPLUG_CPU
kernel ... even if the cpu isn't present we still scan).

An alternative if someone really is using these values would be
to compute the sums earlier in the function ... but that would
require a memory allocation to save the per-irq sums.

Unless someone comes up soon with the name of an existing
application that depends on these per-irq sums, consider this

Acked-by: Tony Luck <[email protected]>

-Tony

2006-01-23 00:10:06

by Albert Cahalan

[permalink] [raw]
Subject: Re: [PATCH] disable per cpu intr in /proc/stat

While ripping this out may break things, leaving it in has
been breaking things as well. That line just keeps growing.
Many times, I have found that my buffer was too small to
read that file. (shall I make it a megabyte or what?)

Looking around a bit, I can only find use of the first number.
(so don't remove that)

I suggest removing the excess values for all architectures.
It's in /proc/interrupts anyway.

If some architectures will keep the data, then please limit
the data to the original 16 PC-AT interrupts and #if it like so:

#if defined(CONFIG_X86) && defined(CONFIG_ISA)
for (i = 0; i < 16; i++) /* only the 16 legacy ones */
seq_printf(p, " %u", kstat_irqs(i));
#endif

Those 16 are the only ones you can hope to identify
without looking in /proc/interrupts anyway.