From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dario Faggioli Subject: [PATCH 2/2] sched: credit2: use boot CPU info for CPU #0 Date: Fri, 22 Aug 2014 19:15:42 +0200 Message-ID: <20140822171542.32764.42338.stgit@Solace.lan> References: <20140822165628.32764.15082.stgit@Solace.lan> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XKsRG-0004Yt-Uj for xen-devel@lists.xenproject.org; Fri, 22 Aug 2014 17:15:47 +0000 Received: by mail-we0-f172.google.com with SMTP id x48so11015532wes.31 for ; Fri, 22 Aug 2014 10:15:45 -0700 (PDT) In-Reply-To: <20140822165628.32764.15082.stgit@Solace.lan> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: george.dunlap@eu.citrix.com, Andrew Cooper , keir@xen.org, Jan Beulich List-Id: xen-devel@lists.xenproject.org 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 --- 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);