From: "Jan Beulich" Subject: Re: [PATCH v1 2/3] sched_credit2.c : runqueue_per_core code Date: Fri, 13 Mar 2015 09:39:31 +0000 Message-ID: <5502BE630200007800069A46@mail.emea.novell.com> References: <20150312145736.GA8478@gmail.com> <5501CB270200007800069467@mail.emea.novell.com> <1426180062.7023.71.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1426180062.7023.71.camel@citrix.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Dario Faggioli Cc: "xen-devel@lists.xen.org" , George Dunlap , "uma.sharma523@gmail.com" List-Id: xen-devel@lists.xenproject.org >>> On 12.03.15 at 18:07, wrote: > On Thu, 2015-03-12 at 16:21 +0000, Jan Beulich wrote: >> >>> On 12.03.15 at 15:57, wrote: > >> > @@ -1940,10 +1946,14 @@ static void init_pcpu(const struct scheduler *ops, > int cpu) >> > >> > /* 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. */ >> > - if ( cpu == 0 ) >> > - rqi = 0; >> > + if ( opt_credit2_runqueue == CREDIT2_OPT_RUNQUEUE_SOCKET ) >> > + { >> > + rqi = (cpu) ? cpu_to_socket(cpu) : boot_cpu_to_socket(); >> > + } >> > else >> > - rqi = cpu_to_socket(cpu); >> > + { >> > + rqi = (cpu) ? cpu_to_core(cpu) : boot_cpu_to_core(); >> > + } >> >> Rather than extending the bad assumption of CPU 0 being the boot >> CPU (What if it gets offlined and this or another one onlined back >> as CPU 0?), can't you find a way to avoid depending on the numeric >> value of "cpu"? >> > BTW, while we're here, can we really offline CPU#0? I haven't played > much with CPU on/offlining, so sorry if I'm asking something obvious... No, we can't currently - due to similar wrong treatment elsewhere in the tree. But we shouldn't put in more road blocks. Jan