Skip to content

Commit b41c723

Browse files
sean-jcKAGA-KOKO
authored andcommitted
sched/vtime: Move vtime accounting external declarations above inlines
Move the blob of external declarations (and their stubs) above the set of inline definitions (and their stubs) for vtime accounting. This will allow a future patch to bring in more inline definitions without also having to shuffle large chunks of code. No functional change intended. Signed-off-by: Sean Christopherson <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Christian Borntraeger <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 1604571 commit b41c723

File tree

1 file changed

+37
-37
lines changed

1 file changed

+37
-37
lines changed

include/linux/vtime.h

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,43 @@
1010

1111
struct task_struct;
1212

13+
/*
14+
* Common vtime APIs
15+
*/
16+
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
17+
extern void vtime_account_kernel(struct task_struct *tsk);
18+
extern void vtime_account_idle(struct task_struct *tsk);
19+
#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
20+
static inline void vtime_account_kernel(struct task_struct *tsk) { }
21+
#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
22+
23+
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
24+
extern void arch_vtime_task_switch(struct task_struct *tsk);
25+
extern void vtime_user_enter(struct task_struct *tsk);
26+
extern void vtime_user_exit(struct task_struct *tsk);
27+
extern void vtime_guest_enter(struct task_struct *tsk);
28+
extern void vtime_guest_exit(struct task_struct *tsk);
29+
extern void vtime_init_idle(struct task_struct *tsk, int cpu);
30+
#else /* !CONFIG_VIRT_CPU_ACCOUNTING_GEN */
31+
static inline void vtime_user_enter(struct task_struct *tsk) { }
32+
static inline void vtime_user_exit(struct task_struct *tsk) { }
33+
static inline void vtime_guest_enter(struct task_struct *tsk) { }
34+
static inline void vtime_guest_exit(struct task_struct *tsk) { }
35+
static inline void vtime_init_idle(struct task_struct *tsk, int cpu) { }
36+
#endif
37+
38+
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_NATIVE
39+
extern void vtime_account_irq(struct task_struct *tsk, unsigned int offset);
40+
extern void vtime_account_softirq(struct task_struct *tsk);
41+
extern void vtime_account_hardirq(struct task_struct *tsk);
42+
extern void vtime_flush(struct task_struct *tsk);
43+
#else /* !CONFIG_VIRT_CPU_ACCOUNTING_NATIVE */
44+
static inline void vtime_account_irq(struct task_struct *tsk, unsigned int offset) { }
45+
static inline void vtime_account_softirq(struct task_struct *tsk) { }
46+
static inline void vtime_account_hardirq(struct task_struct *tsk) { }
47+
static inline void vtime_flush(struct task_struct *tsk) { }
48+
#endif
49+
1350
/*
1451
* vtime_accounting_enabled_this_cpu() definitions/declarations
1552
*/
@@ -57,43 +94,6 @@ static inline void vtime_task_switch(struct task_struct *prev) { }
5794

5895
#endif
5996

60-
/*
61-
* Common vtime APIs
62-
*/
63-
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
64-
extern void vtime_account_kernel(struct task_struct *tsk);
65-
extern void vtime_account_idle(struct task_struct *tsk);
66-
#else /* !CONFIG_VIRT_CPU_ACCOUNTING */
67-
static inline void vtime_account_kernel(struct task_struct *tsk) { }
68-
#endif /* !CONFIG_VIRT_CPU_ACCOUNTING */
69-
70-
#ifdef CONFIG_VIRT_CPU_ACCOUNTING_GEN
71-
extern void arch_vtime_task_switch(struct task_struct *tsk);
72-
extern void vtime_user_enter(struct task_struct *tsk);
73-
extern void vtime_user_exit(struct task_struct *tsk);
74-
extern void vtime_guest_enter(struct task_struct *tsk);
75-
extern void vtime_guest_exit(struct task_struct *tsk);
76-
extern void vtime_init_idle(struct task_struct *tsk, int cpu);
77-
#else /* !CONFIG_VIRT_CPU_ACCOUNTING_GEN */
78-
static inline void vtime_user_enter(struct task_struct *tsk) { }
79-
static inline void vtime_user_exit(struct task_struct *tsk) { }
80-
static inline void vtime_guest_enter(struct task_struct *tsk) { }
81-
static inline void vtime_guest_exit(struct task_struct *tsk) { }
82-
static inline void vtime_init_idle(struct task_struct *tsk, int cpu) { }
83-
#endif
84-
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);
89-
extern void vtime_flush(struct task_struct *tsk);
90-
#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_flush(struct task_struct *tsk) { }
95-
#endif
96-
9797

9898
#ifdef CONFIG_IRQ_TIME_ACCOUNTING
9999
extern void irqtime_account_irq(struct task_struct *tsk, unsigned int offset);

0 commit comments

Comments
 (0)