SlideShare a Scribd company logo
4
Most read
5
Most read
7
Most read
BVT scheduler
Chen,Conghui
Conghui.chen@intel.com
Software Engineer
3/3/2020
Agenda
❑ Background
❑ IORR brief introduce
❑ BVT algorithm
❑ Evaluation
Background
VM1
vcpu0 vcpu1
VM2
vcpu0 vcpu1
runqueue
Real clock
runqueue
Real clock
pcpu0 pcpu1
Context Switch
pick vcpu
Context Switch
pick vcpu
IORR/BVT scheduler
In ACRN scheduler framework:
1.Each vCPU in VM is pinned to a
unique pCPU.
2.Two vCPUs in one VM cannot
share one pCPU.
3.Migration is currently not support,
so, load balance is not implemented.
IORR
• IORR is an I/O sensitive Round-Robin Scheduler. vCPU with I/O request has
highest priority, thus can achieve high I/O performance (throughput and
latency).
• A period tick timer is created for each pCPU, a vCPU can run for at most a
period of time, (default 10ms) and the next vCPU in RUNQ can be
scheduled.
I/O CPUI/O I/O CPU CPURUNQ
Defects:
• Unfair
• I/O attack: Use I/O to maliciously preempt pCPU resources
• vCPU with CPU bound workload will suffer starvation when
sharing pCPU with vCPU with I/O bound workload.
BVT
borrowed-virtual-time (BVT) : a general-purpose scheduling algorithm that allows a single
operating system to support the diverse range of applications, and thus a candidate “universal”
processor scheduler.
•Virtual time thread with earliest effective virtual time (EVT) is dispatched first.
•Warp a latency-sensitive thread is allowed to warp back in virtual time to make it appear earlier.
It borrows virtual time from its future CPU allocation and thus does not disrupt long-term CPU
sharing.
•MCU minimum charging unit, the scheduler account for running time in units of mcu.
•Weighted fair sharing Each runnable thread receives a share of the processor in proportion to
its weight wi over a scheduling window of some number of mcu.
•C context switch allowance. Real time by which the current thread is allowed to advance
beyond another runnable thread with equal claim on the CPU. C is similar to the quantum in
conventional timesharing.
* Paper: Borrowed-Virtual-Time (BVT) scheduling: supporting latency-
sensitive threads in a general-purpose scheduler
BVT-- Weighted fair sharing
C is 2mcu
Weight for gcc: bigsim is 2:1
Gcc: 2 + 6 + 6 + 4 = 18
Bigsim: 3 + 3 + 3 = 9
AVT: actual virtual time
EVT: effective virtual time
AVT for current running thread is
incremented by its running time
divides by weight.
Context switch occur when the
running thread passes the waiting
thread by one C.
Rules:
52 11 14 20 23
A
B
C
BVT – sleep/wakeup
When thread i becomes runnable after sleeping
where scheduler virtual time (SVT) is a scheduler
variable indicating the minimum AVT of any runnable
thread. This adjustment prevents a thread from claiming
an excessive share of the CPU after sleeping for a long
time as might happen if there was no adjustment.
BVT – low latency dispatch
A thread is created with a non-zero warp Wi to
give it dispatch preference. Larger warp values
provide lower latency dispatch than smaller values.
evt = avt - 50
Test data (20s)
* As the warp is disabled, evt = avt
BVT – run data from ACRN
Evaluation
• Env:
• RAM/VM: 1G
• Network: virtio-net LAN
• Disk: virtio-block file
• Platform: NUC7i7DNH1E
• CPU: turbo off, CPU freq fixed (1.9Ghz)
• 1 Core (offline 1-3)
• Tools:
• I/O
• Iperf
• ping
• CPU
• sysbench
Case Target Methods Run VM
1 I/O throughput Iperf3 -c $serverip -t 60 -i 1
iperf3 -c $serverip -t 60 -i 1 -u -b 1G -P 10
• Native (only start sos)
• VM1-VM3 together
2 I/O latency ping $ip -c 60 -i 1 • Native (only start sos)
• VM1-VM3 together
3 CPU throughput sysbench cpu --cpu-max-prime=20000 --
threads=1 --time=30 run
• Native (only start sos)
• VM1-VM3 together
Evaluation
CPU VM1/Native VM2/Native VM3/Native VM/Native
IORR 24.9% 24.1% 42.2% 91.2%
BVT 29.9% 30.7% 31.4% 92%
Fairness:
•BVT > IORR
CPU Throughput:
•BVT > IORR
0.00%
20.00%
40.00%
60.00%
80.00%
100.00%
VM1/Native VM2/Native VM3/Native VM/Native
sysbench
IORR BVT
Send
(Mbit/s)
VM1/Native VM2/Native VM3/Native VM/native
IORR 34.1% 32.8% 34.6% 101.5%
BVT 34.1% 32.3% 34.1% 100.6%
Evaluation
Evaluation
* 60s ping latency
BVT – in ACRN
File: acrn-hypervisor/hypervisor/common/sched_bvt.c
LOC: 302
struct acrn_scheduler sched_bvt = {
.name = "sched_bvt",
.init = sched_bvt_init,
.init_data = sched_bvt_init_data,
.pick_next = sched_bvt_pick_next,
.sleep = sched_bvt_sleep,
.wake = sched_bvt_wake,
.deinit = sched_bvt_deinit,
};
Q & A

