SlideShare uma empresa Scribd logo
1 de 18
Baixar para ler offline
ACRN schedule framework introduction
Shuo A Liu
shuo.a.liu@intel.com
Key contributors: Yu Wang, Jason CJ Chen
• Goal
• Schedule framework
• Pcpu resource assignment
• Backup
Summary
ACRN cpu sharing goal
1. Fully utilize the physical cpu resource to support more virtual machines.
2. Keep small footprint for hypervisor, and satisfy FuSa requirements.
3. No impact on real time and FuSa workloads.
4. Simple tiny scheduler algorithm to satisfy embedded device requirements.
• Goal
• Schedule framework
• Pcpu resource assignment
• Backup
Summary
Roles of schedule framework
• Follows modularization, we have vcpu layer
and schedule layer.
• Maintain thread_object state machine.
• Abstract scheduler object, easy extend new
scheduler algorithms.
• Scalable context switch architecture.
vcpu layer
NOOP scheduler BVT scheduler
schedule framework
layer
high level layers
Basic schedule concept
VM0
vcpu0 vcpu1
VM1
vcpu0 vcpu1
VM2
vcpu0 vcpu1
per_cpu
Real clock Real clock
runqueue
Real clock
runqueue
Real clock
pcpu0 pcpu1 pcpu2 pcpu3
Context Switch
pick
vcpu
Context Switch
pick
vcpu
Context Switch
pick
vcpu
pick
vcpu
noop scheduler BVT scheduler
per_cpu
Context Switch
per_cpu
Schedule framework relationship diagram
vcpu
vcpu_id
thread_obj
…
sched_control
vcpu
vcpu_id
thread_obj
…
thread_object thread_object
vcpu
vcpu_id
thread_obj
…
sched_bvt_control
vcpu
vcpu_id
thread_obj
…
thread_object thread_object
run_list
pcpu_id
thread
switch_out
switch_in
status
data
run_list
pcpu_id
thread
switch_out
switch_in
status
data
run_list
pcpu_id
thread
switch_out
switch_in
status
data
run_list
pcpu_id
thread
switch_out
switch_in
status
data
curr_obj
scheduler
priv
…
PCPU2
timer
…
runqueue
sched_bvtPCPU0
vcpu
vcpu_id
thread_obj
…
sched_control
thread_object
per_cpu
curr_obj
scheduler
priv
…
sched_noop_control
…
noop_thread_obj
sched_noop
PCPU1
vcpu
vcpu_id
thread_obj
…
sched_control
thread_object
per_cpu
curr_obj
scheduler
priv
…
sched_noop_context
…
noop_thread_obj
pcpu_id
thread
switch_out
switch_in
status
data
run_list
init
deinit
init_data
deinit_data
yield
prioritize
sleep
name
pick_next
wake
name
init
deinit
init_data
deinit_data
yield
prioritize
sleep
pick_next
wake
pcpu_id
thread
switch_out
switch_in
status
data
run_list
vcpu_array
created_vcpu
s
…
acrn_vm
type
hw
name
GUID
pcpu_bitmap
vcpu_num
…
vm_id
vcpu_array
created_vcpu
s
…
acrn_vm
type
hw
name
GUID
pcpu_bitmap
vcpu_num
…
vm_id
vcpu_array
created_vcpu
s
…
acrn_vm
type
hw
name
GUID
pcpu_bitmap
vcpu_num
…
vm_id
vcpu0
vcpu1
vcpu0
vcpu1
vm_hw_info vm_hw_info vm_hw_info
Relationship of vcpu and schedule
vcpu0
vcpu1
per_cpu
vcpu
vcpu_id
thread_obj
…
thread_control
thread_object
vcpu
vcpu_id
thread_obj
…
sched_bvt_control
vcpu
vcpu_id
thread_obj
…
thread_object thread_object
run_list
pcpu_id
thread
switch_out
switch_in
status
data
run_list
pcpu_id
thread
switch_out
switch_in
status
data
run_list
pcpu_id
thread
switch_out
switch_in
status
data
curr_obj
scheduler
priv
…
PCPU
2
timer
…
runqueue
sched_bvt
name
init
deinit
init_data
deinit_data
yield
prioritize
sleep
pick_next
wake
PCPU
0
PCPU
1
PCPU
3
Schedule API architecture
vcpu layer
thread_obj
Functionality component layers
schedulers
layer
schedule framework
layer
scheduler
callbacks
API for vcpu
vcpu API
• vcpu derived from thread_obj.
• thread_obj is the schedule entity from schedule framework perspective
• scheduler is abstracted from schedule framework, several callbacks need to be implemented by
each scheduler.
API for
scheduler
Hardware management
layer
Schedule object state transition
THREAD_STS_BLOCKED
THREAD_STS_RUNNINGTHREAD_STS_RUNNABLE
init
Scheduler pick to running
run out of timeslice /
yield / be preempted
Scheduling points & schedule request points
Type Points APIs
Scheduling points Before VM-Entry
I/O request
default_idle
Schedule request points Scheduler tick
S3 sleep/wake
Pause/Halt instruction emulation yield/sleep
vcpu launch wake
Virtual interrupt/exception injection kick/wake
EPT flush kick
EOI vmexit bitmap update kick
Hypercalls(pause_vm/resume_vm) sleep/wake
Context Switch
Vcpu layer will register the switch_in/switch_out for platform architecture level
context switch handling.
MSRs IA32_STAR, IA32_LSTAR, IA32_FMASK,
IA32_KERNEL_GS_BASE
xsave/xrstors X87 state, SSE state and platform specific state components.
vmcs switch
General registers flags, rbx, rbp, r12, r13, r14, r15, rdi, rsp
VCPU Power management
• Vcpu C/P state
• For noop, pass through then controlled by guest itself.
• Hardcode p-state and c-state data table in HV, export to guest through ACPI table by DM.
• Forward MSR_IA32_PERF_CTL msr writing of guests to hardware by HV for p-state.
• Passthrough c-state IO port writing for c-state.
• For BVT, consider to disable C/P-state capability for guest.
• Disable p-state and c-state table for guest through virtual ACPI table.
• disable mwait capability of guest in CPUID emulation.
• MSR_IA32_PERF_CTL emulation will reject the request.
FuSa/Security requirements
• FuSa
• The schedule architecture can guarantee pcpu sharing scheduler will not
impact the pcpu which bind with noop scheduler.
• Every scheduler will only effect its vcpu_affinity limited pcpu resource.
• There has no shared resource between different schedulers.
• Schedule/scheduler architecture follows modularization rules.
• Security
• L1TF and Spectre are needn’t care because they will be handled during
VMEXIT&VMENTRY. And hypervisor only support ring0, so needn’t do extra
operations during context switching.
• Goal
• Scheduler framework
• Pcpu resource assignment
• Backup
Summary
cpu_affinity
• Currently, we do not support vCPU migration; the assignment of vCPU
mapping to pCPU is fixed at the time the VM is launched. The statically
configured cpu_affinity in the VM configuration defines a superset of pCPUs
that the VM is allowed to run on. One bit in this bitmap indicates that one pCPU
could be assigned to this VM, and the bit number is the pCPU ID. A pre-
launched VM is supposed to be launched on exact number of pCPUs that are
assigned in this bitmap. The vCPU to pCPU mapping is implicitly indicated:
vCPU0 maps to the pCPU with lowest pCPU ID, vCPU1 maps to the second
lowest pCPU ID, and so on.
• For post-launched VMs, acrn-dm could choose to launch a subset of pCPUs
that are defined in cpu_affinity by specifying the assigned pCPUs (--
cpu_affinity option). But it can’t assign any pCPUs that are not included in the
VM’s cpu_affinity.
cpu_affinity - example
Use the following settings to support this configuration in the industry
scenario:
• Define the default pCPU pool for each VM:
#define VM1_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U))
#define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U) | AFFINITY_CPU(3U))
• Offline pcpu2-3 in Service VM.
• launch WaaG with “--cpu_affinity 0,1”
• launch RT with “--cpu_affinity 2,3”
• The devicemodel option “--cpu_affinity” is not a must because they define
same pCPU pool with the default value in hypervisor configuration.
pCPU0 pCPU1 pCPU2 pCPU3
Service VM + Waag RT Linux
QA

