]>
git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blob - include/linux/vtime.h
1 #ifndef _LINUX_KERNEL_VTIME_H
2 #define _LINUX_KERNEL_VTIME_H
6 #ifdef CONFIG_VIRT_CPU_ACCOUNTING
7 extern void vtime_task_switch(struct task_struct
*prev
);
8 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
);
11 extern void vtime_account(struct task_struct
*tsk
);
13 static inline void vtime_task_switch(struct task_struct
*prev
) { }
14 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
) { }
19 #ifdef CONFIG_IRQ_TIME_ACCOUNTING
20 extern void irqtime_account_irq(struct task_struct
*tsk
);
22 static inline void irqtime_account_irq(struct task_struct
*tsk
) { }
25 static inline void vtime_account_irq_enter(struct task_struct
*tsk
)
28 * Hardirq can interrupt idle task anytime. So we need vtime_account()
29 * that performs the idle check in CONFIG_VIRT_CPU_ACCOUNTING.
30 * Softirq can also interrupt idle task directly if it calls
31 * local_bh_enable(). Such case probably don't exist but we never know.
32 * Ksoftirqd is not concerned because idle time is flushed on context
33 * switch. Softirqs in the end of hardirqs are also not a problem because
34 * the idle time is flushed on hardirq time already.
37 irqtime_account_irq(tsk
);
40 static inline void vtime_account_irq_exit(struct task_struct
*tsk
)
42 /* On hard|softirq exit we always account to hard|softirq cputime */
43 __vtime_account_system(tsk
);
44 irqtime_account_irq(tsk
);
47 #endif /* _LINUX_KERNEL_VTIME_H */