aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/vtime.h18
-rw-r--r--kernel/sched/cputime.c4
2 files changed, 10 insertions, 12 deletions
diff --git a/include/linux/vtime.h b/include/linux/vtime.h
index c35c02223da8..0c2a2d303020 100644
--- a/include/linux/vtime.h
+++ b/include/linux/vtime.h
@@ -8,17 +8,18 @@ extern void vtime_task_switch(struct task_struct *prev);
8extern void __vtime_account_system(struct task_struct *tsk); 8extern void __vtime_account_system(struct task_struct *tsk);
9extern void vtime_account_system(struct task_struct *tsk); 9extern void vtime_account_system(struct task_struct *tsk);
10extern void __vtime_account_idle(struct task_struct *tsk); 10extern void __vtime_account_idle(struct task_struct *tsk);
11extern void vtime_account(struct task_struct *tsk);
11#else 12#else
12static inline void vtime_task_switch(struct task_struct *prev) { } 13static inline void vtime_task_switch(struct task_struct *prev) { }
14static inline void __vtime_account_system(struct task_struct *tsk) { }
13static inline void vtime_account_system(struct task_struct *tsk) { } 15static inline void vtime_account_system(struct task_struct *tsk) { }
16static inline void vtime_account(struct task_struct *tsk) { }
14#endif 17#endif
15 18
16#if !defined(CONFIG_VIRT_CPU_ACCOUNTING) && !defined(CONFIG_IRQ_TIME_ACCOUNTING) 19#ifdef CONFIG_IRQ_TIME_ACCOUNTING
17static inline void vtime_account(struct task_struct *tsk) 20extern void irqtime_account_irq(struct task_struct *tsk);
18{
19}
20#else 21#else
21extern void vtime_account(struct task_struct *tsk); 22static inline void irqtime_account_irq(struct task_struct *tsk) { }
22#endif 23#endif
23 24
24static inline void vtime_account_irq_enter(struct task_struct *tsk) 25static inline void vtime_account_irq_enter(struct task_struct *tsk)
@@ -33,17 +34,14 @@ static inline void vtime_account_irq_enter(struct task_struct *tsk)
33 * the idle time is flushed on hardirq time already. 34 * the idle time is flushed on hardirq time already.
34 */ 35 */
35 vtime_account(tsk); 36 vtime_account(tsk);
37 irqtime_account_irq(tsk);
36} 38}
37 39
38static inline void vtime_account_irq_exit(struct task_struct *tsk) 40static inline void vtime_account_irq_exit(struct task_struct *tsk)
39{ 41{
40#ifdef CONFIG_VIRT_CPU_ACCOUNTING
41 /* On hard|softirq exit we always account to hard|softirq cputime */ 42 /* On hard|softirq exit we always account to hard|softirq cputime */
42 __vtime_account_system(tsk); 43 __vtime_account_system(tsk);
43#endif 44 irqtime_account_irq(tsk);
44#ifdef CONFIG_IRQ_TIME_ACCOUNTING
45 vtime_account(tsk);
46#endif
47} 45}
48 46
49#endif /* _LINUX_KERNEL_VTIME_H */ 47#endif /* _LINUX_KERNEL_VTIME_H */
diff --git a/kernel/sched/cputime.c b/kernel/sched/cputime.c
index 0359f47b0ae4..8d859dae5bed 100644
--- a/kernel/sched/cputime.c
+++ b/kernel/sched/cputime.c
@@ -43,7 +43,7 @@ DEFINE_PER_CPU(seqcount_t, irq_time_seq);
43 * Called before incrementing preempt_count on {soft,}irq_enter 43 * Called before incrementing preempt_count on {soft,}irq_enter
44 * and before decrementing preempt_count on {soft,}irq_exit. 44 * and before decrementing preempt_count on {soft,}irq_exit.
45 */ 45 */
46void vtime_account(struct task_struct *curr) 46void irqtime_account_irq(struct task_struct *curr)
47{ 47{
48 unsigned long flags; 48 unsigned long flags;
49 s64 delta; 49 s64 delta;
@@ -73,7 +73,7 @@ void vtime_account(struct task_struct *curr)
73 irq_time_write_end(); 73 irq_time_write_end();
74 local_irq_restore(flags); 74 local_irq_restore(flags);
75} 75}
76EXPORT_SYMBOL_GPL(vtime_account); 76EXPORT_SYMBOL_GPL(irqtime_account_irq);
77 77
78static int irqtime_account_hi_update(void) 78static int irqtime_account_hi_update(void)
79{ 79{