Mais conteúdo relacionado

Mais procurados

Conceitos de Capacity Planning e Sysplex por Fernando Ferreira
Conceitos de Capacity Planning e Sysplex por Fernando FerreiraConceitos de Capacity Planning e Sysplex por Fernando Ferreira
Conceitos de Capacity Planning e Sysplex por Fernando Ferreira
Joao Galdino Mello de Souza
 
Cuda 6 performance_report
Cuda 6 performance_reportCuda 6 performance_report
Cuda 6 performance_report
Michael Zhang
 

Mais procurados (20)

Conceitos de Capacity Planning e Sysplex por Fernando Ferreira
Conceitos de Capacity Planning e Sysplex por Fernando FerreiraConceitos de Capacity Planning e Sysplex por Fernando Ferreira
Conceitos de Capacity Planning e Sysplex por Fernando Ferreira
 
Introduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan NevraevIntroduction to Direct 3D 12 by Ivan Nevraev
Introduction to Direct 3D 12 by Ivan Nevraev
 
OpenIot & ELC Europe 2016 Berlin - How to develop the ARM 64bit board, Samsun...
OpenIot & ELC Europe 2016 Berlin - How to develop the ARM 64bit board, Samsun...OpenIot & ELC Europe 2016 Berlin - How to develop the ARM 64bit board, Samsun...
OpenIot & ELC Europe 2016 Berlin - How to develop the ARM 64bit board, Samsun...
 
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave OldcornDirect3D12 and the Future of Graphics APIs by Dave Oldcorn
Direct3D12 and the Future of Graphics APIs by Dave Oldcorn
 
