关闭

An introduction to the credit scheduler in Xen

标签: Xenscheduler
658人阅读 评论(0) 收藏 举报
分类:

An introduction to the credit scheduler in Xen

Credit scheduler provides automatic load balancing of virtual CPUs across physical CPUs on an SMP host. The scheduler awards credit to each VM periodically and charges each VM to run on the CPU.

To be specific, there are four main components: a virtual CPU pool, a physical CPU pool, a credit calculator and a credit scheduler (illustrated in the figure). The credit calculator calculates and updates the credit for every domain per 10ms. The scheduler dispatches the vCPU to a pCPU every 30ms according to their states, i.e., priorities.
这里写图片描述

There are 3 priorities:

  • over state joining at the tail of the scheduling queue.
  • under state allowed to run before any that are out of credit.
  • boost state to give mostly idle vCPUs a chance to run without accumulating too much credit.

In all, the scheduling queue is ordered: BOOST, UNDER, OVER from head to tail.

Credit1
It contains 2 key parameters weight and cap:

  • weight represents the signi cance of a vCPU. I.e., the higher weight a vCPU has, the more pCPU it can consume.
  • cap representsthe maximum amount of pCPU a domain will be able to consume. (Caution: it use an integrity to illustrate percentage. E.g., 100 = 1 pCPU)

Risks for credit1:

  • Too much overhead of context switch for a vCPU running IO-intensive applications. it is because that these vCPU spends much time on IO while a little time computing.
  • Malicious accumulation of credit. In another words, a malicious vCPU can accumulate plenty of credit through staying in idle for a period and then occupy most of the computing resource with purpose of holding back the victim.

Credit2
Credit2 can solve the problems of credit1. It adds 3 extra mechanisms:

  • ratelimite combats this problem by de ning the minimum number of microseconds a VM would be allowed to run uninterrupted before being context switched with the default being 1ms.
  • timeslice allows for tweaking the scheduler. I.e., it can change the scheduling time, which is 30ms by default.
  • a new credit reset condition prevents any VM from accumulating too much credit.

ratelimit and timeslice can be configured with tool xl sched_credit [option]

1
0
查看评论

xen credit scheduler and policy

最近在研究xen的vcpu 调度和cpu qos策略,现在默认的scheduler是credit, 对应的代码是sched_credit.c xen支持好几种控制策略,效果最好的当选pin, 灵活性最好的是weight, 控制和灵活兼备的就是cap,据说人家amazon在06年推ecu的时候就是用...
  • wanjia19870902
  • wanjia19870902
  • 2013-12-13 00:30
  • 2589

Xen's Credit Scheduler

依然是follow source code概念:Credit, Weight, Cap
  • snailhit
  • snailhit
  • 2010-12-30 15:23
  • 3332

Xen Credit调度算法详细说明

Xen虚拟机调度实质上是虚拟CPU的调度。在Xen中,虚拟机通过其拥有的虚拟CPU运行任务,而虚拟CPU需要由Xen调度至物理CPU执行。对应用程序而言CPU调度分成两个层次:首先VMM的虚拟CPU调度将物理CPU时间分配给各虚拟机的虚拟CPU;然后各虚拟机的进程调度负责将虚拟CPU的时间分给虚拟机...
  • lkn910907
  • lkn910907
  • 2015-03-30 10:33
  • 1522

xen credit scheduler 机制

本文转载于wanjia19870902的专栏  写的很好 留着备用 最近在研究xen的vcpu 调度和cpu qos策略,现在默认的scheduler是credit, 对应的代码是sched_credit.c xen支持好几种控制策略,效果最好的当选pin, 灵...
  • rainy0216_2009
  • rainy0216_2009
  • 2014-02-07 13:02
  • 410

Xen中Credit调度算法分析

调度简介       Xen调度不同的虚拟机到处理器上运行,基本方法是虚拟机按时间片运行。Xen通过调度器实现,用户可以根据自己的需要实现不同的调度器,从而实现不同的调度策略。      struct sched...
  • YSBJ123
  • YSBJ123
  • 2016-08-16 09:51
  • 521

Xen Credit调度算法

Credit调度算法的基本原理 Credit调度算法是自Xen3.0版本以来使用的缺省的调度算法,其为一种按比例公平共享的非抢占式调度算法。Credit调度算法为每一个Guest操作系统设置二元组(weight,cap),各个Guest操作系统之间weight的比例决定它们各自占用CP...
  • feiskyer
  • feiskyer
  • 2011-11-19 11:27
  • 864

Xen Introduction

      guest OS是指Xen能够操控的操作系统之一,domain是指一个运行中的虚拟机,在其上有一个guest OS在执行。我们称Xen本身为hypervisor,因为它运行的特权级要比它所操控的guest OS中的supervisor c...
  • gavinwjin
  • gavinwjin
  • 2010-01-11 23:09
  • 691

Linux scheduler(cfs) introduction

要给公司做个cfs培训(偏重于load balance),整了个ppt,图片都是从网上搜的,原作者不详,在此深表歉意。 2 幻灯片3 The Outline l Basic concepts about Linux process ...
  • glmwu
  • glmwu
  • 2014-02-25 22:38
  • 1653

Introduction to the Xen Virtual Machine

By Rami Rosen on Thu, 2005-09-01 01:00. SoftwareEveryones talking about Xen, but the code is complex. Heres a starting point.This article is inten...
  • xianfengdesign
  • xianfengdesign
  • 2007-05-22 23:35
  • 768

《Credit Risk Scorecard》第八章: Scorecard Implementation

第八章: Scorecard Development Process, Stage 6: Scorecard Implementation 这章主要涉及开发后期的分析和处理,主要涉及三个方面: (1) 理解评分卡实现的一些分析(比如稳定性分析)和和商业考虑;  (2)理解评分卡和管理报...
  • hero_fantao
  • hero_fantao
  • 2017-03-31 17:11
  • 452
    个人资料
    • 访问:14604次
    • 积分:348
    • 等级:
    • 排名:千里之外
    • 原创:19篇
    • 转载:1篇
    • 译文:1篇
    • 评论:5条
    文章分类
    最新评论