METHOD, DEVICE AND COMPUTER PROGRAM PRODUCT FOR RESOURCE SCHEDULING

A method, a device, and a computer program product for resource scheduling is disclosed. The method includes determining a job initiated by a virtual machine. The job requests to invoke at least one virtual function in a set of virtual functions associated with the virtual machine and each virtual function in the set of virtual functions is configured to utilize an accelerator resource to provide a single type of acceleration service. The method further includes determining, based on a job type of the job, a first accelerator resource allocated to the at least one virtual function. The accelerator resources required by the virtual functions invoked by the job may then be guaranteed, improving the execution efficiency of the job.

CROSS REFERENCE TO RELATED APPLICATIONS

This application claims priority under 35 U.S.C. § 119 to Chinese Patent Application No. 202110680992.7, filed on Jun. 18, 2021. The contents of Chinese Patent Application No. 202110680992.7 are incorporated by reference in its entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to the field of computers and, more particularly, to a method, a device, and a computer program product for resource scheduling.

BACKGROUND

Accelerator resources are some processing resources with acceleration functions, for example, coprocessors, which are capable of assisting a central processing unit (CPU) in performing some acceleration tasks. A coprocessor is a chip that is capable of relieving a system CPU of a specific processing task. For example, a math coprocessor can perform numerical processing, and a graphics coprocessor (GPU) can handle video drawing. A GPU is a core processor dedicated to graphics or images, and its main task is to accelerate graphics processing speed.

A Quick Assist Technology (QAT) card is also a coprocessor that can be used to accelerate computationally intensive tasks, such as compression and encryption. By adding a QAT card to a system, applications can run faster and the performance and efficiency of the system can be improved. Functions provided by the QAT card may include symmetric encryption, identity authentication, asymmetric encryption, digital signature, public key encryption, lossless data compression, and the like.

SUMMARY

Embodiments of the present disclosure provide a scheme for scheduling resources.

According to an aspect of the present disclosure, a method for resource scheduling is proposed. This method includes: determining a job initiated by a virtual machine, wherein the job requests to invoke at least one virtual function in a set of virtual functions associated with the virtual machine, and each virtual function in the set of virtual functions is configured to utilize an accelerator resource to provide a single type of acceleration service; and determining, based on a job type of the job, a first accelerator resource allocated to the at least one virtual function.

According to another aspect of the present disclosure, an electronic device is proposed. The device includes: at least one processing unit; and at least one memory coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, wherein the instructions, when executed by the at least one processing unit, cause the device to perform actions including: determining a job initiated by a virtual machine, wherein the job requests to invoke at least one virtual function in a set of virtual functions associated with the virtual machine, and each virtual function in the set of virtual functions is configured to utilize an accelerator resource to provide a single type of acceleration service; and determining, based on a job type of the job, a first accelerator resource allocated to the at least one virtual function.

In another aspect of the present disclosure, a computer program product is provided. The computer program product is stored in a non-transitory computer storage medium and includes machine-executable instructions that, when run in a device, cause the device to perform any step of the method described according to the first aspect of the present disclosure.

The Summary is provided to introduce the selection of concepts in a simplified form, which will be further described in the Detailed Description below. The Summary is neither intended to identify key features or essential features of the present disclosure, nor intended to limit the scope of the present disclosure.

DETAILED DESCRIPTION

Preferred embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the preferred embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms without being limited to the embodiments set forth herein. Rather, these embodiments are provided to make the present disclosure more thorough and complete and to fully convey the scope of the present disclosure to those skilled in the art.

The term “include” and variants thereof used herein indicate open-ended inclusion, that is, “including but not limited to.” Unless specifically stated, the term “or” means “and/or.” The term “based on” means “based at least in part on.” The terms “an example embodiment” and “an embodiment” indicate “at least one example embodiment.” The term “another embodiment” indicates “at least one additional embodiment.” The terms “first,” “second,” and the like may refer to different or identical objects. Other explicit and implicit definitions may be included below.

As mentioned earlier, accelerator technologies such as QAT technology have been widely applied in various systems, for example, storage systems with de-duplication applications. Such systems are often built on virtualization technologies. Then, how to deploy and utilize accelerator resources in a virtualized environment becomes an important issue.

