mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-09-11 13:49:39 +00:00
hv: add priority based scheduler
This patch adds a new priority based scheduler to support vCPU scheduling based on their pre-configured priorities. A vCPU can be running only if there is no higher priority vCPU running on the same pCPU. Tracked-On: #6571 Signed-off-by: Jie Deng <jie.deng@intel.com>
This commit is contained in:
@@ -12,7 +12,7 @@ import board_cfg_lib
|
||||
|
||||
ERR_LIST = {}
|
||||
N_Y = ['n', 'y']
|
||||
SCHEDULER_TYPE = ['SCHED_NOOP', 'SCHED_IORR', 'SCHED_BVT']
|
||||
SCHEDULER_TYPE = ['SCHED_NOOP', 'SCHED_IORR', 'SCHED_BVT', 'SCHED_PRIO']
|
||||
|
||||
RANGE_DB = {
|
||||
'LOG_LEVEL':{'min':0,'max':6},
|
||||
|
@@ -400,6 +400,11 @@ Refer SDM 17.19.2 for details, and use with caution.</xs:documentation>
|
||||
<xs:documentation>Specify memory information for Service and User VMs.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="priority" type="PriorityType" default="PRIO_LOW">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Specify the VM vCPU priority for scheduling.</xs:documentation>
|
||||
</xs:annotation>
|
||||
</xs:element>
|
||||
<xs:element name="os_config" type="OSConfigurations" minOccurs="0">
|
||||
<xs:annotation>
|
||||
<xs:documentation>General information for host kernel, boot
|
||||
|
@@ -101,7 +101,7 @@ higher value (lower severity) are discarded.</xs:documentation>
|
||||
|
||||
<xs:simpleType name="SchedulerType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Three scheduler options are supported:
|
||||
<xs:documentation>Four scheduler options are supported:
|
||||
|
||||
- ``SCHED_NOOP``: The NOOP (No-Operation) scheduler means there is a
|
||||
strict 1 to 1 mapping between vCPUs and pCPUs.
|
||||
@@ -113,6 +113,8 @@ higher value (lower severity) are discarded.</xs:documentation>
|
||||
earliest effective virtual time. *TODO: BVT scheduler will be built on
|
||||
top of a prioritized scheduling mechanism, i.e. higher priority threads
|
||||
get scheduled first, and same priority tasks are scheduled per BVT.*
|
||||
- ``SCHED_PRIO``: The priority based scheduler. vCPU scheduling will be based on
|
||||
their pre-configured priorities.
|
||||
|
||||
Read more about the available scheduling options in :ref:`cpu_sharing`.</xs:documentation>
|
||||
</xs:annotation>
|
||||
@@ -120,6 +122,21 @@ Read more about the available scheduling options in :ref:`cpu_sharing`.</xs:docu
|
||||
<xs:enumeration value="SCHED_NOOP" />
|
||||
<xs:enumeration value="SCHED_IORR" />
|
||||
<xs:enumeration value="SCHED_BVT" />
|
||||
<xs:enumeration value="SCHED_PRIO" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
<xs:simpleType name="PriorityType">
|
||||
<xs:annotation>
|
||||
<xs:documentation>Two priorities are supported for priority based scheduler:
|
||||
|
||||
- ``PRIO_LOW``: low priority for vCPU scheduling.
|
||||
- ``PRIO_HIGH``: high priority for vCPU scheduling.
|
||||
</xs:documentation>
|
||||
</xs:annotation>
|
||||
<xs:restriction base="xs:string">
|
||||
<xs:enumeration value="PRIO_LOW" />
|
||||
<xs:enumeration value="PRIO_HIGH" />
|
||||
</xs:restriction>
|
||||
</xs:simpleType>
|
||||
|
||||
|
@@ -18,6 +18,7 @@
|
||||
<xsl:value-of select="acrn:include('vuart.h')" />
|
||||
<xsl:value-of select="acrn:include('asm/pci_dev.h')" />
|
||||
<xsl:value-of select="acrn:include('asm/pgtable.h')" />
|
||||
<xsl:value-of select="acrn:include('schedule.h')" />
|
||||
|
||||
<xsl:apply-templates select="config-data/acrn-config" />
|
||||
</xsl:template>
|
||||
@@ -67,6 +68,7 @@
|
||||
<xsl:value-of select="acrn:comment('Allow Service VM to reboot the system since it is the highest priority VM.')" />
|
||||
<xsl:value-of select="$newline" />
|
||||
</xsl:if>
|
||||
<xsl:value-of select="acrn:initializer('vm_prio', priority)" />
|
||||
<xsl:apply-templates select="guest_flags" />
|
||||
<xsl:apply-templates select="clos" />
|
||||
<xsl:call-template name="cpu_affinity" />
|
||||
|
Reference in New Issue
Block a user