Successfully reported this slideshow.
Your SlideShare is downloading. ×

Project ACRN CPU sharing BVT scheduler in ACRN hypervisor

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 15 Ad

More Related Content

Slideshows for you (20)

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

Advertisement

Recently uploaded (20)

Project ACRN CPU sharing BVT scheduler in ACRN hypervisor

  1. 1. BVT scheduler Chen,Conghui Conghui.chen@intel.com Software Engineer 3/3/2020
  2. 2. Agenda ❑ Background ❑ IORR brief introduce ❑ BVT algorithm ❑ Evaluation
  3. 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. 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. 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. 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. 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. 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. 9. Test data (20s) * As the warp is disabled, evt = avt BVT – run data from ACRN
  10. 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. 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. 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
  13. 13. Evaluation * 60s ping latency
  14. 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. 15. Q & A

×