More Related Content

PDF
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
PDF
Project ACRN GVT-d introduction and tutorial
PDF
Project ACRN hypervisor introduction
PDF
ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
PDF
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
PDF
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
PDF
Project ACRN Device Passthrough Introduction
PDF
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot
ACRN vMeet-Up EU 2021 - Real Time Management and Performance Optimization
Project ACRN GVT-d introduction and tutorial
Project ACRN hypervisor introduction
ACRN vMeet-Up EU 2021 - debug ACRN hypervisor
ACRN vMeet-Up EU 2021 - Bridging Orchestrator and Hard Realtime Workload Cons...
ACRN vMeet-Up EU 2021 - shared memory based inter-vm communication introduction
Project ACRN Device Passthrough Introduction
ACRN vMeet-Up EU 2021 - Boot Process and Secure Boot

What's hot (20)

PDF
Project ACRN system debug
PDF
Project ACRN I2C mediator introduction
PDF
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
PDF
Project ACRN: SR-IOV implementation
PDF
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
PDF
Project ACRN Device Model architecture introduction
PDF
ACRN vMeet-Up EU 2021 - installation and configuration introduction
PDF
Project ACRN USB mediator introduction
PDF
Project ACRN configuration scenarios and config tool
PDF
ACRN Kata Container on ACRN
PDF
Project ACRN expose and pass through platform hidden PCIe devices to SOS
PDF
Project ACRN how to build a Yocto Project-based SOS
PDF
Project ACRN CSE Virtualization
PDF
ACRN vMeet-Up EU 2021 - functional safety design and certification plan
PDF
Project ACRN Yocto Project meta-acrn layer introduction
PDF
XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...
PDF
Project ACRN EtherCAT 101
PPTX
Link Virtualization based on Xen
PDF
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
PDF
Embedded Systems Conference 2014 Presentation
Project ACRN system debug
Project ACRN I2C mediator introduction
ACRN vMeet-Up EU 2021 - hypervisor new platform enabling
Project ACRN: SR-IOV implementation
ACRN vMeet-Up EU 2021 - Introduction and Architecture Look Forward
Project ACRN Device Model architecture introduction
ACRN vMeet-Up EU 2021 - installation and configuration introduction
Project ACRN USB mediator introduction
Project ACRN configuration scenarios and config tool
ACRN Kata Container on ACRN
Project ACRN expose and pass through platform hidden PCIe devices to SOS
Project ACRN how to build a Yocto Project-based SOS
Project ACRN CSE Virtualization
ACRN vMeet-Up EU 2021 - functional safety design and certification plan
Project ACRN Yocto Project meta-acrn layer introduction
XPDDS18: The Evolution of Virtualization in the Arm Architecture - Julien Gra...
Project ACRN EtherCAT 101
Link Virtualization based on Xen
SR-IOV: The Key Enabling Technology for Fully Virtualized HPC Clusters
Embedded Systems Conference 2014 Presentation
Ad

Similar to Project ACRN CPU sharing BVT scheduler in ACRN hypervisor (20)

