Database Reference
In-Depth Information
Xen's Credit Scheduler (CS) is more involved than SEDF. First, when creating a
VM, each vCPU in the VM is configured with two properties, the weight and the
cap . The weight determines the share of a pCPU's capacity that should be provided
to a vCPU. For instance, if two vCPUs, vCPU-1 and vCPU-2 are specified with
weights of 256 (the default) and 128, respectively, vCPU-1 will obtain double the
shares of vCPU-2. Weights can range from 1 to 65535. The cap determines the total
percentage of a pCPU that should be given to a vCPU. The cap can modify the
behavior of the weight. Nevertheless, a vCPU can be kept uncapped.
CS converts each vCPU's weight to credits. Credits will be deducted from a vCPU
as long as it is running. A vCPU is marked as over once it runs out of credits and
under otherwise. CS maintains a queue per each pCPU (assuming a chip multipro-
cessors architecture) and stores all under vCPUs first, followed by all over vCPUs.
CS operates by picking the first under vCPU in the queue to go next. CS keeps track
of each vCPU's credits, and when switching a vCPU out, it places it in the queue at
the end of the appropriate category. Finally, CS applies load balancing by allowing
a pCPU with no under vCPUs to pull under vCPUs from queues of other pCPUs.
Xen is an open-source hypervisor. Hence, it is possible to devise and add your
own scheduler. Chisnall [16] provides an excellent and comprehensive coverage of
Xen's internals as well as step-by-step instructions for adding a new scheduler to
Xen.
16.7 MEMORY VIRTUALIZATION
In essence, a VM can be deemed as a generalization of the classical virtual memory
concept. Memory virtualization in a system VM is simply an extension to that con-
cept. Virtual memory in traditional systems distinguishes between the virtual (or
logical) view of memory as seen by a user program and the actual (or physical)
memory as managed by the OS. We next provide a brief overview of virtual memory
then delve into memory virtualization in system VMs.
16.7.1 o ne -l evel P age m aPPing
Virtual memory is a well-known virtualization technique supported in most general-
purpose OSs. The basic idea of virtual memory is that each process is provided with
its own virtual address space, broken up into chunks called virtual pages. A page
is a contiguous range of addresses. As shown in Figure 16.17, virtual memory maps
virtual pages to physical pages in what is denoted as a page table. We refer to this as
one-level page mapping between two types of addresses, the virtual and the physi-
cal addresses. Each process in the OS has its own page table. A main observation
pertaining to page tables is that not all virtual pages of a process need to be mapped
to respective physical pages in order for the process to execute. When a process ref-
erences a page that exists in the physical memory (i.e., there is a mapping between
the requested virtual page and the corresponding physical page), a page hit is said to
be attained. Upon a page hit, the requested physical page is fetched from the main
memory with no further actions. In contrary, when a process references a page that
does not exist in the physical memory, a page miss is said to be incurred. Upon a
Search WWH ::




Custom Search