提交 e82b8e4e 编写于 作者: V Venkatesh Pallipadi 提交者: Ingo Molnar

x86: Add IRQ_TIME_ACCOUNTING

This patch adds IRQ_TIME_ACCOUNTING option on x86 and runtime enables it
when TSC is enabled.

This change just enables fine grained irq time accounting, isn't used yet.
Following patches use it for different purposes.
Signed-off-by: NVenkatesh Pallipadi <venki@google.com>
Signed-off-by: NPeter Zijlstra <a.p.zijlstra@chello.nl>
LKML-Reference: <1286237003-12406-6-git-send-email-venki@google.com>
Signed-off-by: NIngo Molnar <mingo@elte.hu>
上级 b52bfee4
...@@ -2435,6 +2435,10 @@ and is between 256 and 4096 characters. It is defined in the file ...@@ -2435,6 +2435,10 @@ and is between 256 and 4096 characters. It is defined in the file
disables clocksource verification at runtime. disables clocksource verification at runtime.
Used to enable high-resolution timer mode on older Used to enable high-resolution timer mode on older
hardware, and in virtualized environment. hardware, and in virtualized environment.
[x86] noirqtime: Do not use TSC to do irq accounting.
Used to run time disable IRQ_TIME_ACCOUNTING on any
platforms where RDTSC is slow and this accounting
can add overhead.
turbografx.map[2|3]= [HW,JOY] turbografx.map[2|3]= [HW,JOY]
TurboGraFX parallel port interface TurboGraFX parallel port interface
......
...@@ -795,6 +795,17 @@ config SCHED_MC ...@@ -795,6 +795,17 @@ config SCHED_MC
making when dealing with multi-core CPU chips at a cost of slightly making when dealing with multi-core CPU chips at a cost of slightly
increased overhead in some places. If unsure say N here. increased overhead in some places. If unsure say N here.
config IRQ_TIME_ACCOUNTING
bool "Fine granularity task level IRQ time accounting"
default n
---help---
Select this option to enable fine granularity task irq time
accounting. This is done by reading a timestamp on each
transitions between softirq and hardirq state, so there can be a
small performance impact.
If in doubt, say N here.
source "kernel/Kconfig.preempt" source "kernel/Kconfig.preempt"
config X86_UP_APIC config X86_UP_APIC
......
...@@ -104,10 +104,14 @@ int __init notsc_setup(char *str) ...@@ -104,10 +104,14 @@ int __init notsc_setup(char *str)
__setup("notsc", notsc_setup); __setup("notsc", notsc_setup);
static int no_sched_irq_time;
static int __init tsc_setup(char *str) static int __init tsc_setup(char *str)
{ {
if (!strcmp(str, "reliable")) if (!strcmp(str, "reliable"))
tsc_clocksource_reliable = 1; tsc_clocksource_reliable = 1;
if (!strncmp(str, "noirqtime", 9))
no_sched_irq_time = 1;
return 1; return 1;
} }
...@@ -801,6 +805,7 @@ void mark_tsc_unstable(char *reason) ...@@ -801,6 +805,7 @@ void mark_tsc_unstable(char *reason)
if (!tsc_unstable) { if (!tsc_unstable) {
tsc_unstable = 1; tsc_unstable = 1;
sched_clock_stable = 0; sched_clock_stable = 0;
disable_sched_clock_irqtime();
printk(KERN_INFO "Marking TSC unstable due to %s\n", reason); printk(KERN_INFO "Marking TSC unstable due to %s\n", reason);
/* Change only the rating, when not registered */ /* Change only the rating, when not registered */
if (clocksource_tsc.mult) if (clocksource_tsc.mult)
...@@ -987,6 +992,9 @@ void __init tsc_init(void) ...@@ -987,6 +992,9 @@ void __init tsc_init(void)
/* now allow native_sched_clock() to use rdtsc */ /* now allow native_sched_clock() to use rdtsc */
tsc_disabled = 0; tsc_disabled = 0;
if (!no_sched_irq_time)
enable_sched_clock_irqtime();
lpj = ((u64)tsc_khz * 1000); lpj = ((u64)tsc_khz * 1000);
do_div(lpj, HZ); do_div(lpj, HZ);
lpj_fine = lpj; lpj_fine = lpj;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册