Hwanju Kim, Jinkyu Jeong, Jaeho Hwang, Joonwon Lee, and Seungryoul Maeng, “Scheduler Support for Video-oriented Multimedia on Client-side Virtualization”, ACM Multimedia Systems (MMSys), Chapel Hill, North Carolina, USA, Feb. 2012.
Presentation on how to chat with PDF using ChatGPT code interpreter
Scheduler Support for Video-oriented Multimedia on Client-side Virtualization
1. Scheduler Support for
Video-oriented Multimedia on
Client-side Virtualization
Hwanju Kim1, Jinkyu Jeong1, Jaeho Hwang1, Joonwon Lee2,
and Seungryoul Maeng1
Korea Advanced Institute of Science and Technology (KAIST)1
Sungkyunkwan University2
ACM Multimedia Systems (MMSys)
February, 22-24, Chapel Hill, North Carolina, USA
2. Virtualization Everywhere
• A new layer between OS and HW
=hypervisor
Multiple OSes
VM
VM
High resource utilization
OS
OS
Strong Isolation
Easy management
Hypervisor
Live maintenance
Fast provisioning
…
Server-side virtualization
Client-side virtualization
Cloud computing
Virtual desktop infrastructure
2/22
3. Client-side Virtualization
• Multiple OS instances on a local device
• Primary use cases
• Different OSes for application compatibility
• Consolidating business and personal
computing environments on a single device
• BYOD: Bring Your Own Device
Managed
domain
Business
Personal
VM
VM
Hypervisor
3/22
4. Multimedia on Virtualized Clients
• Multimedia is ubiquitous on any VM
Video
Data Video
Playback
Compilation Processing 3D game
conference
Downloading
Windows
Linux
Business
Personal
Business
Personal
VM
VM
VM
VM
VM
VM
Hypervisor
Hypervisor
Hypervisor
1. Multimedia workloads are dominant on virtualized clients
2. Interactive systems can have concurrently mixed workloads
4/22
5. Issues on Multi-layer Scheduling
• A multimedia-agnostic hypervisor invalidat
es OS policies for multimedia
VM
VM
Larger CPU proportion
& Timely dispatching
Task
Task
Task
Task
OS
OS
scheduler
Scheduler
Task
Task
Virtual CPU
Virtual CPU
BVT [SOSP’99] OS scheduler
Additional
SMART [TOCS’03] abstraction
Hypervisor
Rialto [SOSP’97]
BEST [MMCN’02] CPU
Scheduler
HuC [TOMCCAP’06]
Redline [OSDI’08] CPU
RSIO [SIGMETRICS’10] I’m unaware of any multimedia
Windows MMCSS -specific OS policies in a VM,
since I see each VM as a black
Semantic gap!
box.
5/22
6. Multimedia-agnostic Hypervisor
• Multimedia QoS degradation Video playback
Competing
• Two VMs with equal CPU shares
or 3D game
workloads
• Multimedia VM + Competing VM VM
VM
Xen hypervisor
Credit scheduler
Video playback (720p)
on VLC media player
Quake III Arena (demo1)
30 100
90
25 80
Average FPS
Average FPS
70
20
60
15 50
40
10 30
20
5
10
0 0
Competing workloads in another VM
Competing workloads in another VM
6/22
7. Possible Solutions to Semantic Gap
• Explicit vs. Implicit
Explicit
Explicit
Implicit
OS cooperation
User involvement
Hypervisor-only
VM
VM
VM
OS scheduler
OS scheduler
OS scheduler
Workload monitor
Hypervisor
Hypervisor
Hypervisor
Scheduler
Scheduler
Scheduler
+ Accurate
+ Simple
+ Transparency
- OS modification
- Inconvenient
- Difficult to identify
- Infeasible w/o
- Unsuitable for
workload demands
multimedia-friendly
dynamic workloads
at the hypervisor
OS schedulers
7/22
8. Proposed Approach
• Multimedia-aware hypervisor scheduler
• Transparent scheduler support for multimedia
• No modifications to upper layer SW (OS & apps)
• “Feedback-driven VM scheduling”
VM
VM
VM
Scheduling command
(e.g., CPU share or priority)
Hypervisor
Multimedia
Multimedia
CPU
manager
monitor
scheduler
(feedback-driven)
Challenges
Estimated 1. How to estimate multimedia QoS
multimedia QoS
based on a small set of HW events?
Audio
Video
CPU
2. How to control CPU scheduler
based on the estimated information
8/22
9. Multimedia QoS Estimation
• What is estimated as multimedia QoS?
• “Display rate” (i.e., frame rate)
• Used by HuC scheduler [TOMCCAP’06]
• How is a display rate captured at the
hypervisor?
• Two types of display
1. Memory-mapped
2. GPU-accelerated
display
display
(e.g., video playback)
(e.g., 3D game)
Display
Graphics
interface
Library
Memory-mapped
Acceleration
Framebuffer
unit
Video device
9/22
10. Memory-mapped Display (1/2)
• How to estimate a display update rate on
the memory-mapped framebuffer
• Write-protection for virtual address space
mapped to framebuffer
Display interface
write
The hypervisor can inspect any attempt to map memory
Virtual address space
Write-protection
Hypervisor
Sampling to reduce trap overheads
page fault handler (1/128 pages, by default)
{ Framebuffer
Update display rate memory
}
10/22
11. Memory-mapped Display (2/2)
• Accurate estimation
• Maintaining display rate per task
• An aggregated display rate does not Task
10 FPS
represent multimedia QoS
Task
25 FPS
• Tracking guest OS task at the hypervisor
• Inspecting address space switches (Antfarm [USENIX’06])
• Monitoring audio access (RSIO [SIGMETRIC’10])
• Inspecting audio buffer access with write-protection
• A task with a high display rate and audio access
à a multimedia task
11/22
12. GPU-accelerated Display (1/2)
• Naïve method
• Inspecting GPU command buffer with
write-protection or polling
• Too heavy due to huge amount of GPU commands
• Lightweight method
• Little overhead, but less accuracy
• 3D games are less sensitive to frame rate degradation
than video playback
• GPU interrupt-based estimation
• An interrupt is typically used for an application to
manage buffer memory
• Hypothesis
• “A GPU interrupt rate is in proportion to a display rate”
12/22
13. GPU-accelerated Display (2/2)
• Linear relationship between display rates
and GPU interrupt rates
Intel GMA 950
Nvidia 6150 Go
PowerVR
(Apple MacBook)
(HP Pavillion tablet)
(Samsung GalaxyS)
Quake3 demo1 (640x480) Quake3 demo1 (640x480) 400 Quake3 demo4 (320x240)
# of GPU interrupt / sec
# of GPU interrupt / sec
# of GPU interrupt / sec
12000 Quake3 demo2 (640x480) 160 Quake3 demo2 (640x480) 350
10000 Quake3 demo4 (640x480)
Quake3 demo1 (1024x768) 140 Quake3 demo1 (1024x768) 300
8000 250
120
200
6000
100 150
4000
100
2000 80
50
0 60 0
0 20 40 60 A GPU interrupt rate can be used to estimate 20 display rate
80 100 0 a 0 20
40 6040 60 80 100
FPS
without additional overheads
FPS
FPS
• Exponential weighted moving average
(EWMA) is used to reduce fluctuation
• EWMAt = (1-w) x EWMAt-1 + w x current value 13/22
14. Multimedia Manager
• A feedback-driven CPU allocator
• Base assumption
• “Additional CPU share (or higher priority) improves
a display rate”
• Desired frame rate (DFR)
• A currently achievable display rate
• Multiplied by tolerable ratio (0.8)
/* Exceptional cases:
* 1) No relationship between CPU
and FPS IF current FPS < previous FPS AND
* 2) FPS is saturated below DFR
* 3) Local CPU contention in a VM
*/
current FPS < DFR THEN
If in initial phase Then
If no FPS improvement by CPU
Increase CPU share Exponential increase
share increase (3 times) Then
Decrease CPU share by half
Else
Linear increase
14/22
15. Priority Boosting
• Responsive dispatching
• Problem
• The hypervisor does not distinguish the types of
events for priority boosting
• A VM that will handle a multimedia event cannot preempt
a currently running VM handling a normal event.
• Higher priority for multimedia-related events
• e.g., video, audio, one-shot timer
MMBOOST
Multimedia events
IOBOOST
Other events
Normal
Based on remaining CPU shares
Priority
priority
15/22
16. Evaluation
• Experimental environment
• Intel MacBook with Intel GMA 950
• Xen 3.4.0 with Ubuntu 8.04
• Implementation based on Xen Credit scheduler
• Two-VM scenario
• One with direct I/O + one with indirect (hosted) I/O
• Presenting the case of direct I/O in this talk
• See the paper for the details of the indirect I/O case
16/22
18. Estimation Overhead
• CPU overhead caused by page faults
• Video playback
• 0.3~1% with sampling
• Less than 5% with tracking all pages
All
Sampling
Overhead
pages
1/8 pages 1/32 pages 1/128 pages
Low resolution
4.95% 1.10% 0.54% 0.58%
(640x354)
High resolution
3.91% 1.04% 0.69% 0.33%
(1280x720)
18/22
20. Performance Improvement
• Performance improvement
Video playback
Competing
or 3D game
workloads
• Closed to maximum achievable VM
VM
frame rates Hypervisor
Video playback (720p)
on VLC media player
Quake III Arena (demo1)
Credit scheduler
Credit scheduler
Credit scheduler w/ multimedia support
Credit scheduler w/ multimedia support
25
100
20
Average FPS
Average FPS
80
15
60
10 40
5 20
0 0
Competing workloads in another VM
Competing workloads in another VM
20/22
21. Limitations & Discussion
• Network-streamed multimedia
• Additional preemption support required for
multimedia-related network packets
• Multiple multimedia workloads in a VM
• Multimedia manager algorithm should be
refined to satisfy QoS of mixed multimedia
workloads in the same VM
• Adaptive management for SMP VMs
• Adaptive vCPU allocation based on hosted
multimedia workloads
21/22
22. Conclusions
• Demands for multimedia-aware hypervisor
• Multimedia are increasingly dominant in
virtualized systems
• “Multimedia-friendly hypervisor scheduler”
• Transparent and lightweight multimedia support
on client-side virtualization
• Future directions
• Multimedia for server-side VDI
• Multicore extension for SMP VMs
• Considerations for network-streamed multimedia
22/22
26. Task-based Display Rate Management
• Different types of frame rate accounting
For Unix-like OSes, a display rate is
accounted to a previously scheduled task
when a framebuffer write is observed
(this heuristic works well because a display
interface is interactive and is highly likely
to be scheduled promptly on requests)
Video playback (640x354) + Directory listing on the screen (ls –alR /)
(w/ CPU-bound VM)
Real FPS Estimated FPS
30
25
20
FPS
15
10
5 Error rate = 1.78%
0
0 5 10 15 20 25 30 35 40 45 50 55 60 65 70 75 80 85
Time (sec)
26/22
27. Local CPU Contention in a VM
• Increasing the number of CPU-bound tasks
with a video playback application
Native Linux
Virtualized Linux w/ our scheme
Ø Our scheme provides sufficient CPU to a VM (IDD) that hosts a multimedia workload
even though local CPU contention increases
Ø No starvation of another CPU-bound VM (guest) 27/22