Method and system for scheduling processes

A process scheduling and process technology, applied in the computer field, can solve the problems of low resource utilization and cannot guarantee the real-time performance of VM, and achieve the effect of avoiding resource waste.

Inactive Publication Date: 2013-12-11
HUAWEI TECH CO LTD
4 Cites 5 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0005] Embodiments of the present invention provide a process scheduling method and system to overcome the problems in ...
View more

Abstract

The embodiment of the invention provides a method and a system for scheduling processes. The method comprises the steps of judging whether real-time processes exist in a VM (Virtual Machine) or not by the VM; when the situation that the real-time processes exist in the VM is determined by the VM, sending a priority adjustment command to an inter-domain sharing module Xenstore through a PV (Para-Virtualization) Driver API (Application Programming Interface) so as to adjust a VCPU (Virtual Central Processing Unit) corresponding to the real-time process into a real-time mode by the Xenstore; sensing that the VCPU is in the real-time mode by a host operation system through the Xenstore, and firstly processing a process corresponding to the VCPU. According to the method and the system, which are provided by the embodiment of the invention, the problem that the real-time performance of all VMs cannot be considered and the problem of low resource utilization rate in the prior art can be overcome.

Application Domain

Resource allocationSoftware simulation/interpretation/emulation

Technology Topic

VirtualizationVirtual machine +10

Image

  • Method and system for scheduling processes
  • Method and system for scheduling processes
  • Method and system for scheduling processes

Examples

  • Experimental program(1)

Example Embodiment