FIG.1illustrates a schematic diagram of a portion of example system100in which one or more embodiments of the present disclosure may be implemented. As shown inFIG.1, system100includes accelerator resource110, manager120, and one or more virtual machines.FIG.1illustrates multiple virtual machines130-1,130-2, and130-3. It should be understood that storage system100may also include one or more other components not shown.

Accelerator resource110may include one or more accelerator devices, for example, accelerator devices111-113illustrated inFIG.1. Accelerator resource110may function as a coprocessor for storage system100to relieve some processing tasks for a general purpose processor (not shown). Accelerator resource110may implement acceleration operations for certain specific functions and computations and may achieve higher execution efficiency than the general purpose processor. In one or more embodiments, accelerator resource110may be one or more QAT cards that may perform acceleration for encryption and/or decryption of data, as well as acceleration of compression and/or decompression of data. It should be understood that while in some embodiments of the present disclosure, QAT cards are taken as examples of accelerator resources, the accelerator resources may also be other hardware processing devices that have acceleration functions for specific tasks (such as encryption and decryption, compression, and matrix computation).

As shown inFIG.1, storage system100implements a virtualized environment and includes virtual machines130-1,130-2, and130-3. For ease of description, hereinafter, virtual machines130-1,130-2, and130-3may also be referred to collectively as virtual machines130. Applications can be run on virtual machines130to perform various tasks of system100.

Virtual machines130may initiate multiple types of jobs. These different types of jobs may request the use of accelerator resource110.

Manager120may be implemented by a software module (e.g., a hypervisor) to support the use of accelerator resource110in a virtualized environment.

In a conventional scheme, accelerator resources may be bound to virtual machines. A job initiated by a particular virtual machine may utilize only the accelerator resources pre-allocated to that virtual machine, regardless of whether there are other available accelerator resources in the system. The binding of accelerator resources to virtual machines is usually implemented through pass-through technology or SR-IOV (Single-Root Input/Output Virtualization). In the pass-through technology, virtual machines may be bound directly to one or more physical accelerator devices.

SR-IOV is a commonly used virtualization support technology. Binding based on SR-IOV will be described below with reference toFIG.2.FIG.2illustrates schematic block diagram200of a conventional scheme in which accelerator resources are used. Physical function PF211shown inFIG.2may be considered as a physical accelerator device, e.g., a QAT card. PF211may be virtualized as virtual functions VF221-223.

In the conventional scheme, as shown inFIG.2, a single virtual function (VF) would be bound to a corresponding virtual machine to provide that virtual machine with various types of acceleration services it needs to execute jobs. For example, VF221is bound to virtual machine231, VF222is bound to virtual machine232, and VF223is bound to virtual machine233.

Taking a data protection system as an example, such VFs are used to provide corresponding virtual machines with multiple types of acceleration services, such as a compression service, an encryption service, a decryption service, a hashing service, or a decompression service. In such a design, internal resources cannot be efficiently allocated among multiple services, and thus the performance of individual services cannot be guaranteed. This in turn will cause a decrease in the job execution efficiency of the virtual machine.

To this end, embodiments of the present disclosure provide a resource scheduling scheme to eliminate at least one or more of the above deficiencies. In one or more embodiments of the present disclosure, a job initiated by a virtual machine is determined, wherein the job requests to invoke at least one virtual function in a set of virtual functions associated with the virtual machine, and each virtual function in the set of virtual functions is configured to utilize an accelerator resource to provide a single type of acceleration service. Further, a first accelerator resource allocated to the at least one virtual function is determined based on a job type of the job.

In the resource scheduling scheme proposed in embodiments of the present disclosure, a single virtual function will be used to provide a single type of acceleration service to a virtual machine. In this manner, the accelerator resources allocated to each virtual function can be guaranteed, allowing the performance of the acceleration service to be guaranteed, thereby improving the execution efficiency of jobs.

The basic principles and several example implementations of the present disclosure are described below with reference toFIGS.3to6. It should be understood that these example embodiments are given only to enable those skilled in the art to better understand and thus implement the embodiments of the present disclosure, and are not intended to limit the scope of the present disclosure in any way.

