diff options
-rw-r--r-- | include/linux/vtime.h | 18 | ||||
-rw-r--r-- | kernel/sched/cputime.c | 4 |
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); | |||
8 | extern void __vtime_account_system(struct task_struct *tsk); | 8 | extern void __vtime_account_system(struct task_struct *tsk); |
9 | extern void vtime_account_system(struct task_struct *tsk); | 9 | extern void vtime_account_system(struct task_struct *tsk); |
10 | extern void __vtime_account_idle(struct task_struct *tsk); | 10 | extern void __vtime_account_idle(struct task_struct *tsk); |
11 | extern void vtime_account(struct task_struct *tsk); | ||
11 | #else | 12 | #else |
12 | static inline void vtime_task_switch(struct task_struct *prev) { } | 13 | static inline void vtime_task_switch(struct task_struct *prev) { } |
14 | static inline void __vtime_account_system(struct task_struct *tsk) { } | ||
13 | static inline void vtime_account_system(struct task_struct *tsk) { } | 15 | static inline void vtime_account_system(struct task_struct *tsk) { } |
16 | static 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 |
17 | static inline void vtime_account(struct task_struct *tsk) | 20 | extern void irqtime_account_irq(struct task_struct *tsk); |
18 | { | ||
19 | } | ||
20 | #else | 21 | #else |
21 | extern void vtime_account(struct task_struct *tsk); | 22 | static inline void irqtime_account_irq(struct task_struct *tsk) { } |
22 | #endif | 23 | #endif |
23 | 24 | ||
24 | static inline void vtime_account_irq_enter(struct task_struct *tsk) | 25 | static 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 | ||
38 | static inline void vtime_account_irq_exit(struct task_struct *tsk) | 40 | static 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 | */ |
46 | void vtime_account(struct task_struct *curr) | 46 | void 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 | } |
76 | EXPORT_SYMBOL_GPL(vtime_account); | 76 | EXPORT_SYMBOL_GPL(irqtime_account_irq); |
77 | 77 | ||
78 | static int irqtime_account_hi_update(void) | 78 | static int irqtime_account_hi_update(void) |
79 | { | 79 | { |