Skip to contentSkip to conversation

ia64: VIRT_CPU_ACCOUNTING (accurate cpu time accounting)

PATCH In review Hidetoshi Seto 1 participant 1 message Oct 16, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 6/9 ia64: VIRT_CPU_ACCOUNTING (accurate cpu time accounting)

Quoted 1 line

[6/9] ia64_acct_gate_on_switch.patch

Well, let's begin building check points.

We have already get hook points by account_system_vtime(), so we have points at:

- irq_enter
- irq_exit
- softirq entrance
- softirq exit

and the rests are points at:

- context switch
- kernel entrance
- kernel exit

Start from first one.

This patch just create a hook point at context switch and make a function for the point. The inside of this function is written in last patch.

Thanks,
H.Seto

---
 arch/ia64/kernel/time.c   |    5 +++++
 include/asm-ia64/system.h |    8 ++++++++
 2 files changed, 13 insertions(+)

Index: linux-2.6.23/arch/ia64/kernel/time.c =================================--- linux-2.6.23.orig/arch/ia64/kernel/time.c +++ linux-2.6.23/arch/ia64/kernel/time.c
@@ -64,6 +64,11 @@
#include <linux/kernel_stat.h>
#include <linux/posix-timers.h>

+void ia64_account_on_switch(struct task_struct *prev, struct task_struct *next) +{
+
+}
+
/*
* Account time for a transition between system, hard irq
* or soft irq state.
Index: linux-2.6.23/include/asm-ia64/system.h =================================--- linux-2.6.23.orig/include/asm-ia64/system.h +++ linux-2.6.23/include/asm-ia64/system.h
@@ -208,6 +208,13 @@
extern void ia64_save_extra (struct task_struct *task);
extern void ia64_load_extra (struct task_struct *task);

+#ifdef CONFIG_VIRT_CPU_ACCOUNTING
+extern void ia64_account_on_switch (struct task_struct *prev, struct task_struct *next); +# define IA64_ACCOUNT_ON_SWITCH(p,n) ia64_account_on_switch(p,n)
+#else
+# define IA64_ACCOUNT_ON_SWITCH(p,n)
+#endif
+
#ifdef CONFIG_PERFMON
DECLARE_PER_CPU(unsigned long, pfm_syst_info);

 # define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1)
@@ -220,6 +227,7 @@
 	 || IS_IA32_PROCESS(task_pt_regs(t)) || PERFMON_IS_SYSWIDE())

#define __switch_to(prev,next,last) do { \
+ IA64_ACCOUNT_ON_SWITCH(prev, next); \
if (IA64_HAS_EXTRA_STATE(prev)) \
ia64_save_extra(prev); \
if (IA64_HAS_EXTRA_STATE(next)) \