All of lore.kernel.org
 help / color / mirror / Atom feed
From: Uma Sharma <uma.sharma523@gmail.com>
To: xen-devel@lists.xen.org
Cc: dario.faggioli@citrix.com, George.Dunlap@citrix.com
Subject: [Patch 2/2]xen/sched_credit2.c : Runqueue per core
Date: Mon, 9 Mar 2015 14:25:01 +0530	[thread overview]
Message-ID: <20150309085501.GA4280@gmail.com> (raw)

This patch inserts runqueue_per_core code.
And also makes generic selection for runqueue by using boot paarmeter.

Signed-off-by: Uma Sharma <uma.sharma523@gmail.com>
---

diff --git a/xen/common/sched_credit2.c b/xen/common/sched_credit2.c
index ad0a5d4..2075e70 100644
--- 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);
 
 /*
  * Useful macros
@@ -1921,6 +1923,7 @@ static void deactivate_runqueue(struct csched2_private *prv, int rqi)
 static void init_pcpu(const struct scheduler *ops, int cpu)
 {
     int rqi;
+    char rq;
     unsigned long flags;
     struct csched2_private *prv = CSCHED2_PRIV(ops);
     struct csched2_runqueue_data *rqd;
@@ -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",

             reply	other threads:[~2015-03-09  8:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-09  8:55 Uma Sharma [this message]
2015-03-09 11:48 ` [Patch 2/2]xen/sched_credit2.c : Runqueue per core Jan Beulich
2015-03-09 12:18 ` George Dunlap
2015-03-09 13:03   ` Dario Faggioli
2015-03-09 13:09     ` Uma Sharma
2015-03-11 18:06       ` Uma Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150309085501.GA4280@gmail.com \
    --to=uma.sharma523@gmail.com \
    --cc=George.Dunlap@citrix.com \
    --cc=dario.faggioli@citrix.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.