Re: [PATCH] cpu hotplug, sched:Introduce cpu_active_map and redoscheddomainmanagment (take 2)

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Max Krasnyansky <maxk@...>
Cc: Peter Zijlstra <a.p.zijlstra@...>, <mingo@...>, <dmitry.adamushko@...>, <torvalds@...>, <pj@...>, <linux-kernel@...>
Date: Tuesday, July 22, 2008 - 10:06 am

Max Krasnyansky wrote:
 the
ing
cpu
e of
ings

I think you are right, but wouldn't s/online/active above fix that as=20
well?  The active_map didnt exist at the time that code went in initially=
 ;)

I think things were converted where they made sense to convert.  But we=20
also had a different goal at that time, so perhaps something was=20
missed.  If you think something else should be converted, please point=20
it out.

In the meantime, I would suggest we consider this patch on top of yours=20
(applies to tip/sched/devel):

----------------------

sched: Fully integrate cpus_active_map and root-domain code
  =20
Signed-off-by: Gregory Haskins <ghaskins@novell.com>

diff --git a/kernel/sched.c b/kernel/sched.c
index 62b1b8e..99ba70d 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -6611,7 +6611,7 @@ static void rq_attach_root(struct rq *rq, struct=20
root_domain *rd)
     rq->rd =3D rd;
=20
     cpu_set(rq->cpu, rd->span);
-    if (cpu_isset(rq->cpu, cpu_online_map))
+    if (cpu_isset(rq->cpu, cpu_active_map))
         set_rq_online(rq);
=20
     spin_unlock_irqrestore(&rq->lock, flags);
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index 7f70026..2bae8de 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -1004,7 +1004,7 @@ static void yield_task_fair(struct rq *rq)
  * search starts with cpus closest then further out as needed,
  * so we always favor a closer, idle cpu.
  * Domains may include CPUs that are not usable for migration,
- * hence we need to mask them out (cpu_active_map)
+ * hence we need to mask them out (rq->rd->online)
  *
  * Returns the CPU we should wake onto.
  */
@@ -1032,7 +1032,7 @@ static int wake_idle(int cpu, struct task_struct *p=
)
             || ((sd->flags & SD_WAKE_IDLE_FAR)
             && !task_hot(p, task_rq(p)->clock, sd))) {
             cpus_and(tmp, sd->span, p->cpus_allowed);
-            cpus_and(tmp, tmp, cpu_active_map);
+            cpus_and(tmp, tmp, task_rq(p)->rd->online);
             for_each_cpu_mask(i, tmp) {
                 if (idle_cpu(i)) {
                     if (i !=3D task_cpu(p)) {
diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
index 24621ce..d93169d 100644
--- a/kernel/sched_rt.c
+++ b/kernel/sched_rt.c
@@ -936,13 +936,6 @@ static int find_lowest_rq(struct task_struct *task)
         return -1; /* No targets found */
=20
     /*
-     * Only consider CPUs that are usable for migration.
-     * I guess we might want to change cpupri_find() to ignore those
-     * in the first place.
-     */
-    cpus_and(*lowest_mask, *lowest_mask, cpu_active_map);
-
-    /*
      * At this point we have built a mask of cpus representing the
      * lowest priority tasks in the system.  Now we want to elect
      * the best one based on our affinity and topology.

--------------

Regards,
-Greg
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] cpu hotplug, sched:Introduce cpu_active_map and ..., Gregory Haskins, (Tue Jul 22, 10:06 am)