aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/sched_fair.c30
-rw-r--r--kernel/sys.c2
2 files changed, 14 insertions, 18 deletions
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 56c0efe902a7..e0c0b4bc3f08 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -386,20 +386,6 @@ int sched_nr_latency_handler(struct ctl_table *table, int write,
386#endif 386#endif
387 387
388/* 388/*
389 * delta *= P[w / rw]
390 */
391static inline unsigned long
392calc_delta_weight(unsigned long delta, struct sched_entity *se)
393{
394 for_each_sched_entity(se) {
395 delta = calc_delta_mine(delta,
396 se->load.weight, &cfs_rq_of(se)->load);
397 }
398
399 return delta;
400}
401
402/*
403 * delta /= w 389 * delta /= w
404 */ 390 */
405static inline unsigned long 391static inline unsigned long
@@ -440,12 +426,20 @@ static u64 __sched_period(unsigned long nr_running)
440 */ 426 */
441static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se) 427static u64 sched_slice(struct cfs_rq *cfs_rq, struct sched_entity *se)
442{ 428{
443 unsigned long nr_running = cfs_rq->nr_running; 429 u64 slice = __sched_period(cfs_rq->nr_running + !se->on_rq);
444 430
445 if (unlikely(!se->on_rq)) 431 for_each_sched_entity(se) {
446 nr_running++; 432 struct load_weight *load = &cfs_rq->load;
447 433
448 return calc_delta_weight(__sched_period(nr_running), se); 434 if (unlikely(!se->on_rq)) {
435 struct load_weight lw = cfs_rq->load;
436
437 update_load_add(&lw, se->load.weight);
438 load = &lw;
439 }
440 slice = calc_delta_mine(slice, se->load.weight, load);
441 }
442 return slice;
449} 443}
450 444
451/* 445/*
diff --git a/kernel/sys.c b/kernel/sys.c
index d356d79e84ac..61dbfd4a54df 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -1627,6 +1627,8 @@ static void k_getrusage(struct task_struct *p, int who, struct rusage *r)
1627 utime = stime = cputime_zero; 1627 utime = stime = cputime_zero;
1628 1628
1629 if (who == RUSAGE_THREAD) { 1629 if (who == RUSAGE_THREAD) {
1630 utime = task_utime(current);
1631 stime = task_stime(current);
1630 accumulate_thread_rusage(p, r); 1632 accumulate_thread_rusage(p, r);
1631 goto out; 1633 goto out;
1632 } 1634 }