PDF
Project ACRN schedule framework introduction
PPTX
Realtime scheduling for virtual machines in SKT
PPTX
Demand-Based Coordinated Scheduling for SMP VMs
PPTX
OVN operationalization at scale at eBay
PDF
See what happened with real time kvm when building real time cloud pezhang@re...
PDF
Docker, JVM and CPU
PDF
Achieving the Ultimate Performance with KVM
PDF
Achieving the Ultimate Performance with KVM
PDF
XPDDS18: Real Time in XEN on ARM - Andrii Anisov, EPAM Systems Inc.
PDF
20160503 Amazed by AWS | Tips about Performance on AWS
PDF
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
PPTX
ch2.pptx
PDF
QGATE 0.3: QUANTUM CIRCUIT SIMULATOR
PDF
VMworld 2013: Extreme Performance Series: Network Speed Ahead
PDF
Eco-friendly Linux kernel development
PPTX
Ovs perf
PDF
100Gbps OpenStack For Providing High-Performance NFV
PDF
Advanced performance troubleshooting using esxtop
PDF
booting-booster-final-20160420-0700
PDF
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Project ACRN schedule framework introduction
Realtime scheduling for virtual machines in SKT
Demand-Based Coordinated Scheduling for SMP VMs
OVN operationalization at scale at eBay
See what happened with real time kvm when building real time cloud pezhang@re...
Docker, JVM and CPU
Achieving the Ultimate Performance with KVM
Achieving the Ultimate Performance with KVM
XPDDS18: Real Time in XEN on ARM - Andrii Anisov, EPAM Systems Inc.
20160503 Amazed by AWS | Tips about Performance on AWS
XPDS13: On Paravirualizing TCP - Congestion Control on Xen VMs - Luwei Cheng,...
ch2.pptx
QGATE 0.3: QUANTUM CIRCUIT SIMULATOR
VMworld 2013: Extreme Performance Series: Network Speed Ahead
Eco-friendly Linux kernel development
Ovs perf
100Gbps OpenStack For Providing High-Performance NFV
Advanced performance troubleshooting using esxtop
booting-booster-final-20160420-0700
Advancedperformancetroubleshootingusingesxtop 101110131727-phpapp02
Ad

Recently uploaded (20)

PDF
top salesforce developer skills in 2025.pdf
PDF
How Creative Agencies Leverage Project Management Software.pdf
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPT
Introduction Database Management System for Course Database
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
ai tools demonstartion for schools and inter college
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Digital Strategies for Manufacturing Companies
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
System and Network Administraation Chapter 3
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
Online Work Permit System for Fast Permit Processing
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PPTX
ISO 45001 Occupational Health and Safety Management System
top salesforce developer skills in 2025.pdf
How Creative Agencies Leverage Project Management Software.pdf
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
Audit Checklist Design Aligning with ISO, IATF, and Industry Standards — Omne...
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Introduction Database Management System for Course Database
CHAPTER 2 - PM Management and IT Context
Design an Analysis of Algorithms II-SECS-1021-03
ai tools demonstartion for schools and inter college
Navsoft: AI-Powered Business Solutions & Custom Software Development
Digital Strategies for Manufacturing Companies
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
System and Network Administraation Chapter 3
Odoo Companies in India – Driving Business Transformation.pdf
Online Work Permit System for Fast Permit Processing
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
How to Choose the Right IT Partner for Your Business in Malaysia
Which alternative to Crystal Reports is best for small or large businesses.pdf
ISO 45001 Occupational Health and Safety Management System

