Merge tag 'sched-cputime-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/frederic/linux-dynticks into sched/core
Pull more cputime cleanups from Frederic Weisbecker: * Get rid of underscores polluting the vtime namespace * Consolidate context switch and tick handling * Improve debuggability by detecting irq unsafe callers Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -127,7 +127,15 @@ extern void account_system_time(struct task_struct *, int, cputime_t, cputime_t)
|
||||
extern void account_steal_time(cputime_t);
|
||||
extern void account_idle_time(cputime_t);
|
||||
|
||||
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
|
||||
static inline void account_process_tick(struct task_struct *tsk, int user)
|
||||
{
|
||||
vtime_account_user(tsk);
|
||||
}
|
||||
#else
|
||||
extern void account_process_tick(struct task_struct *, int user);
|
||||
#endif
|
||||
|
||||
extern void account_steal_ticks(unsigned long ticks);
|
||||
extern void account_idle_ticks(unsigned long ticks);
|
||||
|
||||
|
@@ -730,7 +730,7 @@ static inline void kvm_guest_enter(void)
|
||||
* This is running in ioctl context so we can avoid
|
||||
* the call to vtime_account() with its unnecessary idle check.
|
||||
*/
|
||||
vtime_account_system(current);
|
||||
vtime_account_system_irqsafe(current);
|
||||
current->flags |= PF_VCPU;
|
||||
/* KVM does not hold any references to rcu protected data when it
|
||||
* switches CPU into a guest mode. In fact switching to a guest mode
|
||||
@@ -748,7 +748,7 @@ static inline void kvm_guest_exit(void)
|
||||
* This is running in ioctl context so we can avoid
|
||||
* the call to vtime_account() with its unnecessary idle check.
|
||||
*/
|
||||
vtime_account_system(current);
|
||||
vtime_account_system_irqsafe(current);
|
||||
current->flags &= ~PF_VCPU;
|
||||
}
|
||||
|
||||
|
@@ -5,14 +5,15 @@ struct task_struct;
|
||||
|
||||
#ifdef CONFIG_VIRT_CPU_ACCOUNTING
|
||||
extern void vtime_task_switch(struct task_struct *prev);
|
||||
extern void __vtime_account_system(struct task_struct *tsk);
|
||||
extern void vtime_account_system(struct task_struct *tsk);
|
||||
extern void __vtime_account_idle(struct task_struct *tsk);
|
||||
extern void vtime_account_system_irqsafe(struct task_struct *tsk);
|
||||
extern void vtime_account_idle(struct task_struct *tsk);
|
||||
extern void vtime_account_user(struct task_struct *tsk);
|
||||
extern void vtime_account(struct task_struct *tsk);
|
||||
#else
|
||||
static inline void vtime_task_switch(struct task_struct *prev) { }
|
||||
static inline void __vtime_account_system(struct task_struct *tsk) { }
|
||||
static inline void vtime_account_system(struct task_struct *tsk) { }
|
||||
static inline void vtime_account_system_irqsafe(struct task_struct *tsk) { }
|
||||
static inline void vtime_account(struct task_struct *tsk) { }
|
||||
#endif
|
||||
|
||||
@@ -40,7 +41,7 @@ static inline 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_system(tsk);
|
||||
vtime_account_system(tsk);
|
||||
irqtime_account_irq(tsk);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user