Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 339096
b: refs/heads/master
c: e3942ba
h: refs/heads/master
v: v3
  • Loading branch information
Frederic Weisbecker committed Nov 19, 2012
1 parent 79ed27e commit 04b1ccd
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bcebdf846522056a84ba0b0cba5f5413868c9394
refs/heads/master: e3942ba04052364d3c6454103362cafd87456010
2 changes: 2 additions & 0 deletions trunk/arch/ia64/include/asm/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,5 +103,7 @@ static inline void cputime_to_timeval(const cputime_t ct, struct timeval *val)
#define cputime64_to_clock_t(__ct) \
cputime_to_clock_t((__force cputime_t)__ct)

extern void arch_vtime_task_switch(struct task_struct *tsk);

#endif /* CONFIG_VIRT_CPU_ACCOUNTING */
#endif /* __IA64_CPUTIME_H */
9 changes: 1 addition & 8 deletions trunk/arch/ia64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,18 +100,11 @@ void vtime_account_user(struct task_struct *tsk)
* accumulated times to the current process, and to prepare accounting on
* the next process.
*/
void vtime_task_switch(struct task_struct *prev)
void arch_vtime_task_switch(struct task_struct *prev)
{
struct thread_info *pi = task_thread_info(prev);
struct thread_info *ni = task_thread_info(current);

if (idle_task(smp_processor_id()) != prev)
vtime_account_system(prev);
else
vtime_account_idle(prev);

vtime_account_user(prev);

pi->ac_stamp = ni->ac_stamp;
ni->ac_stime = ni->ac_utime = 0;
}
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/include/asm/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ static inline cputime_t clock_t_to_cputime(const unsigned long clk)

#define cputime64_to_clock_t(ct) cputime_to_clock_t((cputime_t)(ct))

static inline void arch_vtime_task_switch(struct task_struct *tsk) { }

#endif /* __KERNEL__ */
#endif /* CONFIG_VIRT_CPU_ACCOUNTING */
#endif /* __POWERPC_CPUTIME_H */
6 changes: 0 additions & 6 deletions trunk/arch/powerpc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,12 +375,6 @@ void vtime_account_user(struct task_struct *tsk)
account_user_time(tsk, utime, utimescaled);
}

void vtime_task_switch(struct task_struct *prev)
{
vtime_account(prev);
vtime_account_user(prev);
}

#else /* ! CONFIG_VIRT_CPU_ACCOUNTING */
#define calc_cputime_factors()
#endif
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/s390/include/asm/cputime.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@


#define __ARCH_HAS_VTIME_ACCOUNT
#define __ARCH_HAS_VTIME_TASK_SWITCH

/* We want to use full resolution of the CPU timer: 2**-12 micro-seconds. */

Expand Down
13 changes: 13 additions & 0 deletions trunk/kernel/sched/cputime.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,6 +443,19 @@ void vtime_account_system_irqsafe(struct task_struct *tsk)
}
EXPORT_SYMBOL_GPL(vtime_account_system_irqsafe);

#ifndef __ARCH_HAS_VTIME_TASK_SWITCH
void vtime_task_switch(struct task_struct *prev)
{
if (is_idle_task(prev))
vtime_account_idle(prev);
else
vtime_account_system(prev);

vtime_account_user(prev);
arch_vtime_task_switch(prev);
}
#endif

/*
* Archs that account the whole time spent in the idle task
* (outside irq) as idle time can rely on this and just implement
Expand Down

0 comments on commit 04b1ccd

Please sign in to comment.