Skip to contentSkip to conversation

xen: credit2: enable per cpu runqueue creation

PATCH In review Praveen Kumar 3 participants 4 messages Apr 11, 2017 – Jul 20, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen: credit2: enable per cpu runqueue creation

The patch introduces a new command line option 'cpu' that when used will create runqueue per logical pCPU. This may be useful for small systems, and also for development, performance evalution and comparison.

---
 docs/misc/xen-command-line.markdown |  3 ++-
 xen/common/sched_credit2.c          | 15 +++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)
docs/misc/xen-command-line.markdown +2 -1
index 5815d87dab..6e73766574 100644
@@ -525,7 +525,7 @@ also slow in responding to load changes.
 The default value of `1 sec` is rather long.
 
 ### credit2\_runqueue
-> `= core | socket | node | all`
+> `= cpu | core | socket | node | all`
 
 > Default: `socket`
 
@@ -536,6 +536,7 @@ balancing (for instance, it will deal better with hyperthreading),
 but also more overhead.
 
 Available alternatives, with their meaning, are:
+* `cpu`: one runqueue per each logical pCPUs of the host;
 * `core`: one runqueue per each physical core of the host;
 * `socket`: one runqueue per each physical socket (which often,
             but not always, matches a NUMA node) of the host;
xen/common/sched_credit2.c +11 -4
index bb1c657e76..ee7b443f9e 100644
@@ -301,6 +301,9 @@ integer_param("credit2_balance_over", opt_overload_balance_tolerance);
  * want that to happen basing on topology. At the moment, it is possible
  * to choose to arrange runqueues to be:
  *
+ * - per-cpu: meaning that there will be one runqueue per logical cpu. This
+ *            will happen when if the opt_runqueue parameter is set to 'cpu'.
+ *
  * - per-core: meaning that there will be one runqueue per each physical
  *             core of the host. This will happen if the opt_runqueue
  *             parameter is set to 'core';
@@ -322,11 +325,13 @@ integer_param("credit2_balance_over", opt_overload_balance_tolerance);
  * either the same physical core, the same physical socket, the same NUMA
  * node, or just all of them, will be put together to form runqueues.
  */
