[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH 2/2] sched: credit2: use boot CPU info for CPU #0



when deciding, during pCPU initialization, inside the scheduler
what runqueue should be associated to it.

This, thanks to the fact that topology identification of the
boot CPU now happens earlier than the scheduler initialization,
fixes the bug that CPU 0 was always being associated with runqueue
0, no matter what the actual topology is.

Signed-off-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>
---
 xen/common/sched_credit2.c |   12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index 1ca521b..1bcd6c0 100644
--- a/xen/common/sched_credit2.c
+++ b/xen/common/sched_credit2.c
@@ -54,7 +54,6 @@
  * + Immediate bug-fixes
  *  - Do per-runqueue, grab proper lock for dump debugkey
  * + Multiple sockets
- *  - Detect cpu layout and make runqueue map, one per L2 (make_runq_map())
  *  - Simple load balancer / runqueue assignment
  *  - Runqueue load measurement
  *  - Load-based load balancer
@@ -85,8 +84,8 @@
  * to a small value, and a fixed credit is added to everyone.
  *
  * The plan is for all cores that share an L2 will share the same
- * runqueue.  At the moment, there is one global runqueue for all
- * cores.
+ * runqueue.  At the moment, there is one runqueue for each physical
+ * socket.
  */
 
 /*
@@ -1935,13 +1934,12 @@ static void init_pcpu(const struct scheduler *ops, int 
cpu)
         return;
     }
 
-    /* Figure out which runqueue to put it in */
+    /* Figure out which runqueue to put cpu in */
     rqi = 0;
 
-    /* Figure out which runqueue to put it in */
-    /* NB: cpu 0 doesn't get a STARTING callback, so we hard-code it to 
runqueue 0. */
+    /* cpu 0 doesn't get a STARTING callback, so use boot CPU data for it */
     if ( cpu == 0 )
-        rqi = 0;
+        rqi = boot_cpu_to_socket();
     else
         rqi = cpu_to_socket(cpu);
 


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.