[patch] BFS 421-1: cleanup try_preempt

From: Hillf Danton
Date: Mon Jul 09 2012 - 08:22:13 EST


The helper, resched_suitable_idle, is changed to be used in try_preempt.

SOB: Hillf Danton <dhillf@xxxxxxxxx>
---

--- a/kernel/sched/bfs.c Fri Jul 6 20:30:10 2012
+++ b/kernel/sched/bfs.c Mon Jul 9 20:00:52 2012
@@ -859,10 +859,15 @@ static void resched_best_idle(struct tas
resched_best_mask(task_cpu(p), task_rq(p), &tmpmask);
}

-static inline void resched_suitable_idle(struct task_struct *p)
+static inline bool resched_suitable_idle(struct task_struct *p)
{
- if (suitable_idle_cpus(p))
+ bool rc = false;
+
+ if (suitable_idle_cpus(p)) {
resched_best_idle(p);
+ rc = true;
+ }
+ return rc;
}
/*
* Flags to tell us whether this CPU is running a CPU frequency governor that
@@ -915,8 +920,9 @@ static inline bool suitable_idle_cpus(st
return uprq->curr == uprq->idle;
}

-static inline void resched_suitable_idle(struct task_struct *p)
+static inline bool resched_suitable_idle(struct task_struct *p)
{
+ return false;
}

void cpu_scaling(int __unused)
@@ -1390,12 +1396,12 @@ static void try_preempt(struct task_stru
* try_preempt with the sticky flag enabled means some complicated
* re-scheduling has occurred and we should ignore the sticky flag.
*/
- clear_sticky(p);
+ if (task_sticky(p))
+ clear_sticky(p);

- if (suitable_idle_cpus(p)) {
- resched_best_idle(p);
+ /* check if idle cpu available */
+ if (resched_suitable_idle(p))
return;
- }

/* IDLEPRIO tasks never preempt anything but idle */
if (p->policy == SCHED_IDLEPRIO)
--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/