aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sched_fair.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/sched_fair.c')
-rw-r--r--kernel/sched_fair.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 2f16e15c022c..c33f0ceb3de9 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -351,6 +351,12 @@ static void update_curr(struct cfs_rq *cfs_rq)
351 351
352 __update_curr(cfs_rq, curr, delta_exec); 352 __update_curr(cfs_rq, curr, delta_exec);
353 curr->exec_start = now; 353 curr->exec_start = now;
354
355 if (entity_is_task(curr)) {
356 struct task_struct *curtask = task_of(curr);
357
358 cpuacct_charge(curtask, delta_exec);
359 }
354} 360}
355 361
356static inline void 362static inline void
@@ -793,8 +799,9 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int sleep)
793 */ 799 */
794static void yield_task_fair(struct rq *rq) 800static void yield_task_fair(struct rq *rq)
795{ 801{
796 struct cfs_rq *cfs_rq = task_cfs_rq(rq->curr); 802 struct task_struct *curr = rq->curr;
797 struct sched_entity *rightmost, *se = &rq->curr->se; 803 struct cfs_rq *cfs_rq = task_cfs_rq(curr);
804 struct sched_entity *rightmost, *se = &curr->se;
798 805
799 /* 806 /*
800 * Are we the only task in the tree? 807 * Are we the only task in the tree?
@@ -802,7 +809,7 @@ static void yield_task_fair(struct rq *rq)
802 if (unlikely(cfs_rq->nr_running == 1)) 809 if (unlikely(cfs_rq->nr_running == 1))
803 return; 810 return;
804 811
805 if (likely(!sysctl_sched_compat_yield)) { 812 if (likely(!sysctl_sched_compat_yield) && curr->policy != SCHED_BATCH) {
806 __update_rq_clock(rq); 813 __update_rq_clock(rq);
807 /* 814 /*
808 * Update run-time statistics of the 'current'. 815 * Update run-time statistics of the 'current'.