FIG.3illustrates schematic block diagram300of the provision of virtual services according to one or more embodiments of the present disclosure. As shown inFIG.3, physical function (PF)310may be virtualized into multiple virtual functions (VFs). For example, virtual functions (VFs)320-1to320-5are bound to virtual machine330to provide corresponding acceleration services to virtual machine330; and virtual functions (VFs)340-1to340-5are bound to virtual machine350to provide corresponding acceleration services to virtual machine350.

Unlike the conventional approach in which a single virtual function provides multiple acceleration services, in embodiments of the present disclosure, a VF will be configured to provide a single type of acceleration service. Taking data protection as an example, as shown inFIG.3, VF320-1is configured to provide only a compression service, VF320-2is configured to provide only an encryption service, VF320-3is configured to provide only a decryption service, VF320-4is configured to provide only a hashing service, and VF320-5is configured to provide only a decompression service.

Based on this approach, when virtual machine330executes a different type of job, the corresponding VF may be invoked for supporting the execution of that job. For example, when virtual machine330executes a data backup job, VF320-1may be invoked to provide a compression service, VF320-4may be invoked to provide a hashing service, and VF320-5may be invoked to provide a decompression service.

Because a single VF is configured to perform a single type of service, one or more embodiments of the present disclosure can guarantee the performance of each VF, thereby improving the efficiency of the jobs executed by the virtual machine.

Considering that different types of jobs may have different priorities and that different types of jobs may have different levels of demand for different services, a static accelerator resource allocation scheme will therefore not guarantee the execution efficiency of jobs.

One or more embodiments of the present disclosure may determine, according to the types of jobs executed by different virtual machines, a scheme for scheduling accelerator resources among the different virtual machines, thereby enabling dynamic scheduling of accelerator resources among the different virtual machines.

In some examples, system100can determine the corresponding scheduling policy based on the types of jobs executed by the virtual machines. TakeFIG.3as an example, virtual machine330performs, for example, a “data backup” job, while virtual machine350performs a “garbage collection” job. In some embodiments, system100can, for example, determine that the “data backup” job has a higher priority than the “garbage collection” job, and in turn can allocate more accelerator resources to virtual machine330and fewer accelerator resources to virtual machine350.

For example, if the total available accelerator resources are 150 Gbps, system100can allocate 100 Gbps of accelerator resources to virtual machine330and the remaining 50 Gbps of accelerator resources to virtual machine350. In this way, the execution performance of jobs with higher priorities can be guaranteed, thereby improving the overall efficiency of the system.

In some embodiments, the priorities of different job types may be pre-configured by an administrator. As an example, the administrator may specify the priorities corresponding to different job types in different scenarios. For example, the administrator may specify that “data backup” has a higher priority than “garbage collection” in a first scenario, while “data backup” has a lower priority than “garbage collection” in a second scenario.

Alternatively or additionally, resource scheduling rules associated with different job types may, for example, also be pre-configured by the administrator. For example, the administrator can specify a 2:1 ratio of accelerator resource allocation corresponding to “data backup” to “garbage collection” in the first scenario.

It should be understood that while the accelerator resource scheduling among different virtual machines is determined above in conjunction with a single job type, embodiments of the present disclosure may also be applied to scenarios where virtual machines perform jobs of multiple job types simultaneously.

For example, if virtual machine330-1performs both “data backup” and “garbage collection” jobs simultaneously, and virtual machine330-2performs both “data recovery” and “garbage collection” jobs simultaneously, the system can determine that virtual machine330-1has a lower priority than virtual machine330-2based on predetermined prioritization rules. Thus, virtual machine330-2can be allocated more accelerator resources than virtual machine330-1.

It should be understood that the above specific prioritization rules and resource allocation rules are only examples, and the present disclosure is not intended to be limiting in this regard.

One or more embodiments of the present disclosure may determine, according to the types of jobs executed by virtual machines, a scheme for scheduling accelerator resources among different VFs, thereby achieving dynamic scheduling of accelerator resources among the different VFs.

