Skip to content

Commit

Permalink
cputime: Make finegrained irqtime accounting generally available
Browse files Browse the repository at this point in the history
There is no known reason for this option to be unavailable on other
archs than x86. They just need to call enable_sched_clock_irqtime()
if they have a sufficiently finegrained clock to make it working.

Move it to the general option and let the user choose between
it and pure tick based or virtual cputime accounting.

Note that virtual cputime accounting already performs a finegrained
irqtime accounting. CONFIG_IRQ_TIME_ACCOUNTING is a kind of middle ground
between tick and virtual based accounting. So CONFIG_IRQ_TIME_ACCOUNTING
and CONFIG_VIRT_CPU_ACCOUNTING are mutually exclusive choices.

Signed-off-by: Frederic Weisbecker <[email protected]>
Cc: Tony Luck <[email protected]>
Cc: Fenghua Yu <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Martin Schwidefsky <[email protected]>
Cc: Heiko Carstens <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Peter Zijlstra <[email protected]>
  • Loading branch information
fweisbec committed Sep 25, 2012
1 parent 391dc69 commit fdf9c35
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 12 deletions.
6 changes: 6 additions & 0 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -284,4 +284,10 @@ config SECCOMP_FILTER
config HAVE_VIRT_CPU_ACCOUNTING
bool

config HAVE_IRQ_TIME_ACCOUNTING
bool
help
Archs need to ensure they use a high enough resolution clock to
support irq time accounting and then call enable_sched_clock_irqtime().

source "kernel/gcov/Kconfig"
12 changes: 1 addition & 11 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ config X86
select KTIME_SCALAR if X86_32
select GENERIC_STRNCPY_FROM_USER
select GENERIC_STRNLEN_USER
select HAVE_IRQ_TIME_ACCOUNTING

config INSTRUCTION_DECODER
def_bool (KPROBES || PERF_EVENTS || UPROBES)
Expand Down Expand Up @@ -796,17 +797,6 @@ config SCHED_MC
making when dealing with multi-core CPU chips at a cost of slightly
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"

config X86_UP_APIC
Expand Down
30 changes: 29 additions & 1 deletion init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,25 @@ source "kernel/time/Kconfig"

menu "CPU/Task time and stats accounting"

choice
prompt "Cputime accounting"
default TICK_CPU_ACCOUNTING if !PPC64
default VIRT_CPU_ACCOUNTING if PPC64

# Kind of a stub config for the pure tick based cputime accounting
config TICK_CPU_ACCOUNTING
bool "Simple tick based cputime accounting"
depends on !S390
help
This is the basic tick based cputime accounting that maintains
statistics about user, system and idle time spent on per jiffies
granularity.

If unsure, say Y.

config VIRT_CPU_ACCOUNTING
bool "Deterministic task and CPU time accounting"
depends on HAVE_VIRT_CPU_ACCOUNTING
default y if PPC64
help
Select this option to enable more accurate task and CPU time
accounting. This is done by reading a CPU counter on each
Expand All @@ -339,6 +354,19 @@ config VIRT_CPU_ACCOUNTING
this also enables accounting of stolen time on logically-partitioned
systems.

config IRQ_TIME_ACCOUNTING
bool "Fine granularity task level IRQ time accounting"
depends on HAVE_IRQ_TIME_ACCOUNTING
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.

endchoice

config BSD_PROCESS_ACCT
bool "BSD Process Accounting"
help
Expand Down

0 comments on commit fdf9c35

Please sign in to comment.