diff options
| author | Linux Build Service Account <lnxbuild@quicinc.com> | 2017-06-08 19:03:19 -0700 |
|---|---|---|
| committer | Gerrit - the friendly Code Review server <code-review@localhost> | 2017-06-08 19:03:18 -0700 |
| commit | bc2254655174adf0c5cca54937b2969855314eb3 (patch) | |
| tree | 0bd44b2012efbbbb3244dccd19d543018b7f18db /kernel/sched | |
| parent | 9725c4d90bee3b0be78bb1fdc084df1ec08d7d24 (diff) | |
| parent | 2025064255a87606e2da561de77dcd68daf8b26d (diff) | |
Merge "Merge branch 'android-4.4@9bc4622' into branch 'msm-4.4'"
Diffstat (limited to 'kernel/sched')
| -rw-r--r-- | kernel/sched/fair.c | 29 | ||||
| -rw-r--r-- | kernel/sched/sched.h | 2 |
2 files changed, 25 insertions, 6 deletions
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 9abc3e65dbd9..3b6038225c17 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -5112,6 +5112,26 @@ static void check_enqueue_throttle(struct cfs_rq *cfs_rq) if (!cfs_bandwidth_used()) return; + /* Synchronize hierarchical throttle counter: */ + if (unlikely(!cfs_rq->throttle_uptodate)) { + struct rq *rq = rq_of(cfs_rq); + struct cfs_rq *pcfs_rq; + struct task_group *tg; + + cfs_rq->throttle_uptodate = 1; + + /* Get closest up-to-date node, because leaves go first: */ + for (tg = cfs_rq->tg->parent; tg; tg = tg->parent) { + pcfs_rq = tg->cfs_rq[cpu_of(rq)]; + if (pcfs_rq->throttle_uptodate) + break; + } + if (tg) { + cfs_rq->throttle_count = pcfs_rq->throttle_count; + cfs_rq->throttled_clock_task = rq_clock_task(rq); + } + } + /* an active group must be handled by the update_curr()->put() path */ if (!cfs_rq->runtime_enabled || cfs_rq->curr) return; @@ -5502,15 +5522,14 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) /* Don't dequeue parent if it has other entities besides us */ if (cfs_rq->load.weight) { + /* Avoid re-evaluating load for this entity: */ + se = parent_entity(se); /* * Bias pick_next to pick a task from this cfs_rq, as * p is sleeping when it is within its sched_slice. */ - if (task_sleep && parent_entity(se)) - set_next_buddy(parent_entity(se)); - - /* avoid re-evaluating load for this entity */ - se = parent_entity(se); + if (task_sleep && se && !throttled_hierarchy(cfs_rq)) + set_next_buddy(se); break; } flags |= DEQUEUE_SLEEP; diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index a6733b57bcbc..b88f647ea935 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -511,7 +511,7 @@ struct cfs_rq { u64 throttled_clock, throttled_clock_task; u64 throttled_clock_task_time; - int throttled, throttle_count; + int throttled, throttle_count, throttle_uptodate; struct list_head throttled_list; #endif /* CONFIG_CFS_BANDWIDTH */ #endif /* CONFIG_FAIR_GROUP_SCHED */ |
