hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/include/linux/vtime.h
....@@ -83,46 +83,36 @@
8383 #endif
8484
8585 #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
+}
8992 extern void vtime_flush(struct task_struct *tsk);
9093 #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) { }
9496 static inline void vtime_flush(struct task_struct *tsk) { }
9597 #endif
9698
9799
98100 #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);
100102 #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) { }
102104 #endif
103105
104
-static inline void account_softirq_enter(struct task_struct *tsk)
106
+static inline void account_irq_enter_time(struct task_struct *tsk)
105107 {
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);
108110 }
109111
110
-static inline void account_softirq_exit(struct task_struct *tsk)
112
+static inline void account_irq_exit_time(struct task_struct *tsk)
111113 {
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);
126116 }
127117
128118 #endif /* _LINUX_KERNEL_VTIME_H */