aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched/core.c')
-rw-r--r--kernel/sched/core.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index 3e078f26cb67..6e860100d11c 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -2601,8 +2601,6 @@ static inline void task_group_account_field(struct task_struct *p,
2601void account_user_time(struct task_struct *p, cputime_t cputime, 2601void account_user_time(struct task_struct *p, cputime_t cputime,
2602 cputime_t cputime_scaled) 2602 cputime_t cputime_scaled)
2603{ 2603{
2604 u64 *cpustat = kcpustat_this_cpu->cpustat;
2605 u64 tmp;
2606 int index; 2604 int index;
2607 2605
2608 /* Add user time to process. */ 2606 /* Add user time to process. */
@@ -2610,13 +2608,11 @@ void account_user_time(struct task_struct *p, cputime_t cputime,
2610 p->utimescaled = cputime_add(p->utimescaled, cputime_scaled); 2608 p->utimescaled = cputime_add(p->utimescaled, cputime_scaled);
2611 account_group_user_time(p, cputime); 2609 account_group_user_time(p, cputime);
2612 2610
2613 /* Add user time to cpustat. */
2614 tmp = cputime_to_cputime64(cputime);
2615
2616 index = (TASK_NICE(p) > 0) ? CPUTIME_NICE : CPUTIME_USER; 2611 index = (TASK_NICE(p) > 0) ? CPUTIME_NICE : CPUTIME_USER;
2617 cpustat[index] += tmp;
2618 2612
2613 /* Add user time to cpustat. */
2619 task_group_account_field(p, index, cputime); 2614 task_group_account_field(p, index, cputime);
2615
2620 /* Account for user time used */ 2616 /* Account for user time used */
2621 acct_update_integrals(p); 2617 acct_update_integrals(p);
2622} 2618}
@@ -2662,16 +2658,12 @@ static inline
2662void __account_system_time(struct task_struct *p, cputime_t cputime, 2658void __account_system_time(struct task_struct *p, cputime_t cputime,
2663 cputime_t cputime_scaled, int index) 2659 cputime_t cputime_scaled, int index)
2664{ 2660{
2665 u64 tmp = cputime_to_cputime64(cputime);
2666 u64 *cpustat = kcpustat_this_cpu->cpustat;
2667
2668 /* Add system time to process. */ 2661 /* Add system time to process. */
2669 p->stime = cputime_add(p->stime, cputime); 2662 p->stime = cputime_add(p->stime, cputime);
2670 p->stimescaled = cputime_add(p->stimescaled, cputime_scaled); 2663 p->stimescaled = cputime_add(p->stimescaled, cputime_scaled);
2671 account_group_system_time(p, cputime); 2664 account_group_system_time(p, cputime);
2672 2665
2673 /* Add system time to cpustat. */ 2666 /* Add system time to cpustat. */
2674 cpustat[index] += tmp;
2675 task_group_account_field(p, index, cputime); 2667 task_group_account_field(p, index, cputime);
2676 2668
2677 /* Account for system time used */ 2669 /* Account for system time used */