From: Cyrill Gorcunov <gorcunov@openvz.org>
To: mingo@elte.hu
Cc: x86@kernel.org, yinghai@kernel.org, macro@linux-mips.org,
linux-kernel@vger.kernel.org,
Cyrill Gorcunov <gorcunov@openvz.org>
Subject: [patch 3/3] x86,apic: limit apic dumping, introduce show_lapic setup option
Date: Wed, 14 Oct 2009 00:07:05 +0400 [thread overview]
Message-ID: <20091013201022.926793122@openvz.org> (raw)
In-Reply-To: 20091013200702.019870576@openvz.org
[-- Attachment #1: x86-apic-show-apic-2 --]
[-- Type: text/plain, Size: 3343 bytes --]
In case if a system has a large number of cpus printing apics
contents may consume a long time period.
We limit such an output by 1 apic by default. But to have an
ability to see all apics or some part of them we introduce
"show_lapic" setup option which allow us to limit/unlimit
the number of APICs being dumped.
Example: apic=debug show_lapic=5, or apic=debug show_lapic=all
Also move apic_verbosity checking upper that way so helper routines
do not need to inspect it at all.
Suggested-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org>
---
arch/x86/kernel/apic/io_apic.c | 47 +++++++++++++++++++++++++++--------------
1 file changed, 32 insertions(+), 15 deletions(-)
Index: linux-2.6.git/arch/x86/kernel/apic/io_apic.c
=====================================================================
--- linux-2.6.git.orig/arch/x86/kernel/apic/io_apic.c
+++ linux-2.6.git/arch/x86/kernel/apic/io_apic.c
@@ -1599,9 +1599,6 @@ __apicdebuginit(void) print_IO_APIC(void
struct irq_desc *desc;
unsigned int irq;
- if (apic_verbosity == APIC_QUIET)
- return;
-
printk(KERN_DEBUG "number of MP IRQ sources: %d.\n", mp_irq_entries);
for (i = 0; i < nr_ioapics; i++)
printk(KERN_DEBUG "number of IO-APIC #%d registers: %d.\n",
@@ -1708,9 +1705,6 @@ __apicdebuginit(void) print_APIC_field(i
{
int i;
- if (apic_verbosity == APIC_QUIET)
- return;
-
printk(KERN_DEBUG);
for (i = 0; i < 8; i++)
@@ -1724,9 +1718,6 @@ __apicdebuginit(void) print_local_APIC(v
unsigned int i, v, ver, maxlvt;
u64 icr;
- if (apic_verbosity == APIC_QUIET)
- return;
-
printk(KERN_DEBUG "printing local APIC contents on CPU#%d/%d:\n",
smp_processor_id(), hard_smp_processor_id());
v = apic_read(APIC_ID);
@@ -1824,13 +1815,19 @@ __apicdebuginit(void) print_local_APIC(v
printk("\n");
}
-__apicdebuginit(void) print_all_local_APICs(void)
+__apicdebuginit(void) print_local_APICs(int maxcpu)
{
int cpu;
+ if (!maxcpu)
+ return;
+
preempt_disable();
- for_each_online_cpu(cpu)
+ for_each_online_cpu(cpu) {
+ if (cpu >= maxcpu)
+ break;
smp_call_function_single(cpu, print_local_APIC, NULL, 1);
+ }
preempt_enable();
}
@@ -1839,7 +1836,7 @@ __apicdebuginit(void) print_PIC(void)
unsigned int v;
unsigned long flags;
- if (apic_verbosity == APIC_QUIET || !nr_legacy_irqs)
+ if (!nr_legacy_irqs)
return;
printk(KERN_DEBUG "\nprinting PIC contents\n");
@@ -1866,21 +1863,41 @@ __apicdebuginit(void) print_PIC(void)
printk(KERN_DEBUG "... PIC ELCR: %04x\n", v);
}
-__apicdebuginit(int) print_all_ICs(void)
+static int __initdata show_lapic = 1;
+static __init int setup_show_lapic(char *arg)
+{
+ int num = -1;
+
+ if (strcmp(arg, "all") == 0) {
+ show_lapic = CONFIG_NR_CPUS;
+ } else {
+ get_option(&arg, &num);
+ if (num >= 0)
+ show_lapic = num;
+ }
+
+ return 1;
+}
+__setup("show_lapic=", setup_show_lapic);
+
+__apicdebuginit(int) print_ICs(void)
{
+ if (apic_verbosity == APIC_QUIET)
+ return 0;
+
print_PIC();
/* don't print out if apic is not there */
if (!cpu_has_apic && !apic_from_smp_config())
return 0;
- print_all_local_APICs();
+ print_local_APICs(show_lapic);
print_IO_APIC();
return 0;
}
-fs_initcall(print_all_ICs);
+fs_initcall(print_ICs);
/* Where if anywhere is the i8259 connect in external int mode */
next prev parent reply other threads:[~2009-10-13 20:11 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-13 20:07 [patch 0/3] x86 apic series Cyrill Gorcunov
2009-10-13 20:07 ` [patch 1/3] x86,apic: introduce NOOP apic driver Cyrill Gorcunov
2009-10-14 8:17 ` [tip:x86/apic] x86, apic: Introduce the " tip-bot for Cyrill Gorcunov
2009-10-13 20:07 ` [patch 2/3] x86,apic -- use apic noop driver Cyrill Gorcunov
2009-10-14 8:17 ` [tip:x86/apic] x86, apic: Use " tip-bot for Cyrill Gorcunov
2009-10-13 20:07 ` Cyrill Gorcunov [this message]
2009-10-14 7:12 ` [patch 3/3] x86,apic: limit apic dumping, introduce show_lapic setup option Ingo Molnar
2009-10-14 7:51 ` Cyrill Gorcunov
2009-10-14 15:09 ` Cyrill Gorcunov
2009-10-14 15:40 ` [tip:x86/apic] x86, apic: Explain show_lapic= in kernel parameters list tip-bot for Cyrill Gorcunov
2009-10-14 17:56 ` [patch 3/3] x86,apic: limit apic dumping, introduce show_lapic setup option Ingo Molnar
2009-10-14 18:00 ` Cyrill Gorcunov
2009-10-14 18:20 ` Cyrill Gorcunov
2009-10-14 20:29 ` Cyrill Gorcunov
2009-10-15 14:27 ` Cyrill Gorcunov
2009-10-14 8:17 ` [tip:x86/apic] x86, apic: Limit apic dumping, introduce new show_lapic= " tip-bot for Cyrill Gorcunov
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=20091013201022.926793122@openvz.org \
--to=gorcunov@openvz.org \
--cc=linux-kernel@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=mingo@elte.hu \
--cc=x86@kernel.org \
--cc=yinghai@kernel.org \
/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