Continuing with the example ofFIG.3, if virtual machine330executes a “data backup” job, virtual machine330needs to invoke VF320-1to obtain a compression service, invoke VF320-4to obtain a hashing service, and invoke VF320-5to obtain a decompression service.

Considering that different job types have different demands for different acceleration services, system100may also determine a policy for scheduling resources among VF320-1, VF320-4, and VF320-5according to the job types.

As an example, because the “data backup” job needs to perform more hashing, if the total accelerator resources allocated to virtual machine100are 100 Gbps (e.g., allocation can be determined based on the dynamic scheduling policy discussed above, or determined in other appropriate ways), the system may further determine that VF320-4can be allocated 50 Gbps accelerator resources, and VF320-1and VF320-5can each be allocated 25 Gbps accelerator resources. In this way, it is possible to ensure that more fine-grained scheduling of accelerator resources is achieved, thereby improving the efficiency of the system.

In one or more embodiments, resource allocation rules among different virtual functions may, for example, be pre-configured by the administrator. As an example, the administrator may designate specific virtual function allocation rules for different job types in different scenarios.

In one or more embodiments, the resource allocation rules among different virtual functions may also be determined automatically through machine learning, for example. As an example, an appropriate machine learning model may be used to learn the resource allocation rules corresponding to different scenarios and different job types. For example, in a training stage, features corresponding to scenarios and features related to job types may be input, and resource allocation rules constructed by experts may be used as truth values for training, for example, to train this machine learning model so that it can output recommended resource allocation rules based on the scenarios and job types.

Alternatively, the resource allocation rules among different virtual functions may also be determined, for example, by other appropriate debugging methods. For example, the administrator may, for example, determine, through performance testing, which allocation rules can result in better execution performance.

It should be understood that the above specific resource allocation rules are examples only and the present disclosure is not intended to be limiting in this regard.

It should be understood that the data protection scenario shown inFIG.3and the specific services performed by the VFs are only examples and that the embodiments of the present disclosure may also be applied to any other appropriate type of scenario.

One or more embodiments of the present disclosure may also utilize the service level agreement (SLA) to achieve dynamic scheduling of accelerator resources.FIG.4illustrates a schematic block diagram of an acceleration system according to one or more embodiments of the present disclosure. As shown inFIG.4, acceleration system400may include accelerator resource410, manager420, virtual function480, and virtual machine490, and manager420may include, for example, QAT SR-IOV driver440.

Using manager420to directly manage accelerator resource scheduling may introduce limitations to the scalability of the scheme. As shown inFIG.4, acceleration system400also includes QTA SLA program470for managing accelerator resource allocation to virtual function480.

QTA SLA program470is the capability in the QAT software to enable rate control by managing the amount of resources to a specific virtual function. By using the SLA to achieve accelerator resource allocation, the embodiments of the present disclosure are capable of disregarding different implementations of manager420(e.g., a hypervisor), thereby improving better scalability.

As shown inFIG.4, an administrator may, for example, configure mapping information430via manager420to indicate a binding relationship between virtual machine490and corresponding virtual function480. Further, system400, for example, also allows the administrator to configure corresponding SLA policies, and such SLA policies may, for example, include SLA policy450for the virtual machine as discussed above to, for example, perform accelerator resource allocation among virtual machines based on the job types of different virtual machines. The SLA policy may also include, for example, SLA policy460for different virtual functions to, for example, perform the accelerator resource allocation among different virtual functions based on different job types. For example, a corresponding amount of accelerator resources can be allocated to each VF by allocating a predetermined number of SLA units, wherein each SLA unit may, for example, correspond to 1 Gbps.

FIG.5illustrates a flow chart of example process500according to one or more embodiments of the present disclosure. For ease of description, it is described below in conjunction with system100shown inFIG.1. As shown inFIG.5, at502, system100determines a job initiated by a virtual machine, wherein the job requests to invoke at least one virtual function in a set of virtual functions associated with the virtual machine, and each virtual function in the set of virtual functions is configured to utilize an accelerator resource to provide a single type of acceleration service.

TakingFIG.3as an example, system100may determine, for example, that virtual machine330initiates a “data backup” job that requests to invoke acceleration services provided by VF320-1, VF320-4, and VF320-5.

