[PATCH 1/6] conf: add entries for deadline scheduler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Deadline scheduler, or SCHED_DEADLINE, is a new realtime scheduler
added to Linux 3.14. In order to support it as a possible value in
vcpusched/iothreadsched, we have to add it to scheduler related
structures.
---
 src/conf/domain_conf.c |  1 +
 src/conf/domain_conf.h |  3 +++
 src/util/virprocess.c  | 12 +++++++++++-
 src/util/virprocess.h  |  1 +
 4 files changed, 16 insertions(+), 1 deletion(-)

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index a233c0c..ca0fdfd 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -23125,6 +23125,7 @@ virDomainFormatSchedDef(virDomainDefPtr def,
             case VIR_PROC_POLICY_NONE:
             case VIR_PROC_POLICY_BATCH:
             case VIR_PROC_POLICY_IDLE:
+            case VIR_PROC_POLICY_DEADLINE:
             case VIR_PROC_POLICY_LAST:
                 currentMap = schedMap;
                 break;
diff --git a/src/conf/domain_conf.h b/src/conf/domain_conf.h
index 541b600..67b9e3e 100644
--- a/src/conf/domain_conf.h
+++ b/src/conf/domain_conf.h
@@ -1840,6 +1840,9 @@ typedef virDomainThreadSchedParam *virDomainThreadSchedParamPtr;
 struct _virDomainThreadSchedParam {
     virProcessSchedPolicy policy;
     int priority;
+    unsigned long long runtime;
+    unsigned long long deadline;
+    unsigned long long period;
 };
 
 typedef struct _virDomainTimerCatchupDef virDomainTimerCatchupDef;
diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 718c4a2..d68800b 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -34,6 +34,12 @@
 #endif
 #if HAVE_SCHED_SETSCHEDULER
 # include <sched.h>
+# ifdef __linux__
+#  include <linux/sched.h>
+# endif
+# ifndef SCHED_DEADLINE
+#  define SCHED_DEADLINE 6
+# endif
 #endif
 
 #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || HAVE_BSD_CPU_AFFINITY
@@ -111,7 +117,8 @@ VIR_ENUM_IMPL(virProcessSchedPolicy, VIR_PROC_POLICY_LAST,
               "batch",
               "idle",
               "fifo",
-              "rr");
+              "rr",
+              "deadline");
 
 /**
  * virProcessTranslateStatus:
@@ -1204,6 +1211,9 @@ virProcessSchedTranslatePolicy(virProcessSchedPolicy policy)
     case VIR_PROC_POLICY_RR:
         return SCHED_RR;
 
+    case VIR_PROC_POLICY_DEADLINE:
+        return SCHED_DEADLINE;
+
     case VIR_PROC_POLICY_LAST:
         /* nada */
         break;
diff --git a/src/util/virprocess.h b/src/util/virprocess.h
index 04e9802..1eac3e6 100644
--- a/src/util/virprocess.h
+++ b/src/util/virprocess.h
@@ -34,6 +34,7 @@ typedef enum {
     VIR_PROC_POLICY_IDLE,
     VIR_PROC_POLICY_FIFO,
     VIR_PROC_POLICY_RR,
+    VIR_PROC_POLICY_DEADLINE,
 
     VIR_PROC_POLICY_LAST
 } virProcessSchedPolicy;
-- 
2.8.1

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]