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 /include/asm-ia64/system.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 'include/asm-ia64/system.h')
-rw-r--r-- | include/asm-ia64/system.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 595112bca3cc..dff8128fa58e 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h | |||
@@ -210,6 +210,13 @@ struct task_struct; | |||
210 | extern void ia64_save_extra (struct task_struct *task); | 210 | extern void ia64_save_extra (struct task_struct *task); |
211 | extern void ia64_load_extra (struct task_struct *task); | 211 | extern void ia64_load_extra (struct task_struct *task); |
212 | 212 | ||
213 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
214 | extern void ia64_account_on_switch (struct task_struct *prev, struct task_struct *next); | ||
215 | # define IA64_ACCOUNT_ON_SWITCH(p,n) ia64_account_on_switch(p,n) | ||
216 | #else | ||
217 | # define IA64_ACCOUNT_ON_SWITCH(p,n) | ||
218 | #endif | ||
219 | |||
213 | #ifdef CONFIG_PERFMON | 220 | #ifdef CONFIG_PERFMON |
214 | DECLARE_PER_CPU(unsigned long, pfm_syst_info); | 221 | DECLARE_PER_CPU(unsigned long, pfm_syst_info); |
215 | # define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1) | 222 | # define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1) |
@@ -222,6 +229,7 @@ extern void ia64_load_extra (struct task_struct *task); | |||
222 | || IS_IA32_PROCESS(task_pt_regs(t)) || PERFMON_IS_SYSWIDE()) | 229 | || IS_IA32_PROCESS(task_pt_regs(t)) || PERFMON_IS_SYSWIDE()) |
223 | 230 | ||
224 | #define __switch_to(prev,next,last) do { \ | 231 | #define __switch_to(prev,next,last) do { \ |
232 | IA64_ACCOUNT_ON_SWITCH(prev, next); \ | ||
225 | if (IA64_HAS_EXTRA_STATE(prev)) \ | 233 | if (IA64_HAS_EXTRA_STATE(prev)) \ |
226 | ia64_save_extra(prev); \ | 234 | ia64_save_extra(prev); \ |
227 | if (IA64_HAS_EXTRA_STATE(next)) \ | 235 | if (IA64_HAS_EXTRA_STATE(next)) \ |
@@ -266,6 +274,10 @@ void cpu_idle_wait(void); | |||
266 | 274 | ||
267 | void default_idle(void); | 275 | void default_idle(void); |
268 | 276 | ||
277 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
278 | extern void account_system_vtime(struct task_struct *); | ||
279 | #endif | ||
280 | |||
269 | #endif /* __KERNEL__ */ | 281 | #endif /* __KERNEL__ */ |
270 | 282 | ||
271 | #endif /* __ASSEMBLY__ */ | 283 | #endif /* __ASSEMBLY__ */ |