eBPF Perf Tools 2019
eBPF Perf Tools 2019eBPF Perf Tools 2019
eBPF Perf Tools 2019
 
BKK16-311 EAS Upstream Stategy
BKK16-311 EAS Upstream StategyBKK16-311 EAS Upstream Stategy
BKK16-311 EAS Upstream Stategy
 
Cuda 6 performance_report
Cuda 6 performance_reportCuda 6 performance_report
Cuda 6 performance_report
 
Linux kernel memory allocators
Linux kernel memory allocatorsLinux kernel memory allocators
Linux kernel memory allocators
 
Kdump
KdumpKdump
Kdump
 
Nap extras
Nap extrasNap extras
Nap extras
 
Bpf performance tools chapter 4 bcc
Bpf performance tools chapter 4   bccBpf performance tools chapter 4   bcc
Bpf performance tools chapter 4 bcc
 
Linux kernel modules
Linux kernel modulesLinux kernel modules
Linux kernel modules
 
Project ACRN I2C mediator introduction
Project ACRN I2C mediator introductionProject ACRN I2C mediator introduction
Project ACRN I2C mediator introduction
 
The Theory and Implementation of DVFS on Linux
The Theory and Implementation of DVFS on LinuxThe Theory and Implementation of DVFS on Linux
The Theory and Implementation of DVFS on Linux
 
BKK16-208 EAS
BKK16-208 EASBKK16-208 EAS
BKK16-208 EAS
 
LCU14-410: How to build an Energy Model for your SoC
LCU14-410: How to build an Energy Model for your SoCLCU14-410: How to build an Energy Model for your SoC
LCU14-410: How to build an Energy Model for your SoC
 
Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10Architecture innovations in POWER ISA v3.01 and POWER10
Architecture innovations in POWER ISA v3.01 and POWER10
 
Process scheduling
Process schedulingProcess scheduling
Process scheduling
 
