diff options
author | Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> | 2008-01-29 00:27:30 -0500 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-02-20 15:55:37 -0500 |
commit | b64f34cdfe5bef9dfed1304c513220b0f2862eca (patch) | |
tree | 04cb9216a9de18afcb27f9bac3fda1f3c7bacbbd /arch/ia64/kernel/minstate.h | |
parent | 5d9c4a7de64d398604a978d267a6987f1f4025b7 (diff) |
[IA64] VIRT_CPU_ACCOUNTING (accurate cpu time accounting)
This patch implements VIRT_CPU_ACCOUNTING for ia64,
which enable us to use more accurate cpu time accounting.
The VIRT_CPU_ACCOUNTING is an item of kernel config, which s390
and powerpc arch have. By turning this config on, these archs
change the mechanism of cpu time accounting from tick-sampling
based one to state-transition based one.
The state-transition based accounting is done by checking time
(cycle counter in processor) at every state-transition point,
such as entrance/exit of kernel, interrupt, softirq etc.
The difference between point to point is the actual time consumed
during in the state. There is no doubt about that this value is
more accurate than that of tick-sampling based accounting.
Signed-off-by: Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
Diffstat (limited to 'arch/ia64/kernel/minstate.h')
-rw-r--r-- | arch/ia64/kernel/minstate.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/arch/ia64/kernel/minstate.h b/arch/ia64/kernel/minstate.h index c9ac8bada786..7c548ac52bbc 100644 --- a/arch/ia64/kernel/minstate.h +++ b/arch/ia64/kernel/minstate.h | |||
@@ -3,6 +3,18 @@ | |||
3 | 3 | ||
4 | #include "entry.h" | 4 | #include "entry.h" |
5 | 5 | ||
6 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
7 | /* read ar.itc in advance, and use it before leaving bank 0 */ | ||
8 | #define ACCOUNT_GET_STAMP \ | ||
9 | (pUStk) mov.m r20=ar.itc; | ||
10 | #define ACCOUNT_SYS_ENTER \ | ||
11 | (pUStk) br.call.spnt rp=account_sys_enter \ | ||
12 | ;; | ||
13 | #else | ||
14 | #define ACCOUNT_GET_STAMP | ||
15 | #define ACCOUNT_SYS_ENTER | ||
16 | #endif | ||
17 | |||
6 | /* | 18 | /* |
7 | * DO_SAVE_MIN switches to the kernel stacks (if necessary) and saves | 19 | * DO_SAVE_MIN switches to the kernel stacks (if necessary) and saves |
8 | * the minimum state necessary that allows us to turn psr.ic back | 20 | * the minimum state necessary that allows us to turn psr.ic back |
@@ -122,11 +134,13 @@ | |||
122 | ;; \ | 134 | ;; \ |
123 | .mem.offset 0,0; st8.spill [r16]=r2,16; \ | 135 | .mem.offset 0,0; st8.spill [r16]=r2,16; \ |
124 | .mem.offset 8,0; st8.spill [r17]=r3,16; \ | 136 | .mem.offset 8,0; st8.spill [r17]=r3,16; \ |
137 | ACCOUNT_GET_STAMP \ | ||
125 | adds r2=IA64_PT_REGS_R16_OFFSET,r1; \ | 138 | adds r2=IA64_PT_REGS_R16_OFFSET,r1; \ |
126 | ;; \ | 139 | ;; \ |
127 | EXTRA; \ | 140 | EXTRA; \ |
128 | movl r1=__gp; /* establish kernel global pointer */ \ | 141 | movl r1=__gp; /* establish kernel global pointer */ \ |
129 | ;; \ | 142 | ;; \ |
143 | ACCOUNT_SYS_ENTER \ | ||
130 | bsw.1; /* switch back to bank 1 (must be last in insn group) */ \ | 144 | bsw.1; /* switch back to bank 1 (must be last in insn group) */ \ |
131 | ;; | 145 | ;; |
132 | 146 | ||