From: Stephen Rothwell <hidden> Date: 2013-02-08 03:08:01
Hi Frederic,
On Mon, 28 Jan 2013 20:04:01 +0100 Frederic Weisbecker [off-list ref] wrote:
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 <redacted>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Li Zhong <redacted>
Cc: Namhyung Kim <redacted>
Cc: Paul E. McKenney <redacted>
Cc: Paul Gortmaker <redacted>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Thomas Gleixner <redacted>
This patch has the side effect of changing the default configurations:
(This is PowerPC pseries_defconfig before/after this patch)
@@ -119,8 +120,8 @@ # # CPU/Task time and stats accounting #-# CONFIG_TICK_CPU_ACCOUNTING is not set-CONFIG_VIRT_CPU_ACCOUNTING=y+CONFIG_TICK_CPU_ACCOUNTING=y+# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y
I don't know if that was deliberate, but it was suprising. I noticed
when this patch entered next-20130207.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
From: Stephen Rothwell <hidden> Date: 2013-02-08 03:14:50
Hi Frederic,
On Fri, 8 Feb 2013 14:07:49 +1100 Stephen Rothwell [off-list ref] wrote:
quoted hunk
This patch has the side effect of changing the default configurations:
(This is PowerPC pseries_defconfig before/after this patch)
@@ -119,8 +120,8 @@ # # CPU/Task time and stats accounting #-# CONFIG_TICK_CPU_ACCOUNTING is not set-CONFIG_VIRT_CPU_ACCOUNTING=y+CONFIG_TICK_CPU_ACCOUNTING=y+# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y
I don't know if that was deliberate, but it was suprising. I noticed
when this patch entered next-20130207.
I suspect that this is caused by the changes to init/Kconfig:
@@ -326,6 +326,9 @@ source "kernel/time/Kconfig"menu"CPU/Task time and stats accounting"+configVIRT_CPU_ACCOUNTING+bool+choiceprompt"Cputime accounting"defaultTICK_CPU_ACCOUNTINGif!PPC64
The next line of context is:
default VIRT_CPU_ACCOUNTING if PPC64
Which may have needed changing as well? Indeed, changing that to
VIRT_CPU_ACCOUNTING_NATIVE restores the old defaults.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
@@ -301,7 +301,7 @@ config VIRT_CPU_ACCOUNTINGchoiceprompt"Cputime accounting"defaultTICK_CPU_ACCOUNTINGif!PPC64-defaultVIRT_CPU_ACCOUNTINGifPPC64+defaultVIRT_CPU_ACCOUNTING_NATIVEifPPC64# Kind of a stub config for the pure tick based cputime accountingconfigTICK_CPU_ACCOUNTING
--
1.8.1
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
@@ -332,7 +332,7 @@ config VIRT_CPU_ACCOUNTINGchoiceprompt"Cputime accounting"defaultTICK_CPU_ACCOUNTINGif!PPC64-defaultVIRT_CPU_ACCOUNTINGifPPC64+defaultVIRT_CPU_ACCOUNTING_NATIVEifPPC64# Kind of a stub config for the pure tick based cputime accountingconfigTICK_CPU_ACCOUNTING
Hi Frederic,
On Fri, 8 Feb 2013 14:07:49 +1100 Stephen Rothwell [off-list ref] wrote:
quoted
This patch has the side effect of changing the default configurations:
(This is PowerPC pseries_defconfig before/after this patch)
@@ -119,8 +120,8 @@ # # CPU/Task time and stats accounting #-# CONFIG_TICK_CPU_ACCOUNTING is not set-CONFIG_VIRT_CPU_ACCOUNTING=y+CONFIG_TICK_CPU_ACCOUNTING=y+# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_TASKSTATS=y CONFIG_TASK_DELAY_ACCT=y
I don't know if that was deliberate, but it was suprising. I noticed
when this patch entered next-20130207.
I suspect that this is caused by the changes to init/Kconfig:
@@ -326,6 +326,9 @@ source "kernel/time/Kconfig"menu"CPU/Task time and stats accounting"+configVIRT_CPU_ACCOUNTING+bool+choiceprompt"Cputime accounting"defaultTICK_CPU_ACCOUNTINGif!PPC64
The next line of context is:
default VIRT_CPU_ACCOUNTING if PPC64
Which may have needed changing as well? Indeed, changing that to
VIRT_CPU_ACCOUNTING_NATIVE restores the old defaults.