Prev: pidns: Fix wait for zombies to be reaped in zap_pid_ns_processes
Next: [RFC][PATCH] Add a dentry op to handle automounting rather than abusing follow_link
From: Venkatesh Pallipadi on 13 Jul 2010 18:00 * dequeue_entity is calling clear_buddies() and doing hierarchical clear, when dequeue_entity itself gets called for each level from dequeue_task_fair. Move clear_buddies to dequeue_task_fair instead. * Similar problem in pick_next_entity. Convert the call to __clear_buddies(). Also, clear_buddies is not using cfs_rq parameter. Removing that would probably make it more distinct from __clear_buddies. Signed-off-by: Venkatesh Pallipadi <venki(a)google.com> --- kernel/sched_fair.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c index a878b53..37901c7 100644 --- a/kernel/sched_fair.c +++ b/kernel/sched_fair.c @@ -793,7 +793,7 @@ static void __clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) cfs_rq->next = NULL; } -static void clear_buddies(struct cfs_rq *cfs_rq, struct sched_entity *se) +static void clear_buddies(struct sched_entity *se) { for_each_sched_entity(se) __clear_buddies(cfs_rq_of(se), se); @@ -821,8 +821,6 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int flags) #endif } - clear_buddies(cfs_rq, se); - if (se != cfs_rq->curr) __dequeue_entity(cfs_rq, se); account_entity_dequeue(cfs_rq, se); @@ -853,7 +851,7 @@ check_preempt_tick(struct cfs_rq *cfs_rq, struct sched_entity *curr) * The current task ran long enough, ensure it doesn't get * re-elected due to buddy favours. */ - clear_buddies(cfs_rq, curr); + clear_buddies(curr); return; } @@ -924,7 +922,7 @@ static struct sched_entity *pick_next_entity(struct cfs_rq *cfs_rq) if (cfs_rq->last && wakeup_preempt_entity(cfs_rq->last, left) < 1) se = cfs_rq->last; - clear_buddies(cfs_rq, se); + __clear_buddies(cfs_rq, se); return se; } @@ -1068,6 +1066,8 @@ static void dequeue_task_fair(struct rq *rq, struct task_struct *p, int flags) struct cfs_rq *cfs_rq; struct sched_entity *se = &p->se; + clear_buddies(se); + for_each_sched_entity(se) { cfs_rq = cfs_rq_of(se); dequeue_entity(cfs_rq, se, flags); @@ -1097,7 +1097,7 @@ static void yield_task_fair(struct rq *rq) if (unlikely(cfs_rq->nr_running == 1)) return; - clear_buddies(cfs_rq, se); + clear_buddies(se); if (likely(!sysctl_sched_compat_yield) && curr->policy != SCHED_BATCH) { update_rq_clock(rq); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo(a)vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ |