|author||Frederic Weisbecker <firstname.lastname@example.org>||2012-07-25 07:56:04 +0200|
|committer||Frederic Weisbecker <email@example.com>||2013-01-27 19:23:27 +0100|
cputime: Generic on-demand virtual cputime accounting
If we want to stop the tick further idle, we need to be able to account the cputime without using the tick. Virtual based cputime accounting solves that problem by hooking into kernel/user boundaries. However implementing CONFIG_VIRT_CPU_ACCOUNTING require low level hooks and involves more overhead. But we already have a generic context tracking subsystem that is required for RCU needs by archs which plan to shut down the tick outside idle. This patch implements a generic virtual based cputime accounting that relies on these generic kernel/user hooks. There are some upsides of doing this: - This requires no arch code to implement CONFIG_VIRT_CPU_ACCOUNTING if context tracking is already built (already necessary for RCU in full tickless mode). - We can rely on the generic context tracking subsystem to dynamically (de)activate the hooks, so that we can switch anytime between virtual and tick based accounting. This way we don't have the overhead of the virtual accounting when the tick is running periodically. And one downside: - There is probably more overhead than a native virtual based cputime accounting. But this relies on hooks that are already set anyway. Signed-off-by: Frederic Weisbecker <firstname.lastname@example.org> Cc: Andrew Morton <email@example.com> Cc: Ingo Molnar <firstname.lastname@example.org> Cc: Li Zhong <email@example.com> Cc: Namhyung Kim <firstname.lastname@example.org> Cc: Paul E. McKenney <email@example.com> Cc: Paul Gortmaker <firstname.lastname@example.org> Cc: Peter Zijlstra <email@example.com> Cc: Steven Rostedt <firstname.lastname@example.org> Cc: Thomas Gleixner <email@example.com>
Diffstat (limited to 'init')
1 files changed, 22 insertions, 1 deletions
diff --git a/init/Kconfig b/init/Kconfig
index be8b7f55312..a05f843e7e5 100644
@@ -326,6 +326,9 @@ source "kernel/time/Kconfig"
menu "CPU/Task time and stats accounting"
prompt "Cputime accounting"
default TICK_CPU_ACCOUNTING if !PPC64
@@ -342,9 +345,10 @@ config TICK_CPU_ACCOUNTING
If unsure, say Y.
bool "Deterministic task and CPU time accounting"
depends on HAVE_VIRT_CPU_ACCOUNTING
+ select VIRT_CPU_ACCOUNTING
Select this option to enable more accurate task and CPU time
accounting. This is done by reading a CPU counter on each
@@ -354,6 +358,23 @@ config VIRT_CPU_ACCOUNTING
this also enables accounting of stolen time on logically-partitioned
+ bool "Full dynticks CPU time accounting"
+ depends on HAVE_CONTEXT_TRACKING && 64BIT
+ select VIRT_CPU_ACCOUNTING
+ select CONTEXT_TRACKING
+ Select this option to enable task and CPU time accounting on full
+ dynticks systems. This accounting is implemented by watching every
+ kernel-user boundaries using the context tracking subsystem.
+ The accounting is thus performed at the expense of some significant
+ For now this is only useful if you are working on the full
+ dynticks subsystem development.
+ If unsure, say N.
bool "Fine granularity task level IRQ time accounting"
depends on HAVE_IRQ_TIME_ACCOUNTING