[0037] In order to make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of the embodiments of the present invention, not all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of the present invention.
[0038] The computer designed in the embodiment of the present invention may be a desktop computer, a server, a notebook computer, and the like. The hardware platform of the computer can run at least one host operating system and multiple virtual machines, and each virtual machine can be configured with a virtual machine scheduler and a paravirtualized driver application program interface; the inter-domain sharing module (Xenstore) is The module between each virtual machine and the hardware platform, the host operating system can perceive the information of each VM through Xenstore. The inter-domain sharing module can be an independent software module, or it can be integrated into the host operating system.
[0039] In the embodiment of the present invention, when the state of the VCPU is in real-time mode, the host operating system regards the VCPU as a high-priority VCPU, and will give priority to the process corresponding to the VCPU, and when the state of the VCPU is in non-real-time mode At this time, the host operating system regards the VCPU as a VCPU of normal priority, and processes the processes corresponding to the VCPU in a normal order.
[0040] figure 1 This is a flowchart of Embodiment 1 of the process scheduling method of the present invention, such as figure 1 As shown, the method of this embodiment may include:
[0041] Step 101: The virtual machine judges whether there is a real-time process on the virtual machine.
[0042] Generally, the VM scheduler on the virtual machine can capture the process scheduling. Specifically, the VM scheduler capture can determine the scheduling priority of the process to be processed when a process switch occurs in the VCPU. If the scheduling priority of the process is high, then It can be judged that the process is a real-time process.
[0043] When the virtual machine determines that there is no real-time process on the virtual machine, it can do nothing, and each process will be processed in a normal order.
[0044] Step 102: When the virtual machine determines that there is a real-time process, it sends a priority adjustment instruction to the inter-domain sharing module Xenstore through the PV Driver API, an application program interface driven by paravirtualization, so that Xenstore corresponds to the real-time process The VCPU is adjusted to real-time mode.
[0045] Among them, the inter-domain shared module Xenstore provides an inter-domain shared module system for virtualization technology (Xen), which stores the configuration information of the hypervisor and front-end and back-end drivers in the form of strings, and stores, for example, the host. And VM block device, network card, central processing unit (CPU), memory and other hardware configuration information.
[0046] After the priority adjustment instruction in step 102 reaches Xenstore, Xenstore can call the priority modification function to adjust the VCPU, and notify the host of the message that the VCPU is adjusted to the real-time mode.
[0047] In specific implementation, the priority adjustment command sent by the PV Driver API of the para-virtualization driver to the inter-domain sharing module Xenstore can be: NICE_change (VCPU_Number), the parameter VCPU_Number in the priority adjustment command is the VCPU number, that is, VCPU Logo.
[0048] The Xenstore adjusts the VCPU corresponding to the real-time process to the real-time mode. Specifically, the VCPU may be marked as the real-time mode through a priority adjustment function, or the priority of the VCPU may be marked as high.
[0049] Step 103: The host operating system perceives that the VCPU is in a real-time mode through the Xenstore, and preferentially processes the process corresponding to the VCPU.
[0050] That is, when the next process switching occurs in the host operating system, the process corresponding to the VCPU that switches to the real-time mode is prioritized.
[0051] When there are multiple VCPUs in real-time mode, that is, when there are real-time processes on multiple VMs, the host operating system can assign multiple real-time processes to multiple PCPUs for processing in turn. If the number of real-time processes is greater than the number of PCPUs , Then these real-time processes can be sorted by trigger time or other rules and then allocated to each PCPU for processing.
[0052] In this embodiment, when the VM determines that there is a real-time process, it sends a priority adjustment instruction to the inter-domain sharing module Xenstore through the PV Driver API, which is an application program interface driven by paravirtualization, so that Xenstore assigns the virtual center corresponding to the real-time process. The processor VCPU is adjusted to the real-time mode, so that the host operating system can perceive that the VCPU is in the real-time mode, so that the process corresponding to the VCPU is processed preferentially, which can ensure the host operating system's timely perception of the real-time processes that need to be processed in the VM. Therefore, the processing sequence of each real PCPU to the process can be adjusted in time. Therefore, the technical defect that the information that needs to be processed by the real-time process of the VM in the prior art cannot be transferred to the host operating system can be solved; and there is no need to combine the PCPU with part of the VCPU Therefore, it can avoid the problem that the real-time process of the VCPU that is not bound to the PCPU is not always given priority, and the real-time performance of all VMs cannot be guaranteed, and it can also avoid the problem of combining PCUP with some parts in the prior art. After VCPU is bound, resources may be wasted due to idleness.
[0053] The following uses a specific usage scenario of the process scheduling method of this embodiment to illustrate the effect of the method of this embodiment.
[0054] For example, on the hardware platform, in addition to the host operating system, three virtual machines are running, and communication software is installed and running on the three virtual machines. In addition, the three virtual machines also run some common processes. At this time, an external terminal initiates a video session invitation to one of the virtual machines. After the virtual machine accepts the invitation, the video session process is performed. If the video is required to be smooth and the session quality is high, the video session process needs to be a real-time process.
[0055] At this time, the virtual machine can determine that there is a real-time process. The virtual machine prioritizes the VCPU that processes the video session process. At the same time, it sends a priority adjustment instruction to Xenstore through the PV Driver API, and Xenstore calls the priority modification function to adjust the VCPU to In real-time mode, for example, the priority of the VCPU is marked as high, and then the control program of the VM management layer, such as Xen Hypervisor, can be used to schedule idle PCPUs to execute processes on the VCPU first. If there is no idle PCPU, you can The PCPU preempts to ensure the processing of the video session process to ensure the smoothness of the video session.
[0056] figure 2 This is a flowchart of the second embodiment of the process scheduling method of the present invention. The method of this embodiment is described in figure 1 On the basis of the illustrated method embodiment, the steps of how to make the priority adjustment function of Xenstore take effect are added, and the method steps of adjusting the real-time status of the VCPU according to the instructions input by the user are further added, such as figure 2 As shown, the method of this embodiment may include:
[0057] Step 201: The process priority adjustment module enables the priority adjustment function of Xenstore to take effect through the virtual script virsh command.
[0058] Specifically, the process priority adjustment module can register the priority modification function to Xenstore through the virsh command.
[0059] Step 202: The process priority adjustment module receives a VCPU state adjustment instruction input by a user, where the VCPU state adjustment instruction includes the identifier of the VM where the VCPU is located and the identifier of the VCPU.
[0060] Specifically, the VCPU state adjustment instruction may be in the form of a command line.
[0061] The VCPU state adjustment instruction may be: adjust the VCPU to a real-time mode. In specific implementation, after adjusting the VCPU to the real-time mode, the real-time mode can always be maintained, that is, the process corresponding to the VCPU can always get the priority processing of the PCPU; or it can further include adjusting the VCPU from the real-time mode to non- Real-time mode instructions, so that users can control whether the VCPU is in real-time mode.
[0062] Optionally, because not all VCPUs allow users to modify the real-time status by manually entering the command line, an authorization table can be maintained in the host operating system, such as the authorization table shown in Table 1. When the authorization table is When the authorization value of the VCPU is 1, it means that the VCPU allows the user to adjust it to real-time mode, or adjust it to non-real-time mode. When the authorization value of the VCPU in the authorization table is 0, it means that the VCPU does not allow the user to It is adjusted to real-time mode or non-real-time mode. In Table 1, the first column is the ID of each VM, the first row is the ID of each VCPU, and the values ​​in the other cells are the authorized values ​​of the corresponding VCPU. For example, the value 1 in the second row and the third column represents the VM's The authorization value of the VCPU identified as VCPU on VM1 and the VCPU identified as VCPU2 is 1, that is, the real-time status of the VCPU allows the user to adjust.
[0063] Authorization value
[0064] Table 1 VCPU real-time status adjustment authorization table
[0065] Therefore, receiving the VCPU state adjustment instruction input by the user may further include an optional step 203:
[0066] Step 203: According to the ID of the VM where the VCPU is located and the ID of the VCPU included in the VCPU status adjustment instruction, query the authorization status of the VCPU in the authorization table to determine whether the real-time status of the VCPU allows the user Adjustment.
[0067] When the step query result is that the real-time status of the VCPU allows the user to adjust, step 204 is executed; when the step query result is that the real-time status of the VCPU does not allow the user to adjust, no operation is performed.
[0068] It should be noted that the above-mentioned "user adjustment is not allowed" refers to the way that the VCPU does not allow the user to pass instructions
[0069] Step 204: The host operating system calls an interface function according to the VCPU state adjustment instruction to make the Xenstore adjust the VCPU to a real-time mode.
[0070] The above steps 202 to 204 are the steps of adjusting the real-time state of the VCPU according to the instructions input by the user in this embodiment, and the subsequent steps 205 to 207 are related to figure 1 The illustrated embodiment is similar to the steps of adjusting the real-time state of the VCPU according to the VM's judgment on the real-time process. The two parts can be executed in parallel without mutual order. These two steps of adjusting the real-time state of the VCPU are for The effect of the host operating system's perception of the real-time status of the VCPU is the same, that is, after the VCPU is adjusted to the real-time mode in any way, the host operating system can perceive it.
[0071] Step 205: The virtual machine judges whether there is a real-time process on the virtual machine.
[0072] Step 206: When the virtual machine determines that there is a real-time process, it sends a priority adjustment instruction to the inter-domain sharing module Xenstore through the PV Driver API, an application program interface driven by paravirtualization.
[0073] Step 207: The Xenstore adjusts the VCPU corresponding to the real-time process to a real-time mode.
[0074] Specifically, the Xenstore adjusts the VCPU to the real-time mode through the priority adjustment function that takes effect in step 201, that is, marks the priority of the VCPU as high through the priority adjustment function.
[0075] Step 208: The host operating system perceives that the VCPU is in a real-time mode through the Xenstore, and preferentially processes the process corresponding to the VCPU.
[0076] In this embodiment, the priority adjustment function of Xenstore is validated by the process priority adjustment module through the virtual script virsh command; by receiving the VCPU status adjustment instruction input by the user, and judging whether the real-time status of the VCPU allows the user to adjust according to the authorization table, If allowed, call the interface function to make the Xenstore adjust the VCPU to the real-time mode, realize the function of allowing the user to manually adjust the real-time status of the VCPU, and ensure the security of the VM through the authorization table.
[0077] image 3 It is a schematic structural diagram of Embodiment 1 of the process scheduling system of the present invention, such as image 3 As shown, the process scheduling system 300 of this embodiment may include: a virtual machine scheduler 1, a paravirtualized driver application program interface (PV Driver API) 2, an inter-domain sharing module (Xenstore) 3, and a host operating system (HostOS) 4. Among them,
[0078] The virtual machine scheduler 1 may be used to determine whether there is a real-time process on the virtual machine corresponding to the virtual machine scheduler;
[0079] The para-virtualization-driven application program interface 2 can be used to send a priority adjustment instruction to the inter-domain sharing module Xenstore when the virtual machine scheduler determines that the virtual machine has a real-time process;
[0080] The inter-domain sharing module 3 may be configured to adjust the virtual central processing unit VCPU corresponding to the real-time process to a real-time mode according to the priority adjustment instruction;
[0081] The host operating system 4 can be used to perceive that the VCPU is in a real-time mode through the Xenstore, and to preferentially process the processes corresponding to the VCPU.
[0082] Among them, the virtual machine scheduler 1 and the para-virtualization-driven application program interface 2 are respectively set on each virtual machine. Usually, each virtual machine is configured with a virtual machine scheduler 1 and a para-virtualization-driven application program interface 2 , The number of virtual machines can be one or more; the inter-domain sharing module 3 is a module between each virtual machine and the hardware platform, and the inter-domain sharing module 3 can be an independent software module or integrated in the host operating system In 4, the number of the inter-domain sharing module 3 and the host operating system 4 can be one respectively.
[0083] The process scheduling system of this embodiment can be used to execute figure 1 The implementation principles of the technical solutions of the method embodiments shown are similar and will not be repeated here.
[0084] In the process scheduling system of this embodiment, when the virtual machine scheduler determines that a real-time process exists on the virtual machine, it can send a priority adjustment instruction to Xenstore through the PV Driver API, so that the Xenstore will assign the VCPU corresponding to the real-time process Adjusted to real-time mode, so that the host operating system can perceive that the VCPU is in real-time mode, and prioritize the processes corresponding to the VCPU, which can ensure that the host operating system is aware of the real-time processes that need priority processing in the VM in a timely manner, and thus adjust The processing sequence of each real PCPU to the process, therefore, can solve the technical defect that the information that needs to be processed by the real-time process of the VM in the prior art cannot be transmitted to the host operating system; and, because there is no need to bind the PCPU to some VCPUs Therefore, it can avoid the problem that real-time processes corresponding to VCPUs that are not bound to the PCPU are not always processed by priority, and the real-time performance of all VMs cannot be guaranteed, and it also avoids binding PCUP to some VCPUs in the prior art Later, it may be a problem of resource waste caused by idleness.
[0085] Further, the host operating system 4 may further include: a process priority adjustment module 41, and the process priority adjustment module 41 may be used to validate the priority adjustment function of Xenstore through a virtual script virsh command.
[0086] Further, the host operating system 4 can also be used for:
[0087] Receiving a VCPU state adjustment instruction input by a user, where the VCPU state adjustment instruction includes the identifier of the VM where the VCPU is located and the identifier of the VCPU;
[0088] According to the VCPU state adjustment instruction, an interface function is called to make the Xenstore adjust the VCPU to a real-time mode.
[0089] Further, the host operating system 4 may be specifically used for:
[0090] Query the authorization status of the VCPU in the authorization table according to the identifier of the VM where the VCPU is located and the identifier of the VCPU included in the VCPU status adjustment instruction;
[0091] When the authorization status of the VCPU is allowed to be modified, according to the VCPU status adjustment instruction, an interface function is called to make the Xenstore adjust the VCPU to the real-time mode.
[0092] The process scheduling system of this embodiment can be used to execute figure 2 The implementation principles and technical effects of the technical solutions of the illustrated method embodiments are similar, and will not be repeated here.
[0093] A person of ordinary skill in the art can understand that all or part of the steps in the foregoing method embodiments can be implemented by a program instructing relevant hardware. The aforementioned program can be stored in a computer readable storage medium. When the program is executed, it executes the steps including the foregoing method embodiments; and the foregoing storage medium includes: ROM, RAM, magnetic disk, or optical disk and other media that can store program codes.
[0094] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand: It is still possible to modify the technical solutions described in the foregoing embodiments, or equivalently replace some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the technical solutions of the embodiments of the present invention. range.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Voice control method, device and system

Owner:深圳市普瑞恩科技有限公司

Wireless fidelity WI-FI sharing method and device

InactiveCN105682233AAvoid wasting resources
Owner:HANGZHOU TREE BEAR NETWORK

Treatment method for unqualified silicon wafers

ActiveCN104157739AAvoid wasting resourcesImprove production pass rate
Owner:HAINAN YINGLI NEW ENERGY

Classification and recommendation of technical efficacy words

  • Avoid wasting resources

Visual detection equipment of circuit board

Owner:GUANGDONG LYRIC ROBOT INTELLIGENT AUTOMATION CO LTD

WEB GIS-based information management system of bridges in region

InactiveCN101916398AAvoid resource lossAvoid wasting resources
Owner:CCCC HIGHWAY CONSULTANTS

Cooperative transmission routing method for wireless sensor network based on multi-relay multi-hop

ActiveCN106993320AAvoid wasting resourcesAlleviate excessive energy consumption
Owner:JIANGSU COMSOFT TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products