At504, system100determines, based on a job type of the job, a first accelerator resource allocated to the at least one virtual function.

As discussed above, system100may implement dynamic scheduling of accelerator resources among virtual machines and/or dynamic scheduling of accelerator resources among virtual functions based on the job types.

In one or more embodiments, system100may determine a second accelerator resource allocated to the virtual machine.

Specifically, system100may determine a first scheduling policy based on the job type, the first scheduling policy indicating a scheme for scheduling accelerator resources among different virtual machines. For example, system100may determine the first scheduling policy based on the job type of the job performed by virtual machine330being “data backup” and the job type of the job performed by virtual machine350being “garbage collection”.

Further, system100may determine, based on the first scheduling policy, the second accelerator resource allocated to the virtual machine. For example, as discussed above, system100may allocate more accelerator resources to virtual machine330and fewer accelerator resources to virtual machine350.

In one or more embodiments, the system may also determine, based on the second accelerator resource, the first accelerator resource allocated to the at least one virtual function.

Specifically, system100may determine a second scheduling policy based on the job type, wherein the second scheduling policy indicates a scheme for scheduling resources among the set of virtual functions. For example, system100may determine the policy for allocating accelerator resources among VF320-1, VF320-4, and VF320-5based on the job type of the job performed by virtual machine330being “data backup.”

Further, the system may determine, based on the second scheduling policy, the accelerator resources allocated to each of the at least one virtual function. For example, as discussed above, system100may provide more accelerator resources to virtual service (VF)320-4that is used to provide a hashing service.

In one or more embodiments, the system may also allocate the first accelerator resources to the at least one virtual function with the service level agreement (SLA). As discussed above with reference toFIG.4, the system may perform the allocation of accelerator resources to each VF with the SLA agreement.

In one or more embodiments, the job type includes at least one of: a job type for data backup, a job type for data recovery, a job type for data copy, or a job type for garbage collection.

In one or more embodiments, the single type of acceleration service includes one of: a compression service, an encryption service, a decryption service, a hashing service, or a decompression service.

In one or more embodiments, the accelerator resource is one or more Quick Assist Technology (QAT) cards.

FIG.6illustrates a schematic block diagram of example device600that may be used to implement one or more embodiments of the present disclosure. For example, system100and/or system400according to one or more embodiments of the present disclosure may be implemented by device600. As shown in the figure, device600includes central processing unit (CPU)601that may perform various appropriate actions and processing according to computer program instructions stored in read-only memory (ROM)602or computer program instructions loaded from storage unit608to random access memory (RAM)603. In RAM603, various programs and data required for the operation of device600may also be stored. CPU601, ROM602, and RAM603are connected to each other through bus604. Input/output (I/O) interface605is also connected to bus604.

Multiple components in device600are connected to I/O interface605, including: input unit606, such as a keyboard and a mouse; output unit607, such as various types of displays and speakers; storage unit608, such as a magnetic disk and an optical disc; and communication unit609, such as a network card, a modem, and a wireless communication transceiver. Communication unit609allows device600to exchange information/data with other devices via a computer network, such as the Internet, and/or various telecommunication networks.

The various processes and processing described above, such as process500, may be executed by processing unit601. For example, in one or more embodiments, process500may be implemented as a computer software program that is tangibly included in a machine-readable medium, for example, storage unit608. In one or more embodiments, part or all of the computer program may be loaded and/or installed onto device600via ROM602and/or communication unit609. When the computer program is loaded into RAM603and executed by CPU601, one or more actions of process500described above may be implemented.

Embodiments of the present disclosure may be a method, an apparatus, a system, and/or a computer program product. The computer program product may include a computer-readable storage medium on which computer-readable program instructions for performing various aspects of the present disclosure are loaded.

Various implementations of the present disclosure have been described above. The foregoing description is illustrative rather than exhaustive, and is not limited to the disclosed implementations. Numerous modifications and alterations are apparent to persons of ordinary skill in the art without departing from the scope and spirit of the illustrated implementations. The selection of terms used herein is intended to best explain the principles and practical applications of the implementations or the improvements to technologies on the market, or to enable other persons of ordinary skill in the art to understand the implementations disclosed herein.