mirror of
https://github.com/projectacrn/acrn-hypervisor.git
synced 2025-06-24 14:33:38 +00:00
Doc: Content edit to cpu-sharing page
Signed-off-by: Deb Taylor <deb.taylor@intel.com>
This commit is contained in:
parent
fa5922c8bf
commit
3e45d5e301
@ -34,6 +34,7 @@ Here is an example for affinity:
|
|||||||
- VM0: 2 vCPUs, pinned to pCPU0 and pCPU1
|
- VM0: 2 vCPUs, pinned to pCPU0 and pCPU1
|
||||||
- VM1: 2 vCPUs, pinned to pCPU2 and pCPU3
|
- VM1: 2 vCPUs, pinned to pCPU2 and pCPU3
|
||||||
- VM2: 2 vCPUs, pinned to pCPU2 and pCPU3
|
- VM2: 2 vCPUs, pinned to pCPU2 and pCPU3
|
||||||
|
|
||||||
.. figure:: images/cpu_sharing_affinity.png
|
.. figure:: images/cpu_sharing_affinity.png
|
||||||
:align: center
|
:align: center
|
||||||
|
|
||||||
@ -61,10 +62,10 @@ Below block diagram shows the basic concept for the scheduler. There are two kin
|
|||||||
|
|
||||||
IORR (IO sensitive round-robin) scheduler is implemented with per-pCPU runqueue and per-pCPU tick timer, it supports more than one vCPU running on a pCPU. The scheduler schedule thread objects in round-robin policy basically, and support preemption by timeslice counting.
|
IORR (IO sensitive round-robin) scheduler is implemented with per-pCPU runqueue and per-pCPU tick timer, it supports more than one vCPU running on a pCPU. The scheduler schedule thread objects in round-robin policy basically, and support preemption by timeslice counting.
|
||||||
|
|
||||||
+ Every thread object has an initial timeslice (ex: 10ms)
|
- Every thread object has an initial timeslice (ex: 10ms)
|
||||||
+ timeslice is consumed with time and be counted in context switch and tick handler
|
- Timeslice is consumed with time and be counted in context switch and tick handler
|
||||||
+ If timeslice is positive or zero, then switch out current thread object and put it to tail of runqueue.Then, pick next runnable one from runqueue to run.
|
- If timeslice is positive or zero, then switch out current thread object and put it to tail of runqueue.Then, pick next runnable one from runqueue to run.
|
||||||
+ Threads who has IO request will preempt current running thread on the same pCPU.
|
- Threads who has IO request will preempt current running thread on the same pCPU.
|
||||||
|
|
||||||
Scheduler configuration
|
Scheduler configuration
|
||||||
***********************
|
***********************
|
||||||
@ -74,19 +75,18 @@ There are two place in the code decide the usage for scheduler.
|
|||||||
* The option in Kconfig decides the only scheduler used in runtime.
|
* The option in Kconfig decides the only scheduler used in runtime.
|
||||||
``hypervisor/arch/x86/Kconfig``
|
``hypervisor/arch/x86/Kconfig``
|
||||||
|
|
||||||
.. literalinclude:: ../hypervisor/arch/x86/Kconfig
|
.. literalinclude:: ../../../../hypervisor/arch/x86/Kconfig
|
||||||
:name: Kconfig for Scheduler
|
:name: Kconfig for Scheduler
|
||||||
:caption: Kconfig for Scheduler
|
:caption: Kconfig for Scheduler
|
||||||
:linenos:
|
:linenos:
|
||||||
:lines: 40-58
|
:lines: 40-58
|
||||||
:emphasize-lines: 42
|
|
||||||
:language: c
|
:language: c
|
||||||
|
|
||||||
The default scheduler is **SCHED_NOOP**. To use the IORR, only need to set **SCHED_IORR** in **ACRN Scheduler**.
|
The default scheduler is **SCHED_NOOP**. To use the IORR, only need to set **SCHED_IORR** in **ACRN Scheduler**.
|
||||||
|
|
||||||
* The affinity for VMs are set in ``hypervisor/scenarios/<scenario_name>/vm_configurations.h``
|
* The affinity for VMs are set in ``hypervisor/scenarios/<scenario_name>/vm_configurations.h``
|
||||||
|
|
||||||
.. literalinclude:: ../hypervisor/scenarios/industry/vm_configurations.h
|
.. literalinclude:: ../../../..//hypervisor/scenarios/industry/vm_configurations.h
|
||||||
:name: Affinity for VMs
|
:name: Affinity for VMs
|
||||||
:caption: Affinity for VMs
|
:caption: Affinity for VMs
|
||||||
:linenos:
|
:linenos:
|
||||||
|
Loading…
Reference in New Issue
Block a user