From: "Jan Beulich" Subject: Re: [Patch 2/2]xen/sched_credit2.c : Runqueue per core Date: Mon, 09 Mar 2015 11:48:11 +0000 Message-ID: <54FD968B020000780006771E@mail.emea.novell.com> References: <20150309085501.GA4280@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20150309085501.GA4280@gmail.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: Uma Sharma Cc: dario.faggioli@citrix.com, George.Dunlap@citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org >>> On 09.03.15 at 09:55, wrote: > --- a/xen/common/sched_credit2.c > +++ b/xen/common/sched_credit2.c > @@ -165,6 +165,8 @@ > > int opt_migrate_resist=500; > integer_param("sched_credit2_migrate_resist", opt_migrate_resist); > +static char __initdata opt_credit2_runqueue[10] = "socket"; > +string_param("credit2_runqueue", opt_credit2_runqueue); This then needs to be added to docs/misc/xen-command-line.markdown, which will then hopefully make clear what meaning it has. > @@ -1935,15 +1938,36 @@ static void init_pcpu(const struct scheduler *ops, int cpu) > return; > } > > + /*Figure out which type of runqueue are to be created */ > + if (!strcmp(opt_credit2_runquque, "socket")) { > + rq = 's'; > + } else if (!strcmp(opt_credit2_runquque, "core")) { > + rq = 'c'; > + } else { > + rq = 's'; > + } > + > /* Figure out which runqueue to put it 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. */ > - if ( cpu == 0 ) > - rqi = 0; > - else > - rqi = cpu_to_socket(cpu); > + /* cpu 0 doesn't get a STARTING callback, so use boot CPU data for it */ > + if ( cpu == 0 ) { > + switch (rq) { > + case 's' : rqi = boot_cpu_to_socket(); > + break; > + case 'c' : rqi = boot_cpu_to_core(); > + break; > + default : rqi = boot_cpu_to_socket(); > + } > + } else { > + switch (rq) { > + case 's' : rqi = cpu_to_socket(cpu); > + break; > + case 'c' : rqi = cpu_to_core(cpu); > + break; > + default : rqi = cpu_to_socket(cpu); > + } > + } > > if ( rqi < 0 ) > { > @@ -1988,7 +2012,7 @@ csched2_alloc_pdata(const struct scheduler *ops, int cpu) > { > /* Check to see if the cpu is online yet */ > /* Note: cpu 0 doesn't get a STARTING callback */ > - if ( cpu == 0 || cpu_to_socket(cpu) >= 0 ) > + if ( cpu == 0 || cpu_to_socket(cpu) >= 0 || cpu_to_core(cpu)) > init_pcpu(ops, cpu); > else > printk("%s: cpu %d not online yet, deferring initializatgion\n", In all of the above, please obey to ./CODING_STYLE. Jan