-#define OPT_RUNQUEUE_CORE   0
-#define OPT_RUNQUEUE_SOCKET 1
-#define OPT_RUNQUEUE_NODE   2
-#define OPT_RUNQUEUE_ALL    3
+#define OPT_RUNQUEUE_CPU    0
+#define OPT_RUNQUEUE_CORE   1
+#define OPT_RUNQUEUE_SOCKET 2
+#define OPT_RUNQUEUE_NODE   3
+#define OPT_RUNQUEUE_ALL    4
 static const char *const opt_runqueue_str[] = {
+    [OPT_RUNQUEUE_CPU] = "cpu",
     [OPT_RUNQUEUE_CORE] = "core",
     [OPT_RUNQUEUE_SOCKET] = "socket",
     [OPT_RUNQUEUE_NODE] = "node",
@@ -682,6 +687,8 @@ cpu_to_runqueue(struct csched2_private *prv, unsigned int cpu)
         BUG_ON(cpu_to_socket(cpu) == XEN_INVALID_SOCKET_ID ||
                cpu_to_socket(peer_cpu) == XEN_INVALID_SOCKET_ID);
 
+        if (opt_runqueue == OPT_RUNQUEUE_CPU)
+            continue;
         if ( opt_runqueue == OPT_RUNQUEUE_ALL ||
              (opt_runqueue == OPT_RUNQUEUE_CORE && same_core(peer_cpu, cpu)) ||
              (opt_runqueue == OPT_RUNQUEUE_SOCKET && same_socket(peer_cpu, cpu)) ||
Signature · 7 lines
2.12.0


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel
#1 lore raw
Quoted 6 lines · Praveen Kumar

The patch introduces a new command line option 'cpu' that when used will create runqueue per logical pCPU. This may be useful for small systems, and also for development, performance evalution and comparison.

Praveen,

Unfortunately this didn't get checked in before the feature freeze -- I think I may have dropped the ball on this one.

I'll queue this one up to be merged once the Xen 4.10 development window opens.

-George

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#2 lore raw
In reply to Praveen Kumar
Quoted 9 lines · Praveen Kumar

The patch introduces a new command line option 'cpu' that when used will create
runqueue per logical pCPU. This may be useful for small systems, and also for
development, performance evalution and comparison.

Hey Geoge,

I don't see this patch in staging, nor I think you've commented on it.

IIRC, it was sent very close to feature freeze... So, is it possible that it fell through some crack? :-)

Any thoughts about it? If not, what about applying? :-D

Thanks and Regards,
Dario

Quoted 81 lines

---
 docs/misc/xen-command-line.markdown |  3 ++- xen/common/sched_credit2.c          | 15 +++++++++++----

 2 files changed, 13 insertions(+), 5 deletions(-)
docs/misc/xen- renamed from docs/misc/xen-command-line.markdown +0 -0

command-line.markdown
index 5815d87dab..6e73766574 100644

docs/misc/xen-command-line.markdown +0 -0
@@ -525,7 +525,7 @@ also slow in responding to load changes.

 The default value of 1 sec is rather long.

 ### credit2\_runqueue
-> = core | socket | node | all
+> = cpu | core | socket | node | all

 > Default: socket

docs/misc/xen-command-line.markdown +0 -0
@@ -536,6 +536,7 @@ balancing (for instance, it will deal better with
 hyperthreading),

 but also more overhead.

 Available alternatives, with their meaning, are:
+* cpu: one runqueue per each logical pCPUs of the host;
 * core: one runqueue per each physical core of the host;
 * socket: one runqueue per each physical socket (which often, but not always, matches a NUMA node) of the host;

xen/common/sched_credit2.c +0 -0
index bb1c657e76..ee7b443f9e 100644
@@ -301,6 +301,9 @@ integer_param("credit2_balance_over",
 opt_overload_balance_tolerance);
   * want that to happen basing on topology. At the moment, it is

possible
  * to choose to arrange runqueues to be:
  *
+ * - per-cpu: meaning that there will be one runqueue per logical cpu. This
+ *            will happen when if the opt_runqueue parameter is set to 'cpu'.
+ *
  * - per-core: meaning that there will be one runqueue per each physical
  *             core of the host. This will happen if the opt_runqueue
  *             parameter is set to 'core';

xen/common/sched_credit2.c +0 -0
@@ -322,11 +325,13 @@ integer_param("credit2_balance_over",
 opt_overload_balance_tolerance);
   * either the same physical core, the same physical socket, the same

NUMA
  * node, or just all of them, will be put together to form runqueues.
  */

xen/common/sched_credit2.c +5 -4
-#define OPT_RUNQUEUE_CORE   0
-#define OPT_RUNQUEUE_SOCKET 1
-#define OPT_RUNQUEUE_NODE   2
-#define OPT_RUNQUEUE_ALL    3
+#define OPT_RUNQUEUE_CPU    0
+#define OPT_RUNQUEUE_CORE   1
+#define OPT_RUNQUEUE_SOCKET 2
+#define OPT_RUNQUEUE_NODE   3
+#define OPT_RUNQUEUE_ALL    4

 static const char *const opt_runqueue_str[] = {
+    [OPT_RUNQUEUE_CPU] = "cpu",
     [OPT_RUNQUEUE_CORE] = "core",
     [OPT_RUNQUEUE_SOCKET] = "socket",
     [OPT_RUNQUEUE_NODE] = "node",

xen/common/sched_credit2.c +0 -0
@@ -682,6 +687,8 @@ cpu_to_runqueue(struct csched2_private *prv,
 unsigned int cpu)

         BUG_ON(cpu_to_socket(cpu) == XEN_INVALID_SOCKET_ID || cpu_to_socket(peer_cpu) == XEN_INVALID_SOCKET_ID);
+        if (opt_runqueue == OPT_RUNQUEUE_CPU)
+            continue;
         if ( opt_runqueue == OPT_RUNQUEUE_ALL || (opt_runqueue == OPT_RUNQUEUE_CORE && same_core(peer_cpu, cpu)) ||
              (opt_runqueue == OPT_RUNQUEUE_SOCKET && same_socket(peer_cpu, cpu)) ||

Signature · 4 lines
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel

#3 lore raw
In reply to Praveen Kumar
Quoted 6 lines · Praveen Kumar

The patch introduces a new command line option 'cpu' that when used will create runqueue per logical pCPU. This may be useful for small systems, and also for development, performance evalution and comparison.

OK, I've pushed this. Sorry again for missing the 4.9 window.

-George

Quoted 61 lines
---
 docs/misc/xen-command-line.markdown |  3 ++-
 xen/common/sched_credit2.c          | 15 +++++++++++----
 2 files changed, 13 insertions(+), 5 deletions(-)
docs/misc/xen-command-line.markdown +2 -1
index 5815d87dab..6e73766574 100644
@@ -525,7 +525,7 @@ also slow in responding to load changes.
 The default value of `1 sec` is rather long.
 
 ### credit2\_runqueue
-> `= core | socket | node | all`
+> `= cpu | core | socket | node | all`
 
 > Default: `socket`
 
@@ -536,6 +536,7 @@ balancing (for instance, it will deal better with hyperthreading),
 but also more overhead.
 
 Available alternatives, with their meaning, are:
+* `cpu`: one runqueue per each logical pCPUs of the host;
 * `core`: one runqueue per each physical core of the host;
 * `socket`: one runqueue per each physical socket (which often,
             but not always, matches a NUMA node) of the host;
xen/common/sched_credit2.c +9 -4
index bb1c657e76..ee7b443f9e 100644
@@ -301,6 +301,9 @@ integer_param("credit2_balance_over", opt_overload_balance_tolerance);
  * want that to happen basing on topology. At the moment, it is possible
  * to choose to arrange runqueues to be:
  *
+ * - per-cpu: meaning that there will be one runqueue per logical cpu. This
+ *            will happen when if the opt_runqueue parameter is set to 'cpu'.
+ *
  * - per-core: meaning that there will be one runqueue per each physical
  *             core of the host. This will happen if the opt_runqueue
  *             parameter is set to 'core';
@@ -322,11 +325,13 @@ integer_param("credit2_balance_over", opt_overload_balance_tolerance);
  * either the same physical core, the same physical socket, the same NUMA
  * node, or just all of them, will be put together to form runqueues.
  */
-#define OPT_RUNQUEUE_CORE   0
-#define OPT_RUNQUEUE_SOCKET 1
-#define OPT_RUNQUEUE_NODE   2
-#define OPT_RUNQUEUE_ALL    3
+#define OPT_RUNQUEUE_CPU    0
+#define OPT_RUNQUEUE_CORE   1
+#define OPT_RUNQUEUE_SOCKET 2
+#define OPT_RUNQUEUE_NODE   3
+#define OPT_RUNQUEUE_ALL    4
 static const char *const opt_runqueue_str[] = {
+    [OPT_RUNQUEUE_CPU] = "cpu",
     [OPT_RUNQUEUE_CORE] = "core",
     [OPT_RUNQUEUE_SOCKET] = "socket",
     [OPT_RUNQUEUE_NODE] = "node",

xen/common/sched_credit2.c cpu_to_runqueue(struct csched2_private *prv, unsigned int cpu) · line 694

Quoted 8 lines
xen/common/sched_credit2.c +2 -0
@@ -682,6 +687,8 @@ cpu_to_runqueue(struct csched2_private *prv, unsigned int cpu)
         BUG_ON(cpu_to_socket(cpu) == XEN_INVALID_SOCKET_ID ||
                cpu_to_socket(peer_cpu) == XEN_INVALID_SOCKET_ID);
 
+        if (opt_runqueue == OPT_RUNQUEUE_CPU)
+            continue;
         if ( opt_runqueue == OPT_RUNQUEUE_ALL ||
              (opt_runqueue == OPT_RUNQUEUE_CORE && same_core(peer_cpu, cpu)) ||
              (opt_runqueue == OPT_RUNQUEUE_SOCKET && same_socket(peer_cpu, cpu)) ||

_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xen.org/xen-devel