.. | .. |
---|
83 | 83 | #endif |
---|
84 | 84 | |
---|
85 | 85 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE |
---|
86 | | -extern void vtime_account_irq(struct task_struct *tsk, unsigned int offset); |
---|
87 | | -extern void vtime_account_softirq(struct task_struct *tsk); |
---|
88 | | -extern void vtime_account_hardirq(struct task_struct *tsk); |
---|
| 86 | +extern void vtime_account_irq_enter(struct task_struct *tsk); |
---|
| 87 | +static inline void vtime_account_irq_exit(struct task_struct *tsk) |
---|
| 88 | +{ |
---|
| 89 | + /* On hard|softirq exit we always account to hard|softirq cputime */ |
---|
| 90 | + vtime_account_kernel(tsk); |
---|
| 91 | +} |
---|
89 | 92 | extern void vtime_flush(struct task_struct *tsk); |
---|
90 | 93 | #else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ |
---|
91 | | -static inline void vtime_account_irq(struct task_struct *tsk, unsigned int offset) { } |
---|
92 | | -static inline void vtime_account_softirq(struct task_struct *tsk) { } |
---|
93 | | -static inline void vtime_account_hardirq(struct task_struct *tsk) { } |
---|
| 94 | +static inline void vtime_account_irq_enter(struct task_struct *tsk) { } |
---|
| 95 | +static inline void vtime_account_irq_exit(struct task_struct *tsk) { } |
---|
94 | 96 | static inline void vtime_flush(struct task_struct *tsk) { } |
---|
95 | 97 | #endif |
---|
96 | 98 | |
---|
97 | 99 | |
---|
98 | 100 | #ifdef CONFIG_IRQ_TIME_ACCOUNTING |
---|
99 | | -extern void irqtime_account_irq(struct task_struct *tsk, unsigned int offset); |
---|
| 101 | +extern void irqtime_account_irq(struct task_struct *tsk); |
---|
100 | 102 | #else |
---|
101 | | -static inline void irqtime_account_irq(struct task_struct *tsk, unsigned int offset) { } |
---|
| 103 | +static inline void irqtime_account_irq(struct task_struct *tsk) { } |
---|
102 | 104 | #endif |
---|
103 | 105 | |
---|
104 | | -static inline void account_softirq_enter(struct task_struct *tsk) |
---|
| 106 | +static inline void account_irq_enter_time(struct task_struct *tsk) |
---|
105 | 107 | { |
---|
106 | | - vtime_account_irq(tsk, SOFTIRQ_OFFSET); |
---|
107 | | - irqtime_account_irq(tsk, SOFTIRQ_OFFSET); |
---|
| 108 | + vtime_account_irq_enter(tsk); |
---|
| 109 | + irqtime_account_irq(tsk); |
---|
108 | 110 | } |
---|
109 | 111 | |
---|
110 | | -static inline void account_softirq_exit(struct task_struct *tsk) |
---|
| 112 | +static inline void account_irq_exit_time(struct task_struct *tsk) |
---|
111 | 113 | { |
---|
112 | | - vtime_account_softirq(tsk); |
---|
113 | | - irqtime_account_irq(tsk, 0); |
---|
114 | | -} |
---|
115 | | - |
---|
116 | | -static inline void account_hardirq_enter(struct task_struct *tsk) |
---|
117 | | -{ |
---|
118 | | - vtime_account_irq(tsk, HARDIRQ_OFFSET); |
---|
119 | | - irqtime_account_irq(tsk, HARDIRQ_OFFSET); |
---|
120 | | -} |
---|
121 | | - |
---|
122 | | -static inline void account_hardirq_exit(struct task_struct *tsk) |
---|
123 | | -{ |
---|
124 | | - vtime_account_hardirq(tsk); |
---|
125 | | - irqtime_account_irq(tsk, 0); |
---|
| 114 | + vtime_account_irq_exit(tsk); |
---|
| 115 | + irqtime_account_irq(tsk); |
---|
126 | 116 | } |
---|
127 | 117 | |
---|
128 | 118 | #endif /* _LINUX_KERNEL_VTIME_H */ |
---|