Project ACRN CPU sharing BVT scheduler in ACRN hypervisor

  • 2. Agenda ❑ Background ❑ IORR brief introduce ❑ BVT algorithm ❑ Evaluation
  • 3. Background VM1 vcpu0 vcpu1 VM2 vcpu0 vcpu1 runqueue Real clock runqueue Real clock pcpu0 pcpu1 Context Switch pick vcpu Context Switch pick vcpu IORR/BVT scheduler In ACRN scheduler framework: 1.Each vCPU in VM is pinned to a unique pCPU. 2.Two vCPUs in one VM cannot share one pCPU. 3.Migration is currently not support, so, load balance is not implemented.
  • 4. IORR • IORR is an I/O sensitive Round-Robin Scheduler. vCPU with I/O request has highest priority, thus can achieve high I/O performance (throughput and latency). • A period tick timer is created for each pCPU, a vCPU can run for at most a period of time, (default 10ms) and the next vCPU in RUNQ can be scheduled. I/O CPUI/O I/O CPU CPURUNQ Defects: • Unfair • I/O attack: Use I/O to maliciously preempt pCPU resources • vCPU with CPU bound workload will suffer starvation when sharing pCPU with vCPU with I/O bound workload.
  • 5. BVT borrowed-virtual-time (BVT) : a general-purpose scheduling algorithm that allows a single operating system to support the diverse range of applications, and thus a candidate “universal” processor scheduler. •Virtual time thread with earliest effective virtual time (EVT) is dispatched first. •Warp a latency-sensitive thread is allowed to warp back in virtual time to make it appear earlier. It borrows virtual time from its future CPU allocation and thus does not disrupt long-term CPU sharing. •MCU minimum charging unit, the scheduler account for running time in units of mcu. •Weighted fair sharing Each runnable thread receives a share of the processor in proportion to its weight wi over a scheduling window of some number of mcu. •C context switch allowance. Real time by which the current thread is allowed to advance beyond another runnable thread with equal claim on the CPU. C is similar to the quantum in conventional timesharing. * Paper: Borrowed-Virtual-Time (BVT) scheduling: supporting latency- sensitive threads in a general-purpose scheduler
  • 6. BVT-- Weighted fair sharing C is 2mcu Weight for gcc: bigsim is 2:1 Gcc: 2 + 6 + 6 + 4 = 18 Bigsim: 3 + 3 + 3 = 9 AVT: actual virtual time EVT: effective virtual time AVT for current running thread is incremented by its running time divides by weight. Context switch occur when the running thread passes the waiting thread by one C. Rules: 52 11 14 20 23 A B C
  • 7. BVT – sleep/wakeup When thread i becomes runnable after sleeping where scheduler virtual time (SVT) is a scheduler variable indicating the minimum AVT of any runnable thread. This adjustment prevents a thread from claiming an excessive share of the CPU after sleeping for a long time as might happen if there was no adjustment.
  • 8. BVT – low latency dispatch A thread is created with a non-zero warp Wi to give it dispatch preference. Larger warp values provide lower latency dispatch than smaller values. evt = avt - 50
  • 9. Test data (20s) * As the warp is disabled, evt = avt BVT – run data from ACRN
  • 10. Evaluation • Env: • RAM/VM: 1G • Network: virtio-net LAN • Disk: virtio-block file • Platform: NUC7i7DNH1E • CPU: turbo off, CPU freq fixed (1.9Ghz) • 1 Core (offline 1-3) • Tools: • I/O • Iperf • ping • CPU • sysbench Case Target Methods Run VM 1 I/O throughput Iperf3 -c $serverip -t 60 -i 1 iperf3 -c $serverip -t 60 -i 1 -u -b 1G -P 10 • Native (only start sos) • VM1-VM3 together 2 I/O latency ping $ip -c 60 -i 1 • Native (only start sos) • VM1-VM3 together 3 CPU throughput sysbench cpu --cpu-max-prime=20000 -- threads=1 --time=30 run • Native (only start sos) • VM1-VM3 together
  • 11. Evaluation CPU VM1/Native VM2/Native VM3/Native VM/Native IORR 24.9% 24.1% 42.2% 91.2% BVT 29.9% 30.7% 31.4% 92% Fairness: •BVT > IORR CPU Throughput: •BVT > IORR 0.00% 20.00% 40.00% 60.00% 80.00% 100.00% VM1/Native VM2/Native VM3/Native VM/Native sysbench IORR BVT
  • 12. Send (Mbit/s) VM1/Native VM2/Native VM3/Native VM/native IORR 34.1% 32.8% 34.6% 101.5% BVT 34.1% 32.3% 34.1% 100.6% Evaluation
  • 14. BVT – in ACRN File: acrn-hypervisor/hypervisor/common/sched_bvt.c LOC: 302 struct acrn_scheduler sched_bvt = { .name = "sched_bvt", .init = sched_bvt_init, .init_data = sched_bvt_init_data, .pick_next = sched_bvt_pick_next, .sleep = sched_bvt_sleep, .wake = sched_bvt_wake, .deinit = sched_bvt_deinit, };
  • 15. Q & A