From: "Luck, Tony" <tony.luck@intel.com>
To: linux-kernel@vger.kernel.org
Cc: linux-ia64@vger.kernel.org, Andreas Schwab <schwab@suse.de>
Subject: [PATCH] Drop per-irq counters from /proc/stat (Was: Reading /proc/stat is slooow)
Date: Wed, 07 Dec 2005 19:54:52 +0000 [thread overview]
Message-ID: <20051207195452.GA8873@agluck-lia64.sc.intel.com> (raw)
In-Reply-To: <jeslt6xib3.fsf@sykes.suse.de>
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));
-#endif
+ seq_printf(p, "intr %llu\n", (unsigned long long)sum);
seq_printf(p,
- "\nctxt %llu\n"
+ "ctxt %llu\n"
"btime %lu\n"
"processes %lu\n"
"procs_running %lu\n"
-Tony
next prev parent reply other threads:[~2005-12-07 19:54 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-02 17:42 Reading /proc/stat is slooow Andreas Schwab
2005-12-05 22:21 ` Luck, Tony
2005-12-05 23:36 ` Andreas Schwab
2005-12-05 23:46 ` Andreas Schwab
2005-12-06 0:19 ` Luck, Tony
2005-12-06 1:21 ` Luck, Tony
2005-12-06 6:15 ` Luck, Tony
2005-12-06 9:24 ` Zou, Nanhai
2005-12-06 16:58 ` Luck, Tony
2005-12-06 17:10 ` Andreas Schwab
2005-12-07 19:54 ` Luck, Tony [this message]
2005-12-06 9:57 ` Andreas Schwab
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20051207195452.GA8873@agluck-lia64.sc.intel.com \
--to=tony.luck@intel.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=schwab@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox