KVM platform based virtual machine CPU resource reservation algorithm

2015 
The invention discloses a KVM platform based virtual machine CPU resource reservation algorithm. The algorithm comprises the following steps: obtaining a resource reservation parameter set by a user in a kernel state, calculating a theoretical value of a priority Si of a virtual machine according to a priority formula of the virtual machine, finding a kernel-state task_struct data structure through a process id of the virtual machine, and setting a process priority to be Si; and then, triggering another virtual machine timer task with a t cycle, comparing the theoretical value of the priority Si of the virtual machine with an actual runtime value of the virtual machine in the task, and when the actual runtime value of the virtual machine is greater than or equal to the theoretical value of the priority Si of the virtual machine, recovering a default CFS algorithm from a resource reservation algorithm. By calling a KVM interface to obtain related data in a running process of the virtual machine, the response performance of the virtual machine is improved; and a task with the high priority is ensured to have sufficient resources to complete and execute a target.
    • Correction
    • Source
    • Cite
    • Save
    • Machine Reading By IdeaReader
    0
    References
    0
    Citations
    NaN
    KQI
    []