aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched.c')
-rw-r--r--kernel/sched.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/kernel/sched.c b/kernel/sched.c
index b18f231a4875..4fb3532dd7e8 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -52,7 +52,6 @@
52#include <linux/cpu.h> 52#include <linux/cpu.h>
53#include <linux/cpuset.h> 53#include <linux/cpuset.h>
54#include <linux/percpu.h> 54#include <linux/percpu.h>
55#include <linux/cpu_acct.h>
56#include <linux/kthread.h> 55#include <linux/kthread.h>
57#include <linux/seq_file.h> 56#include <linux/seq_file.h>
58#include <linux/sysctl.h> 57#include <linux/sysctl.h>
@@ -3338,13 +3337,9 @@ void account_user_time(struct task_struct *p, cputime_t cputime)
3338{ 3337{
3339 struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat; 3338 struct cpu_usage_stat *cpustat = &kstat_this_cpu.cpustat;
3340 cputime64_t tmp; 3339 cputime64_t tmp;
3341 struct rq *rq = this_rq();
3342 3340
3343 p->utime = cputime_add(p->utime, cputime); 3341 p->utime = cputime_add(p->utime, cputime);
3344 3342
3345 if (p != rq->idle)
3346 cpuacct_charge(p, cputime);
3347
3348 /* Add user time to cpustat. */ 3343 /* Add user time to cpustat. */
3349 tmp = cputime_to_cputime64(cputime); 3344 tmp = cputime_to_cputime64(cputime);
3350 if (TASK_NICE(p) > 0) 3345 if (TASK_NICE(p) > 0)
@@ -3408,10 +3403,9 @@ void account_system_time(struct task_struct *p, int hardirq_offset,
3408 cpustat->irq = cputime64_add(cpustat->irq, tmp); 3403 cpustat->irq = cputime64_add(cpustat->irq, tmp);
3409 else if (softirq_count()) 3404 else if (softirq_count())
3410 cpustat->softirq = cputime64_add(cpustat->softirq, tmp); 3405 cpustat->softirq = cputime64_add(cpustat->softirq, tmp);
3411 else if (p != rq->idle) { 3406 else if (p != rq->idle)
3412 cpustat->system = cputime64_add(cpustat->system, tmp); 3407 cpustat->system = cputime64_add(cpustat->system, tmp);
3413 cpuacct_charge(p, cputime); 3408 else if (atomic_read(&rq->nr_iowait) > 0)
3414 } else if (atomic_read(&rq->nr_iowait) > 0)
3415 cpustat->iowait = cputime64_add(cpustat->iowait, tmp); 3409 cpustat->iowait = cputime64_add(cpustat->iowait, tmp);
3416 else 3410 else
3417 cpustat->idle = cputime64_add(cpustat->idle, tmp); 3411 cpustat->idle = cputime64_add(cpustat->idle, tmp);
@@ -3447,10 +3441,8 @@ void account_steal_time(struct task_struct *p, cputime_t steal)
3447 cpustat->iowait = cputime64_add(cpustat->iowait, tmp); 3441 cpustat->iowait = cputime64_add(cpustat->iowait, tmp);
3448 else 3442 else
3449 cpustat->idle = cputime64_add(cpustat->idle, tmp); 3443 cpustat->idle = cputime64_add(cpustat->idle, tmp);
3450 } else { 3444 } else
3451 cpustat->steal = cputime64_add(cpustat->steal, tmp); 3445 cpustat->steal = cputime64_add(cpustat->steal, tmp);
3452 cpuacct_charge(p, -tmp);
3453 }
3454} 3446}
3455 3447
3456/* 3448/*