From 6778948f9de86c3cfaf36725a7c87dcff9ba247f Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Mon, 11 Dec 2023 08:20:59 +0000 Subject: [PATCH] kernel_5.10 no rt --- kernel/include/linux/vtime.h | 42 ++++++++++++++++-------------------------- 1 files changed, 16 insertions(+), 26 deletions(-) diff --git a/kernel/include/linux/vtime.h b/kernel/include/linux/vtime.h index 041d652..2cdeca0 100644 --- a/kernel/include/linux/vtime.h +++ b/kernel/include/linux/vtime.h @@ -83,46 +83,36 @@ #endif #ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE -extern void vtime_account_irq(struct task_struct *tsk, unsigned int offset); -extern void vtime_account_softirq(struct task_struct *tsk); -extern void vtime_account_hardirq(struct task_struct *tsk); +extern void vtime_account_irq_enter(struct task_struct *tsk); +static inline void vtime_account_irq_exit(struct task_struct *tsk) +{ + /* On hard|softirq exit we always account to hard|softirq cputime */ + vtime_account_kernel(tsk); +} extern void vtime_flush(struct task_struct *tsk); #else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */ -static inline void vtime_account_irq(struct task_struct *tsk, unsigned int offset) { } -static inline void vtime_account_softirq(struct task_struct *tsk) { } -static inline void vtime_account_hardirq(struct task_struct *tsk) { } +static inline void vtime_account_irq_enter(struct task_struct *tsk) { } +static inline void vtime_account_irq_exit(struct task_struct *tsk) { } static inline void vtime_flush(struct task_struct *tsk) { } #endif #ifdef CONFIG_IRQ_TIME_ACCOUNTING -extern void irqtime_account_irq(struct task_struct *tsk, unsigned int offset); +extern void irqtime_account_irq(struct task_struct *tsk); #else -static inline void irqtime_account_irq(struct task_struct *tsk, unsigned int offset) { } +static inline void irqtime_account_irq(struct task_struct *tsk) { } #endif -static inline void account_softirq_enter(struct task_struct *tsk) +static inline void account_irq_enter_time(struct task_struct *tsk) { - vtime_account_irq(tsk, SOFTIRQ_OFFSET); - irqtime_account_irq(tsk, SOFTIRQ_OFFSET); + vtime_account_irq_enter(tsk); + irqtime_account_irq(tsk); } -static inline void account_softirq_exit(struct task_struct *tsk) +static inline void account_irq_exit_time(struct task_struct *tsk) { - vtime_account_softirq(tsk); - irqtime_account_irq(tsk, 0); -} - -static inline void account_hardirq_enter(struct task_struct *tsk) -{ - vtime_account_irq(tsk, HARDIRQ_OFFSET); - irqtime_account_irq(tsk, HARDIRQ_OFFSET); -} - -static inline void account_hardirq_exit(struct task_struct *tsk) -{ - vtime_account_hardirq(tsk); - irqtime_account_irq(tsk, 0); + vtime_account_irq_exit(tsk); + irqtime_account_irq(tsk); } #endif /* _LINUX_KERNEL_VTIME_H */ -- Gitblit v1.6.2