Fhrp notes
Fhrp notesFhrp notes
Fhrp notes
 
µCLinux on Pluto 6 Project presentation
µCLinux on Pluto 6 Project presentationµCLinux on Pluto 6 Project presentation
µCLinux on Pluto 6 Project presentation
 

Semelhante a Project ACRN schedule framework introduction

Cisco data center support
Cisco data center supportCisco data center support
Cisco data center support
Krunal Shah
 
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
aaajjj4
 

Semelhante a Project ACRN schedule framework introduction (20)

Project ACRN CPU sharing BVT scheduler in ACRN hypervisor
Project ACRN CPU sharing BVT scheduler in ACRN hypervisorProject ACRN CPU sharing BVT scheduler in ACRN hypervisor
Project ACRN CPU sharing BVT scheduler in ACRN hypervisor
 
See what happened with real time kvm when building real time cloud pezhang@re...
See what happened with real time kvm when building real time cloud pezhang@re...See what happened with real time kvm when building real time cloud pezhang@re...
See what happened with real time kvm when building real time cloud pezhang@re...
 
Advanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtopAdvanced performance troubleshooting using esxtop
Advanced performance troubleshooting using esxtop
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction
 
Intel's Out of the Box Network Developers Ireland Meetup on March 29 2017 - ...
Intel's Out of the Box Network Developers Ireland Meetup on March 29 2017  - ...Intel's Out of the Box Network Developers Ireland Meetup on March 29 2017  - ...
Intel's Out of the Box Network Developers Ireland Meetup on March 29 2017 - ...
 
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/NeutronOverview of Distributed Virtual Router (DVR) in Openstack/Neutron
Overview of Distributed Virtual Router (DVR) in Openstack/Neutron
 
Tizen Developer Conference 2017 San Francisco - Tizen Power Management Servic...
Tizen Developer Conference 2017 San Francisco - Tizen Power Management Servic...Tizen Developer Conference 2017 San Francisco - Tizen Power Management Servic...
Tizen Developer Conference 2017 San Francisco - Tizen Power Management Servic...
 
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
ACRN vMeet-Up EU 2021 - Real Time Management and Performance OptimizationACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
 
Realtime scheduling for virtual machines in SKT
Realtime scheduling for virtual machines in SKTRealtime scheduling for virtual machines in SKT
Realtime scheduling for virtual machines in SKT
 
WAN - trends and use cases
WAN - trends and use casesWAN - trends and use cases
WAN - trends and use cases
 
Cisco data center support
Cisco data center supportCisco data center support
Cisco data center support
 
Virtualization Support in ARMv8+
Virtualization Support in ARMv8+Virtualization Support in ARMv8+
Virtualization Support in ARMv8+
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdfStorage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
Storage-Performance-Tuning-for-FAST-Virtual-Machines_Fam-Zheng.pdf
 
Oracle VM 3 Hard Partitioning
Oracle VM 3 Hard PartitioningOracle VM 3 Hard Partitioning
Oracle VM 3 Hard Partitioning
 
Demand-Based Coordinated Scheduling for SMP VMs
Demand-Based Coordinated Scheduling for SMP VMsDemand-Based Coordinated Scheduling for SMP VMs
Demand-Based Coordinated Scheduling for SMP VMs
 
Oracle VM 3 hard partitioning
Oracle VM 3 hard partitioningOracle VM 3 hard partitioning
Oracle VM 3 hard partitioning
 
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVMAchieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
 
Reconfigurable Coprocessors Synthesis in the MPEG-RVC Domain
Reconfigurable Coprocessors Synthesis in the MPEG-RVC DomainReconfigurable Coprocessors Synthesis in the MPEG-RVC Domain
Reconfigurable Coprocessors Synthesis in the MPEG-RVC Domain
 
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
 

Mais de Project ACRN

Mais de Project ACRN (20)

ACRN vMeet-Up EU 2021 - installation and configuration introduction
ACRN vMeet-Up EU 2021 - installation and configuration introductionACRN vMeet-Up EU 2021 - installation and configuration introduction
ACRN vMeet-Up EU 2021 - installation and configuration introduction
 
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
 
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure BootACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
 
ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - debug ACRN hypervisorACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
 
ACRN vMeet-Up EU 2021 - functional safety design and certification plan
ACRN vMeet-Up EU 2021 -  functional safety design and certification planACRN vMeet-Up EU 2021 -  functional safety design and certification plan
ACRN vMeet-Up EU 2021 - functional safety design and certification plan
 
ACRN vMeet-Up EU 2021 - community and development model
ACRN vMeet-Up EU 2021 - community and development modelACRN vMeet-Up EU 2021 - community and development model
ACRN vMeet-Up EU 2021 - community and development model
 
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enablingACRN vMeet-Up EU 2021 - hypervisor new platform enabling
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
 
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introductionACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
 
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look ForwardACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
 
ACRN Kata Container on ACRN
ACRN Kata Container on ACRNACRN Kata Container on ACRN
ACRN Kata Container on ACRN
 
Project ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introductionProject ACRN Yocto Project meta-acrn layer introduction
Project ACRN Yocto Project meta-acrn layer introduction
 
Project ACRN USB mediator introduction
Project ACRN USB mediator introductionProject ACRN USB mediator introduction
Project ACRN USB mediator introduction
 
Project ACRN system debug
Project ACRN system debugProject ACRN system debug
Project ACRN system debug
 
Project ACRN SR-IOV on ACRN
Project ACRN SR-IOV on ACRNProject ACRN SR-IOV on ACRN
Project ACRN SR-IOV on ACRN
 
Project ACRN Device Model architecture introduction
Project ACRN Device Model architecture introductionProject ACRN Device Model architecture introduction
Project ACRN Device Model architecture introduction
 
Project ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config toolProject ACRN configuration scenarios and config tool
Project ACRN configuration scenarios and config tool
 
Project ACRN how to build a Yocto Project-based SOS
Project ACRN how to build a Yocto Project-based SOSProject ACRN how to build a Yocto Project-based SOS
Project ACRN how to build a Yocto Project-based SOS
 
Project ACRN EtherCAT 101
Project ACRN EtherCAT 101Project ACRN EtherCAT 101
Project ACRN EtherCAT 101
 
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOSProject ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN expose and pass through platform hidden PCIe devices to SOS
 
Project ACRN GVT-d introduction and tutorial
Project ACRN GVT-d introduction and tutorialProject ACRN GVT-d introduction and tutorial
Project ACRN GVT-d introduction and tutorial
 

Último

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
chiefasafspells
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Medical / Health Care (+971588192166) Mifepristone and Misoprostol tablets 200mg
 

Último (20)

%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
WSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go PlatformlessWSO2CON2024 - It's time to go Platformless
WSO2CON2024 - It's time to go Platformless
 
WSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - KeynoteWSO2Con204 - Hard Rock Presentation - Keynote
WSO2Con204 - Hard Rock Presentation - Keynote
 
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
Love witchcraft +27768521739 Binding love spell in Sandy Springs, GA |psychic...
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
Abortion Pill Prices Tembisa [(+27832195400*)] 🏥 Women's Abortion Clinic in T...
 
WSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security ProgramWSO2CON 2024 - How to Run a Security Program
WSO2CON 2024 - How to Run a Security Program
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto%in Soweto+277-882-255-28 abortion pills for sale in soweto
%in Soweto+277-882-255-28 abortion pills for sale in soweto
 
%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand%in Midrand+277-882-255-28 abortion pills for sale in midrand
%in Midrand+277-882-255-28 abortion pills for sale in midrand
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
%in Rustenburg+277-882-255-28 abortion pills for sale in Rustenburg
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
Abortion Pills In Pretoria ](+27832195400*)[ 🏥 Women's Abortion Clinic In Pre...
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 

Project ACRN schedule framework introduction

  • 1. ACRN schedule framework introduction Shuo A Liu shuo.a.liu@intel.com Key contributors: Yu Wang, Jason CJ Chen
  • 2. • Goal • Schedule framework • Pcpu resource assignment • Backup Summary
  • 3. ACRN cpu sharing goal 1. Fully utilize the physical cpu resource to support more virtual machines. 2. Keep small footprint for hypervisor, and satisfy FuSa requirements. 3. No impact on real time and FuSa workloads. 4. Simple tiny scheduler algorithm to satisfy embedded device requirements.
  • 4. • Goal • Schedule framework • Pcpu resource assignment • Backup Summary
  • 5. Roles of schedule framework • Follows modularization, we have vcpu layer and schedule layer. • Maintain thread_object state machine. • Abstract scheduler object, easy extend new scheduler algorithms. • Scalable context switch architecture. vcpu layer NOOP scheduler BVT scheduler schedule framework layer high level layers
  • 6. Basic schedule concept VM0 vcpu0 vcpu1 VM1 vcpu0 vcpu1 VM2 vcpu0 vcpu1 per_cpu Real clock Real clock runqueue Real clock runqueue Real clock pcpu0 pcpu1 pcpu2 pcpu3 Context Switch pick vcpu Context Switch pick vcpu Context Switch pick vcpu pick vcpu noop scheduler BVT scheduler per_cpu Context Switch
  • 7. per_cpu Schedule framework relationship diagram vcpu vcpu_id thread_obj … sched_control vcpu vcpu_id thread_obj … thread_object thread_object vcpu vcpu_id thread_obj … sched_bvt_control vcpu vcpu_id thread_obj … thread_object thread_object run_list pcpu_id thread switch_out switch_in status data run_list pcpu_id thread switch_out switch_in status data run_list pcpu_id thread switch_out switch_in status data run_list pcpu_id thread switch_out switch_in status data curr_obj scheduler priv … PCPU2 timer … runqueue sched_bvtPCPU0 vcpu vcpu_id thread_obj … sched_control thread_object per_cpu curr_obj scheduler priv … sched_noop_control … noop_thread_obj sched_noop PCPU1 vcpu vcpu_id thread_obj … sched_control thread_object per_cpu curr_obj scheduler priv … sched_noop_context … noop_thread_obj pcpu_id thread switch_out switch_in status data run_list init deinit init_data deinit_data yield prioritize sleep name pick_next wake name init deinit init_data deinit_data yield prioritize sleep pick_next wake pcpu_id thread switch_out switch_in status data run_list
  • 8. vcpu_array created_vcpu s … acrn_vm type hw name GUID pcpu_bitmap vcpu_num … vm_id vcpu_array created_vcpu s … acrn_vm type hw name GUID pcpu_bitmap vcpu_num … vm_id vcpu_array created_vcpu s … acrn_vm type hw name GUID pcpu_bitmap vcpu_num … vm_id vcpu0 vcpu1 vcpu0 vcpu1 vm_hw_info vm_hw_info vm_hw_info Relationship of vcpu and schedule vcpu0 vcpu1 per_cpu vcpu vcpu_id thread_obj … thread_control thread_object vcpu vcpu_id thread_obj … sched_bvt_control vcpu vcpu_id thread_obj … thread_object thread_object run_list pcpu_id thread switch_out switch_in status data run_list pcpu_id thread switch_out switch_in status data run_list pcpu_id thread switch_out switch_in status data curr_obj scheduler priv … PCPU 2 timer … runqueue sched_bvt name init deinit init_data deinit_data yield prioritize sleep pick_next wake PCPU 0 PCPU 1 PCPU 3
  • 9. Schedule API architecture vcpu layer thread_obj Functionality component layers schedulers layer schedule framework layer scheduler callbacks API for vcpu vcpu API • vcpu derived from thread_obj. • thread_obj is the schedule entity from schedule framework perspective • scheduler is abstracted from schedule framework, several callbacks need to be implemented by each scheduler. API for scheduler Hardware management layer
  • 10. Schedule object state transition THREAD_STS_BLOCKED THREAD_STS_RUNNINGTHREAD_STS_RUNNABLE init Scheduler pick to running run out of timeslice / yield / be preempted
  • 11. Scheduling points & schedule request points Type Points APIs Scheduling points Before VM-Entry I/O request default_idle Schedule request points Scheduler tick S3 sleep/wake Pause/Halt instruction emulation yield/sleep vcpu launch wake Virtual interrupt/exception injection kick/wake EPT flush kick EOI vmexit bitmap update kick Hypercalls(pause_vm/resume_vm) sleep/wake
  • 12. Context Switch Vcpu layer will register the switch_in/switch_out for platform architecture level context switch handling. MSRs IA32_STAR, IA32_LSTAR, IA32_FMASK, IA32_KERNEL_GS_BASE xsave/xrstors X87 state, SSE state and platform specific state components. vmcs switch General registers flags, rbx, rbp, r12, r13, r14, r15, rdi, rsp
  • 13. VCPU Power management • Vcpu C/P state • For noop, pass through then controlled by guest itself. • Hardcode p-state and c-state data table in HV, export to guest through ACPI table by DM. • Forward MSR_IA32_PERF_CTL msr writing of guests to hardware by HV for p-state. • Passthrough c-state IO port writing for c-state. • For BVT, consider to disable C/P-state capability for guest. • Disable p-state and c-state table for guest through virtual ACPI table. • disable mwait capability of guest in CPUID emulation. • MSR_IA32_PERF_CTL emulation will reject the request.
  • 14. FuSa/Security requirements • FuSa • The schedule architecture can guarantee pcpu sharing scheduler will not impact the pcpu which bind with noop scheduler. • Every scheduler will only effect its vcpu_affinity limited pcpu resource. • There has no shared resource between different schedulers. • Schedule/scheduler architecture follows modularization rules. • Security • L1TF and Spectre are needn’t care because they will be handled during VMEXIT&VMENTRY. And hypervisor only support ring0, so needn’t do extra operations during context switching.
  • 15. • Goal • Scheduler framework • Pcpu resource assignment • Backup Summary
  • 16. cpu_affinity • Currently, we do not support vCPU migration; the assignment of vCPU mapping to pCPU is fixed at the time the VM is launched. The statically configured cpu_affinity in the VM configuration defines a superset of pCPUs that the VM is allowed to run on. One bit in this bitmap indicates that one pCPU could be assigned to this VM, and the bit number is the pCPU ID. A pre- launched VM is supposed to be launched on exact number of pCPUs that are assigned in this bitmap. The vCPU to pCPU mapping is implicitly indicated: vCPU0 maps to the pCPU with lowest pCPU ID, vCPU1 maps to the second lowest pCPU ID, and so on. • For post-launched VMs, acrn-dm could choose to launch a subset of pCPUs that are defined in cpu_affinity by specifying the assigned pCPUs (-- cpu_affinity option). But it can’t assign any pCPUs that are not included in the VM’s cpu_affinity.
  • 17. cpu_affinity - example Use the following settings to support this configuration in the industry scenario: • Define the default pCPU pool for each VM: #define VM1_CONFIG_CPU_AFFINITY (AFFINITY_CPU(0U) | AFFINITY_CPU(1U)) #define VM2_CONFIG_CPU_AFFINITY (AFFINITY_CPU(2U) | AFFINITY_CPU(3U)) • Offline pcpu2-3 in Service VM. • launch WaaG with “--cpu_affinity 0,1” • launch RT with “--cpu_affinity 2,3” • The devicemodel option “--cpu_affinity” is not a must because they define same pCPU pool with the default value in hypervisor configuration. pCPU0 pCPU1 pCPU2 pCPU3 Service VM + Waag RT Linux
  • 18. QA