[go: up one dir, main page]

WO2024120118A1 - Interrupt request processing method, system, device and computer-readable storage medium - Google Patents

Interrupt request processing method, system, device and computer-readable storage medium Download PDF

Info

Publication number
WO2024120118A1
WO2024120118A1 PCT/CN2023/130987 CN2023130987W WO2024120118A1 WO 2024120118 A1 WO2024120118 A1 WO 2024120118A1 CN 2023130987 W CN2023130987 W CN 2023130987W WO 2024120118 A1 WO2024120118 A1 WO 2024120118A1
Authority
WO
WIPO (PCT)
Prior art keywords
vcpu
online
load
interrupt
interrupt request
Prior art date
Application number
PCT/CN2023/130987
Other languages
French (fr)
Chinese (zh)
Inventor
张景涛
童贤慧
余润
李健
宦旭
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2024120118A1 publication Critical patent/WO2024120118A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • G06F9/505Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals considering the load
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5061Partitioning or combining of resources
    • G06F9/5077Logical partitioning of resources; Management or configuration of virtualized resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45575Starting, stopping, suspending or resuming virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45579I/O management, e.g. providing access to device drivers or storage
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5013Request control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/50Indexing scheme relating to G06F9/50
    • G06F2209/5022Workload threshold

Definitions

  • the present application relates to the field of computers, and to an interrupt request processing method, system, device, and computer-readable storage medium.
  • Virtual I/O (Input/Output) devices simulate real physical I/O devices to process I/O requests and generate corresponding interrupts.
  • the virtual machine manager intercepts and simulates the host system to schedule vCPU (virtual Central Processing Unit) to process interrupts.
  • vCPU virtual Central Processing Unit
  • the virtual machine exit caused by interrupt delivery and the related interrupt processing delay will greatly affect the I/O throughput and response of the virtual machine. Therefore, how to reduce the interrupt request processing time delay of vCPU is an urgent problem to be solved.
  • the main purpose of this application is to provide an interrupt request processing method, system, device and computer-readable storage medium, aiming to solve the technical problem of how to reduce the interrupt request processing time delay of the vCPU.
  • an interrupt request processing method comprising:
  • detecting whether a preset online list includes an online virtual central processing unit vCPU;
  • the interrupt request is sent to the target vCPU for interrupt processing.
  • an interrupt request processing system including:
  • a receiving module configured to detect, in response to an interrupt request, whether a preset online list includes an online virtual central processing unit vCPU;
  • An information acquisition module used for acquiring scheduling information and load information corresponding to at least one of the online vCPUs when the detection result is yes;
  • a redirection module configured to select a vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
  • a processing module is used to send the interrupt request to the target vCPU for interrupt processing.
  • the present application also provides an interrupt request processing device, which includes a memory, a processor, and an interrupt request processing program stored in the memory and executable on the processor, and when the interrupt request processing program is executed by the processor, the steps of the interrupt request processing method described above are implemented.
  • the present application also provides a computer-readable storage medium, on which an interrupt request processing program is stored, and when the interrupt request processing program is executed by a processor, the steps of the interrupt request processing method as described above are implemented.
  • FIG1 is a flow chart of a first embodiment of a method for processing an interrupt request of the present invention
  • FIG2 is an illustrative schematic diagram of an online list and an offline list of the interrupt request processing method of the present application
  • FIG3 is a system distribution framework diagram of the interrupt request processing method of the present application.
  • FIG4 is another flow chart of the interrupt request processing method of the present invention.
  • FIG5 is a schematic diagram of an interrupt request processing system of the present application.
  • FIG6 is a schematic diagram of the terminal ⁇ device structure of the hardware operating environment involved in the embodiment of the present application.
  • the target vCPU virtual Central Processing Unit
  • the target vCPU virtual Central Processing Unit
  • the target vCPU A may be in the scheduling waiting queue. Then the delivered interrupt cannot be processed before vCPU A is rescheduled to the physical CPU. In this case, the scheduling delay of vCPU A will inevitably be introduced into the client's I/O (Input/Output) event processing, causing additional I/O delays.
  • I/O Input/Output
  • the side-core method can be used to assign dedicated cores to be responsible for I/O processing of virtual machines.
  • the side-core method divides the cores into two different sets: one for running the guest system and the other dedicated to virtual I/O processing.
  • the number of cores that should be assigned to each group depends on the changing workload. In the worst case, the number of dedicated cores used for virtual I/O processing is much larger (smaller) than the optimal value, and one of the two sets of cores is always overloaded, consuming more CPU cycles, and the performance of other applications (workloads) running on the virtual machine is impaired.
  • the scheduling algorithm-related methods can reduce the time slice of the scheduler in the virtual machine manager, timely schedule the vCPU that receives the interrupt, and reduce the waiting time of the vCPU in the scheduling queue.
  • frequent scheduling switches between vCPUs in order to quickly respond to interrupts will lead to an astonishing number of context switches, and a large number of CPU cycles will be wasted, causing serious performance degradation in practice.
  • the virtual machine manager scheduler treats each vCPU fairly by allocating an equal number of CPU cycles to each vCPU.
  • the interrupt load on each vCPU is uneven, and more CPU cycles cannot be allocated to vCPUs with greater interrupt load pressure, which cannot fully utilize system resources.
  • the interrupt request load information and the scheduling information of the vCPU of all current vCPUs in the preset online list are obtained and evaluated, and the interrupt request issued by the device is intelligently redirected to the target vCPU with the smallest load for processing; after detecting that the vCPU is not stored in the preset online list, a vCPU is selected from the preset offline list as the target vCPU to complete the processing of the interrupt request, thereby achieving load balancing of the interrupt request redirection to the target vCPU, reducing the time delay of interrupt request processing, and thereby improving the concurrency and responsiveness of I/O virtualization. It is based on notification interrupts and vCPU scheduling design in Linux KVM, and is applied to the interrupt transmission and delivery processing flow in the virtual I/O event path, reducing the I/O interrupt processing delay caused by the vCPU scheduler.
  • the storage location of the load-related information of the vCPU in the virtual machine can also be sent directly to the virtual machine monitor on the host machine, so that the virtual machine monitor can share and determine the load scheduling strategy based on the vCPU load information, and select the most appropriate target vCPU for the interrupt request.
  • the present application provides an interrupt request processing method.
  • the interrupt request processing method includes:
  • Step S10 in response to the interrupt request, detecting whether a preset online list includes an online virtual central processing unit vCPU;
  • Step S20 if the detection result is yes, obtaining scheduling information and load information corresponding to at least one of the online vCPUs;
  • Step S30 selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
  • Step S40 Send the interrupt request to the target vCPU for interrupt processing.
  • the interrupt request processing method in the embodiment of the present application is applied to an interrupt request processing system, and a vCPU scheduling information module, a vCPU load information module and a target vCPU redirection module for the interrupt request can be set in the interrupt request processing system.
  • a vCPU scheduling information module, a vCPU load information module and a target vCPU redirection module for the interrupt request can be set in the interrupt request processing system.
  • two information channels can be created in the interrupt request processing system, and the vCPU obtains the real-time vCPU scheduling status and vCPU load balancing information respectively through the two information channels, and intelligently finds the most suitable vCPU to process the interrupt request according to the vCPU scheduling status and vCPU load balancing information, so as to complete the optimization of the PI mechanism, thereby minimizing the IO event processing delay of the client.
  • vCPU scheduling information module an information channel is established with the vCPU scheduler of the VMM (virtual machine manager) to collect the current vCPU scheduling information, thereby avoiding the phenomenon of not knowing the scheduling status of the vCPU when allocating the target vCPU for the interrupt request.
  • the load balancer in the VMM will collect the interrupt request reception status of the vAPIC Page on the vCPU, maintain the interrupt request status table of the current vCPU, and realize real-time evaluation of the interrupt request load, thereby avoiding the phenomenon of not being able to ensure the load balancing of the vCPU when allocating the target vCPU for the interrupt request.
  • the interrupt request is redirected to the online idle vCPU, which reduces the virtual machine I/O event processing delay converted by the vCPU scheduling delay, and avoids the impact of the virtual machine manager's scheduling activities on the virtual machine's I/O performance.
  • step S10 in response to the interrupt request, detecting whether the preset online list includes an online virtual central processing unit vCPU;
  • the virtual machine when a physical device or a virtual device sends an interrupt request, the virtual machine responds to the received interrupt request and detects whether an online vCPU is included in a preset online list.
  • the preset online list is a notifier generated by the vCPU scheduling provided by the virtual machine to maintain an online status table of the vCPU for all virtual machines. If a vCPU thread is currently running on a physical CPU, it will be placed in the preset online list, and the currently online vCPUs will be counted in a first-in-first-out queue to record the order in which the vCPUs are stored.
  • step S10 after detecting whether the preset online list includes the online virtual central processing unit vCPU, the following steps are included:
  • Step z after determining that the preset online list is an empty list, selecting an offline vCPU as a target vCPU from the preset offline list according to a preset storage order, wherein the empty list does not include an online vCPU.
  • the preset online list is an empty table, it is determined that no online vCPU is stored in the preset online list.
  • an offline vCPU can be selected from the preset offline list according to the preset storage order as the target vCPU to process the received interrupt request.
  • the preset offline list is a preset online list that uses the notifier generated by the vCPU scheduling provided by the virtual machine to maintain the offline status table of the vCPU for all virtual machines, and counts the currently offline vCPUs in a first-in-first-out (i.e., preset storage order) queue, and records the order in which the vCPUs are stored.
  • the offline vCPU list is sorted to indicate the order in which all vCPUs are canceled. Whenever a vCPU is canceled, it will be removed from the online list and added to the end of the offline list.
  • the offline vCPU may be a vCPU stored in the preset offline list that is in an offline state.
  • the preset online list is an empty list, it means that there is no online vCPU.
  • the offline vCPU at the head of the queue can be selected as the target vCPU for processing the interrupt request in a first-in-first-out order.
  • the preset offline list is a first-in-first-out queue structure and stores 4 vCPUs, which are vCPU5, vCPU6, vCPU7, and vCPU8 in the order of storage.
  • the offline vCPU at the head of the queue that is, vCPU5
  • the offline vCPU will enter the preset online list after being assigned the task of processing the interrupt request, and then be scheduled to run the processing interrupt request in the preset online list, thereby ensuring that after the interrupt request is assigned to the target vCPU, it will not fall into a long wait, resulting in the phenomenon that the interrupt request cannot be delivered in time.
  • step S20 if the detection result is yes, obtaining scheduling information and load information corresponding to at least one of the online vCPUs;
  • the vCPU scheduling information processing module will establish an information channel with the vCPU scheduler of the operating system to collect the current vCPU scheduling information.
  • the scheduling information records the scheduling status of all vCPUs;
  • the vCPU load information module will establish an information channel with the vCPU scheduler of the operating system to collect the current vCPU load information, and the load information records the number of interrupt loads included in all vCPUs.
  • the virtual machine registers two preemption notifier functions for each vCPU, which are recorded as kvm_sched_in and kvm_sched_out.
  • kvm_sched_in will be called before a vCPU thread is about to be scheduled.
  • the corresponding vCPU is placed in the preset online list, and the calling state of the vCPU is recorded as whether it is a processing interrupt state or an unprocessed interrupt state.
  • kvm_sched_out will be called immediately when a vCPU thread is canceled.
  • the vCPU scheduling information processing module can collect and update the vCPU scheduling state of each virtual machine.
  • the virtual machine also designs a kvm_create_vcpu system call function.
  • the virtual machine creates a corresponding kvm_vcpu structure for each vCPU and performs initialization operations.
  • the interrupt request is injected into the virtual advanced programmable interrupt controller page, the interrupt request load information recorded in the kvm_vcpu structure is dynamically updated and maintained, and the number of interrupt requests currently directed to the vCPU and the completion status are recorded in real time, and the current vCPU interrupt load pressure situation is evaluated.
  • the scheduling information of all online vCPUs in the preset online list is obtained through the vCPU scheduling information module of the virtual machine monitor, wherein the scheduling information includes the scheduling status corresponding to each online vCPU, and the load information of all online vCPUs in the preset online list is obtained through the vCPU load information module, wherein the load information includes the number of interrupt loads corresponding to each online vCPU.
  • step S30 selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
  • all online vCPUs in the preset online list can perform interrupt request processing operations, that is, they can immediately receive interrupt requests delivered by the PI without any delay. Therefore, the online vCPU with the smallest load and the lightest load can be selected as the target vCPU from among the online vCPUs based on the obtained scheduling information and load information of the online vCPU. And when determining the target vCPU, the scheduling information of all online vCPUs in the preset online list can be compared, and the load information of all online vCPUs in the preset online list can be compared to determine the online vCPU with the smallest load, and use the online vCPU with the smallest load as the target vCPU.
  • step S40 the interrupt request is sent to the target vCPU for interrupt processing.
  • the interrupt request can be directly sent to the target vCPU for interrupt processing, and after the interrupt processing is completed, after receiving a new interrupt request sent by a physical device or a virtual device, the target vCPU can continue to process it.
  • a virtual machine, hardware, and a virtual machine monitor are included, and a vCPU scheduling information module, a vCPU load information module, and a target vCPU redirection module for interrupt requests are set in the virtual machine monitor.
  • the target vCPU redirection module for the interrupt request will intercept the interrupt request. Two information channels will be created, and the vCPUs will be sent to the virtual machine monitor through the two information channels.
  • Get real-time vCPU scheduling status and vCPU load balancing information that is, the vCPU scheduling information module monitors the vCPU scheduler through an information channel to obtain vCPU scheduling information.
  • the vCPU load information module monitors the notification interrupts of each vCPU through another information channel to obtain vCPU interrupt load information.
  • the virtual machine monitor intelligently finds the most suitable vCPU to handle the interrupt request based on the vCPU scheduling status and vCPU load balancing information to complete the optimization PI mechanism, thereby minimizing the client's IO event processing delay.
  • the scheduling information and interrupt load information (i.e., load information) of the vCPU are obtained, and a vCPU with the smallest load is selected as the target vCPU for processing the interrupt request based on the scheduling information and interrupt load information of the vCPU. Then, it is determined whether there are online vCPUs stored in the preset online list and whether the average interrupt load number of all online vCPUs exceeds the threshold. If the conditions are met, an interrupt is passed to the current target vCPU for interrupt processing.
  • the head vCPU of the preset offline queue is used as the target vCPU, and the interrupt is notified to the target vCPU.
  • the interrupt load information of the vCPU is updated according to the interrupt request.
  • This embodiment detects whether an online virtual central processing unit vCPU is included in a preset online list in response to an interrupt request; if the detection result is yes, obtains scheduling information and load information corresponding to at least one of the online vCPUs; selects an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information; and sends the interrupt request to the target vCPU for interrupt processing, thereby redirecting the interrupt request to the target vCPU with the smallest load for processing according to the scheduling information and load information of all vCPUs in the online list, overcoming the technical defects of the prior art in which expensive context switching between the virtual machine manager and the virtual machine when processing interrupt requests, or the inability to dynamically select the vCPU with the smallest load to process the received interrupt request according to the scheduling and load conditions of the vCPU, thereby reducing the interrupt request processing time delay of the vCPU.
  • step S30 of the above embodiment selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information includes:
  • Step a obtaining the interruption load quantity corresponding to the online vCPU based on the load information, and obtaining the scheduling state corresponding to the online vCPU based on the scheduling information;
  • Step b after all the scheduling states are in the unprocessed interrupt state, select an online vCPU with the smallest load from at least one of the online vCPUs as a target vCPU according to the interrupt load quantity.
  • the scheduling status of the online vCPU includes the processing interrupt status and the unprocessed interrupt status.
  • the processing interrupt status refers to the state in which a certain online vCPU is selected to process an interrupt, and all states except the processing interrupt status are not in the processing interrupt status.
  • each online vCPU is the unprocessed interrupt status according to the scheduling information of all online vCPUs in the preset online list, and then the number of interrupt loads on each online vCPU is determined according to the load information of all online vCPUs in the preset online list, an online vCPU with the least number of interrupt loads is screened out as the target vCPU for receiving the processed interrupt request.
  • the number of interrupt loads corresponding to vCPU1, vCPU2, vCPU3 and vCPU4 is 10, 4, 15, 8, then the online vCPU (i.e., vCPU2) corresponding to the smallest number of interrupt loads (i.e., 4) is selected as the target vCPU.
  • the interrupt request after receiving an interrupt request, the interrupt request is redirected to the vCPU with the smallest online load for processing by obtaining the online vCPU scheduling status and the number of vCPU interrupt loads, thereby reducing the virtual machine I/O event processing delay converted by the vCPU scheduling delay, reducing the processing time delay of the vCPU interrupt request, and thereby avoiding the impact of the long interrupt request processing time delay on the I/O performance of the virtual machine.
  • selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the interrupt load quantity includes:
  • Step c determining an average interruption load quantity corresponding to all the interruption load quantities
  • Step d after the average interruption load quantity is less than a first preset threshold, determining a minimum interruption load quantity among all the interruption load quantities;
  • Step e taking the online vCPU corresponding to the minimum interrupt load number as the target vCPU.
  • the number of interrupt loads corresponding to all online vCPUs is obtained, and the average of all interrupt load numbers is taken to obtain the average interrupt load number.
  • the average interrupt load number is then compared with the first preset threshold. After the average interrupt load number is less than the first preset threshold, the online vCPU with the smallest load is selected from all online vCPUs as the target vCPU, that is, the online vCPU corresponding to the smallest interrupt load number is selected as the target vCPU. After the average interrupt load number is greater than or equal to the first preset threshold, an offline vCPU that meets the conditions is selected in the preset offline list as the target vCPU.
  • the first preset threshold can be determined based on the ratio of the vCPU scheduling delay and the average interrupt request processing time. For example, if there are four online vCPUs (vCPU1, vCPU2, vCPU3, vCPU4) that are not in the interrupt processing state, the corresponding interrupt load numbers are (10, 4, 15, 8), and the average interrupt load number of the four online vCPUs is calculated to be 9.25. At this time, if the first preset threshold is 8, the average interrupt load number is less than the first preset threshold, and the online vCPU corresponding to the minimum interrupt load number, that is, vCPU2, is selected as the target vCPU.
  • the online vCPU corresponding to the minimum interrupt load number can be selected as the target vCPU for processing the interrupt request based on the load information of the online vCPU, thereby achieving load balancing of the interrupt request distribution to the target vCPU, setting the average threshold of the interrupt load on the vCPU, and ensuring that the processing delay of the interrupt request is always the minimum value of the total processing time of the existing interrupt request queue on the vCPU and the vCPU scheduling delay overhead, thereby reducing the waiting time of the interrupt request.
  • the method includes:
  • Step f after the average interruption load number is greater than or equal to the first preset threshold, select an offline vCPU from the preset offline list as the target vCPU according to the preset storage order.
  • the offline vCPU at the head of the preset offline list can be selected as the target vCPU according to the first-in-first-out storage order (i.e., the preset storage order).
  • the head vCPU in the preset offline queue is the vCPU with the longest offline time, and will be the first vCPU to resume online status and the first vCPU to enter the running status, thereby avoiding the occurrence of abnormal situations such as CPU operation abnormality or abnormal exit of interrupt request processing due to excessive interrupt load on the online vCPU, and ensuring that all interrupt requests on all online CPUs can be effectively and accurately processed.
  • the corresponding interrupt load quantity is (10, 4, 15, 8), and the average interrupt load quantity of the 4 online vCPUs is calculated to be 9.25. If the first preset threshold is 10, the average interrupt load quantity is greater than the first preset threshold. At this time, the offline vCPU that meets the conditions in the preset offline list is selected as the target vCPU.
  • the method includes:
  • Step g after there is a processing interruption state in all the scheduling states, determining the maximum interruption load number and the minimum interruption load number among all the interruption load numbers;
  • Step h determining the ratio between the maximum interruption load number and the minimum interruption load number
  • Step i after the ratio is greater than a second preset threshold, continue to execute the step of selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the number of interrupt loads.
  • the online vCPUs are selected to handle an interrupt, that is, it is in the interrupt processing state, and the ratio between the maximum number of interrupt loads and the minimum number of interrupt loads on all current online vCPUs is greater than a preset experience value (i.e., the second preset threshold), the online vCPU corresponding to the minimum number of interrupt loads will still be selected as the target vCPU. If the ratio is less than or equal to the preset experience value, it is considered that the online vCPU that is processing the interrupt is selected as the target vCPU at this time, where the preset experience value can be any value set in advance by the user.
  • a preset experience value i.e., the second preset threshold
  • the corresponding interrupt load numbers are (10, 4, 15, 8), and vCPU4 is in the interrupt processing state, vCPU1, vCPU2 and vCPU3 are all in the unprocessed interrupt state, and the ratio of the maximum interrupt load number to the minimum interrupt load number is calculated to be 3.75 and the average interrupt load number is 9.25.
  • the preset test value set in advance is 4 and the first preset threshold is 8, the ratio is greater than the preset experience value and the average interrupt load number is less than the first preset threshold.
  • the online vCPU corresponding to the minimum interrupt load number is selected as the target vCPU.
  • the preset test value set in advance is 4 and the first preset threshold is 10, the ratio is greater than the preset experience value and the average interrupt load is greater than the first preset threshold.
  • the connected vCPU that meets the conditions in the preset connection list is selected as the target vCPU; if the preset test value set in advance is 3, the ratio is less than the preset experience value.
  • the online vCPU in the interrupt processing state that is, vCPU4, is selected as the target vCPU.
  • the ratio between the maximum interrupt load number and the minimum interrupt load number among all interrupt load numbers is determined, and after the ratio is greater than a second preset threshold, the online vCPU with the smallest load is selected as the target vCPU among each online vCPU, thereby ensuring the validity of the determined target vCPU.
  • the method further comprises:
  • Step j after the ratio is less than or equal to a second preset threshold, select an online vCPU in a processing interrupt state among all the online vCPUs as a target vCPU.
  • the online vCPU that is processing the interrupt status is selected as the target vCPU, and the vCPU load information is updated in real time, and subsequent interrupt requests are redirected to this online vCPU until it is canceled by the vCPU scheduler or the ratio is greater than a preset empirical value, triggering redirection to select a new online vCPU with the smallest interrupt load as the redirection target vCPU, thereby ensuring that when an interrupt request arrives, if there is an online vCPU that is processing an interrupt, the interrupt request will be sent to this online vCPU for processing.
  • this online vCPU is processing an interrupt
  • delivering the interrupt request to this online vCPU at this time can ensure that the interrupt request can be processed immediately and reduce The processing time delay is reduced, and the interrupt request is redirected to the online vCPU that is processing the interrupt only when the above ratio is less than or equal to the preset experience value, thereby ensuring the load balancing of each online vCPU.
  • an embodiment of the present application provides an interrupt request processing system, including:
  • a detection module A10 configured to detect, in response to an interrupt request, whether a preset online list includes an online virtual central processing unit vCPU;
  • the information acquisition module A20 is used to obtain the scheduling information and load information corresponding to at least one of the online vCPUs when the detection result is yes;
  • a redirection module A30 configured to select a vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
  • the processing module A40 is used to send the interrupt request to the target vCPU for interrupt processing.
  • redirection module A30 is further used for:
  • an online vCPU with the smallest load is selected as a target vCPU from at least one of the online vCPUs according to the interrupt load quantity.
  • redirection module A30 is further used for:
  • the online vCPU corresponding to the minimum interrupt load number is used as the target vCPU.
  • redirection module A30 is further used for:
  • an offline vCPU is selected from the preset offline list as the target vCPU according to the preset storage order.
  • redirection module A30 is further used for:
  • the step of selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the interrupt load quantity is continued.
  • redirection module A30 is further used for:
  • an online vCPU in a processing interrupt state among all the online vCPUs is selected as a target vCPU.
  • the information acquisition module A20 is used to:
  • an offline vCPU is selected as a target vCPU from the preset offline list according to a preset storage order, wherein the empty list does not include an online vCPU.
  • the present application also provides an interrupt request processing device, the interrupt request processing device includes a memory, a processor and an interrupt request processing program stored in the memory and executable on the processor, wherein the interrupt request processing program implements the steps of the interrupt request processing method as described above when executed by the processor.
  • FIG6 is a schematic diagram of the structure of an interrupt request processing device in one embodiment of the present application.
  • the interrupt request processing device includes a processor, and optionally also includes an internal bus, a network interface, and a memory.
  • the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc.
  • RAM random access memory
  • non-volatile memory non-volatile memory
  • the interrupt request processing device may also include hardware required for other services.
  • the processor, the network interface, and the memory may be interconnected through an internal bus, and the internal bus may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc.
  • the bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in FIG6, but it does not mean that there is only one bus or one type of bus.
  • the memory is used to store programs.
  • the program may include a program code, and the program code includes a computer operation instruction.
  • the processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a shared resource access control device at the logical level.
  • the processor executes the program stored in the memory and is specifically used to execute the steps of the above-mentioned anti-channelling control method.
  • interrupt request processing device of the present application is basically the same as the embodiments of the above-mentioned network optimization method, and will not be repeated here.
  • the present application also provides a storage medium, which can be a computer-readable storage medium, and the computer-readable storage medium stores one or more programs.
  • the one or more programs can also be executed by one or more processors to implement the steps of each embodiment of the above-mentioned memory access method.
  • the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, including a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server or network device, etc.) to execute the methods described in each embodiment of the present application.
  • a storage medium such as ROM/RAM, magnetic disk, optical disk

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present application discloses an interrupt request processing method, a system, a device, and a computer-readable storage medium. The interrupt request processing method comprises: in response to an interrupt request, detecting whether an online virtual central processing unit (vCPU) is included in a preset online list; if a detection result is yes, acquiring scheduling information and load information corresponding to at least one online vCPU; according to the scheduling information and the load information, selecting an online vCPU having the smallest load from the at least one online vCPU as a target vCPU; sending the interrupt request to the target vCPU for interrupt processing.

Description

中断请求处理方法、系统、设备及计算机可读存储介质Interrupt request processing method, system, device and computer readable storage medium
相关申请Related Applications
本申请要求于2022年12月5号申请的、申请号为202211557937.X的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims priority to Chinese patent application No. 202211557937.X filed on December 5, 2022, the entire contents of which are incorporated by reference into this application.
技术领域Technical Field
本申请涉及计算机领域,涉及一种中断请求处理方法、系统、设备及计算机可读存储介质。The present application relates to the field of computers, and to an interrupt request processing method, system, device, and computer-readable storage medium.
背景技术Background technique
随着网络技术的发展,输入/输出虚拟化已成为虚拟化基础设施中系统性能和效率的决定因素,它通过管理程序或虚拟机管理器整合多个虚拟机实例,以共享同一底层物理服务器资源。虚拟I/O(Input/Output,输入/输出)设备模拟真实的物理I/O设备处理I/O请求,并产生相应的中断,虚拟机管理器拦截并模拟宿主系统调度vCPU(virtualCentral Processing Unit,虚拟中央处理器)处理中断,而中断传递引起的虚机退出和相关的中断处理延迟会极大影响虚拟机的I/O吞吐量和响应。因此如何减少vCPU的中断请求处理时间延迟是目前亟待解决的问题。With the development of network technology, input/output virtualization has become a decisive factor in system performance and efficiency in virtualized infrastructure. It integrates multiple virtual machine instances through a hypervisor or virtual machine manager to share the same underlying physical server resources. Virtual I/O (Input/Output) devices simulate real physical I/O devices to process I/O requests and generate corresponding interrupts. The virtual machine manager intercepts and simulates the host system to schedule vCPU (virtual Central Processing Unit) to process interrupts. The virtual machine exit caused by interrupt delivery and the related interrupt processing delay will greatly affect the I/O throughput and response of the virtual machine. Therefore, how to reduce the interrupt request processing time delay of vCPU is an urgent problem to be solved.
发明内容Summary of the invention
本申请的主要目的在于提供一种中断请求处理方法、系统、设备及计算机可读存储介质,旨在解决如何减少vCPU的中断请求处理时间延迟的技术问题。The main purpose of this application is to provide an interrupt request processing method, system, device and computer-readable storage medium, aiming to solve the technical problem of how to reduce the interrupt request processing time delay of the vCPU.
为实现上述目的,本申请提供一种中断请求处理方法,包括:To achieve the above object, the present application provides an interrupt request processing method, comprising:
响应于中断请求,检测预设在线列表中是否包括在线虚拟中央处理器vCPU;In response to the interrupt request, detecting whether a preset online list includes an online virtual central processing unit vCPU;
在检测结果为是的情况下,获取至少一个所述在线vCPU对应的调度信息和负载信息;If the detection result is yes, obtaining scheduling information and load information corresponding to at least one of the online vCPUs;
根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU;Selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
将所述中断请求发送至所述目标vCPU进行中断处理。The interrupt request is sent to the target vCPU for interrupt processing.
此外,为实现上述目的,本申请还提供一种中断请求处理系统,包括:In addition, to achieve the above purpose, the present application also provides an interrupt request processing system, including:
接收模块,用于响应于中断请求,检测预设在线列表中是否包括在线虚拟中央处理器vCPU;A receiving module, configured to detect, in response to an interrupt request, whether a preset online list includes an online virtual central processing unit vCPU;
信息获取模块,用于在检测结果为是的情况下,获取至少一个所述在线vCPU对应的调度信息和负载信息;An information acquisition module, used for acquiring scheduling information and load information corresponding to at least one of the online vCPUs when the detection result is yes;
重定向模块,用于根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的vCPU作为目标vCPU;A redirection module, configured to select a vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
处理模块,用于将所述中断请求发送至所述目标vCPU进行中断处理。 A processing module is used to send the interrupt request to the target vCPU for interrupt processing.
此外,为实现上述目的,本申请还提供一种中断请求处理设备,中断请求处理设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上执行的中断请求处理程序,所述中断请求处理程序被所述处理器执行时实现如上述所述的中断请求处理方法的步骤。In addition, to achieve the above-mentioned purpose, the present application also provides an interrupt request processing device, which includes a memory, a processor, and an interrupt request processing program stored in the memory and executable on the processor, and when the interrupt request processing program is executed by the processor, the steps of the interrupt request processing method described above are implemented.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,计算机可读存储介质上存储有中断请求处理程序,所述中断请求处理程序被处理器执行时实现如上述所述的中断请求处理方法的步骤。In addition, to achieve the above-mentioned purpose, the present application also provides a computer-readable storage medium, on which an interrupt request processing program is stored, and when the interrupt request processing program is executed by a processor, the steps of the interrupt request processing method as described above are implemented.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1是本申请中断请求处理方法的第一实施例的流程示意图;FIG1 is a flow chart of a first embodiment of a method for processing an interrupt request of the present invention;
图2是本申请中断请求处理方法的在线列表与离线列表的说明性示意图;FIG2 is an illustrative schematic diagram of an online list and an offline list of the interrupt request processing method of the present application;
图3是本申请中断请求处理方法中系统分布框架图;FIG3 is a system distribution framework diagram of the interrupt request processing method of the present application;
图4是本申请中断请求处理方法的另一流程示意图;FIG4 is another flow chart of the interrupt request processing method of the present invention;
图5是本申请中断请求处理系统的示意图;FIG5 is a schematic diagram of an interrupt request processing system of the present application;
图6是本申请实施例方案涉及的硬件运行环境的终端\装置结构示意图。FIG6 is a schematic diagram of the terminal\device structure of the hardware operating environment involved in the embodiment of the present application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
当虚拟机接收到一个中断请求时,可根据虚拟机中vCPU的中断亲和性设置处理此中断的目标vCPU(virtual Central Processing Unit,虚拟中央处理器),记为vCPUA。在物理CPU核心被复用的情况下(即多个vCPU可能共享一个核心),当PI(Posted Interrupt,通告中断)将中断交付给它时,目标vCPU A可能处于调度的等待队列中。那么在vCPU A被重新调度至物理CPU之前,交付的中断无法被处理。在这种情况下,vCPU A的调度延迟将不可避免地被引入到客户的I/O(Input/Output,输入/输出)事件处理中,造成额外的I/O延迟。When a virtual machine receives an interrupt request, the target vCPU (virtual Central Processing Unit) that handles the interrupt can be set according to the interrupt affinity of the vCPU in the virtual machine, denoted as vCPUA. In the case where the physical CPU core is reused (that is, multiple vCPUs may share a core), when the PI (Posted Interrupt) delivers the interrupt to it, the target vCPU A may be in the scheduling waiting queue. Then the delivered interrupt cannot be processed before vCPU A is rescheduled to the physical CPU. In this case, the scheduling delay of vCPU A will inevitably be introduced into the client's I/O (Input/Output) event processing, causing additional I/O delays.
此外还可以采用侧核方法分配专用内核负责虚拟机的I/O处理时,侧核方法将核心分为两个不同的集合:一个用于运行客户系统,另一个专门用于虚拟I/O处理。然而,应该分配给每组的核心数量取决于不断变化的工作负载。在最坏情况下,用于虚拟I/O处理的专用内核数量远大(小)于最优值,两组核心中总有一组负载过重,消耗更多的CPU周期,而虚拟机上运行的其他应用(工作负载)性能受到损害。In addition, the side-core method can be used to assign dedicated cores to be responsible for I/O processing of virtual machines. The side-core method divides the cores into two different sets: one for running the guest system and the other dedicated to virtual I/O processing. However, the number of cores that should be assigned to each group depends on the changing workload. In the worst case, the number of dedicated cores used for virtual I/O processing is much larger (smaller) than the optimal value, and one of the two sets of cores is always overloaded, consuming more CPU cycles, and the performance of other applications (workloads) running on the virtual machine is impaired.
还可以采用相关调度算法减少了每个vCPU在运行队列中的等待时间,调度算法相关方法通过减少虚拟机管理器中调度器的时间片,及时调度接收中断的vCPU,减少vCPU在调度队列中的等待时间。然而,为了快速响应中断而在vCPU之间的频繁调度切换会带来数量惊人的上下文切换,大量的CPU周期被浪费,在实际中造成严重的性能下降。同时,虚拟机管理器调度器通过分配给每个vCPU同等数量的CPU周期来公平对待每个vCPU,然而,每个vCPU上的中断负载是不均衡的,不能针对中断负载压力更大的vCPU分配更多的CPU周期,无法充分利用系统资源。 Relevant scheduling algorithms can also be used to reduce the waiting time of each vCPU in the run queue. The scheduling algorithm-related methods can reduce the time slice of the scheduler in the virtual machine manager, timely schedule the vCPU that receives the interrupt, and reduce the waiting time of the vCPU in the scheduling queue. However, frequent scheduling switches between vCPUs in order to quickly respond to interrupts will lead to an astonishing number of context switches, and a large number of CPU cycles will be wasted, causing serious performance degradation in practice. At the same time, the virtual machine manager scheduler treats each vCPU fairly by allocating an equal number of CPU cycles to each vCPU. However, the interrupt load on each vCPU is uneven, and more CPU cycles cannot be allocated to vCPUs with greater interrupt load pressure, which cannot fully utilize system resources.
因此,在本申请实施例中为了避免处理中断请求时产生额外的不必要的上下文切换开销,以及无法实现vCPU上的中断负载均衡导致每个vCPU上的中断请求数量不均,无法动态地根据vCPU上的中断负载情况分配相对应的CPU周期,无法充分利用资源的情况,本实施例中当虚拟设备或与虚拟机直通的物理设备完成要求的I/O操作并产生一个中断请求时,虚拟机会响应于接收到的中断请求,并检测预设在线列表中是否存在vCPU,在确定预设在线列表中存在至少一个vCPU之后获取并评估预设在线列表中当前所有vCPU的中断请求负载信息和vCPU的调度信息,对设备发出的中断请求进行智能重定向,重定向至负载最小的目标vCPU进行处理;在检测到预设在线列表中不存储有vCPU之后,则从预设离线列表中选择一个vCPU作为目标vCPU完成中断请求的处理,实现了中断请求重定向至目标vCPU的负载均衡,减少了中断请求处理的时间延迟,进而提高I/O虚拟化的并发性和响应性。并且是基于通告中断和Linux KVM中的vCPU调度设计,应用于虚拟I/O事件路径中的中断传递与交付处理流程,降低了由vCPU调度器引起的I/O中断处理延迟。Therefore, in order to avoid the generation of additional unnecessary context switching overhead when processing interrupt requests, and the inability to achieve interrupt load balancing on the vCPU, resulting in an uneven number of interrupt requests on each vCPU, the inability to dynamically allocate corresponding CPU cycles according to the interrupt load situation on the vCPU, and the inability to fully utilize resources, in this embodiment, when a virtual device or a physical device directly connected to the virtual machine completes the required I/O operation and generates an interrupt request, the virtual machine will respond to the received interrupt request and detect whether there is a vCPU in the preset online list. After determining that there is at least one vCPU in the preset online list, the interrupt request load information and the scheduling information of the vCPU of all current vCPUs in the preset online list are obtained and evaluated, and the interrupt request issued by the device is intelligently redirected to the target vCPU with the smallest load for processing; after detecting that the vCPU is not stored in the preset online list, a vCPU is selected from the preset offline list as the target vCPU to complete the processing of the interrupt request, thereby achieving load balancing of the interrupt request redirection to the target vCPU, reducing the time delay of interrupt request processing, and thereby improving the concurrency and responsiveness of I/O virtualization. It is based on notification interrupts and vCPU scheduling design in Linux KVM, and is applied to the interrupt transmission and delivery processing flow in the virtual I/O event path, reducing the I/O interrupt processing delay caused by the vCPU scheduler.
并且在本申请实施例中,还可以是将虚拟机中vCPU的负载相关信息的存储位置直接发送给宿主机上虚拟机监视器,使虚拟机监视器可以共享并依据vCPU的负载信息确定负载调度策略,选择最合适的中断请求的目标vCPU。Furthermore, in an embodiment of the present application, the storage location of the load-related information of the vCPU in the virtual machine can also be sent directly to the virtual machine monitor on the host machine, so that the virtual machine monitor can share and determine the load scheduling strategy based on the vCPU load information, and select the most appropriate target vCPU for the interrupt request.
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请的一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
参照图1,本申请提供一种中断请求处理方法,在中断请求处理方法的第一实施例中,中断请求处理方法包括:1 , the present application provides an interrupt request processing method. In a first embodiment of the interrupt request processing method, the interrupt request processing method includes:
步骤S10,响应于中断请求,检测预设在线列表中是否包括在线虚拟中央处理器vCPU;Step S10, in response to the interrupt request, detecting whether a preset online list includes an online virtual central processing unit vCPU;
步骤S20,在检测结果为是的情况下,获取至少一个所述在线vCPU对应的调度信息和负载信息;Step S20: if the detection result is yes, obtaining scheduling information and load information corresponding to at least one of the online vCPUs;
步骤S30,根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU;Step S30, selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
步骤S40,将所述中断请求发送至所述目标vCPU进行中断处理。Step S40: Send the interrupt request to the target vCPU for interrupt processing.
示例性的,本申请实施例中的中断请求处理方法应用于中断请求处理系统,在中断请求处理系统中可以设置vCPU调度信息模块,vCPU负载信息模块和中断请求的目标vCPU重定向模块。当虚拟设备或直通的物理设备完成要求的I/O操作并产生至少一个中断请求之后,在通过PI(Posted Interrupt,通告中断)定向发送至与之对应的具体vCPU之前,会通过中断请求的目标vCPU重定向模块来拦截这个中断请求。在一场景中,可以在中断请求处理系统中创建两个信息通道,vCPU通过两个信息通道分别获取实时的vCPU调度状态和vCPU负载均衡信息,智能地根据vCPU调度状态和vCPU负载均衡信息寻找到最合适的vCPU来处理该中断请求,以完成优化PI机制,从而尽可能减少客户机的IO事件处理延迟。 Exemplarily, the interrupt request processing method in the embodiment of the present application is applied to an interrupt request processing system, and a vCPU scheduling information module, a vCPU load information module and a target vCPU redirection module for the interrupt request can be set in the interrupt request processing system. After the virtual device or the direct physical device completes the required I/O operation and generates at least one interrupt request, before being sent to the corresponding specific vCPU through PI (Posted Interrupt, notification interrupt), the interrupt request will be intercepted by the target vCPU redirection module of the interrupt request. In one scenario, two information channels can be created in the interrupt request processing system, and the vCPU obtains the real-time vCPU scheduling status and vCPU load balancing information respectively through the two information channels, and intelligently finds the most suitable vCPU to process the interrupt request according to the vCPU scheduling status and vCPU load balancing information, so as to complete the optimization of the PI mechanism, thereby minimizing the IO event processing delay of the client.
通过引入vCPU调度信息模块与VMM(虚拟机管理器)的vCPU调度器建立信息通道,采集当前vCPU调度信息,从而避免了为中断请求分配目标vCPU时,不知道vCPU的调度状态的现象发生。并且通过引入vCPU负载信息模块,VMM中的负载均衡器将收集vCPU上的vAPIC Page接收中断请求情况,维护当前vCPU的中断请求状态表,实现对于中断请求负载的实时评估,从而避免了为中断请求分配目标vCPU时,无法确保vCPU的负载均衡的现象发生。通过引入中断请求的目标vCPU重定向模块,并在获取到vCPU调度状态和vCPU负载均衡状态,将中断请求重定向至在线空闲vCPU,降低了由vCPU的调度延迟转化的虚拟机I/O事件处理延迟,避免了虚拟机管理器的调度活动对虚拟机的I/O性能影响。By introducing the vCPU scheduling information module, an information channel is established with the vCPU scheduler of the VMM (virtual machine manager) to collect the current vCPU scheduling information, thereby avoiding the phenomenon of not knowing the scheduling status of the vCPU when allocating the target vCPU for the interrupt request. And by introducing the vCPU load information module, the load balancer in the VMM will collect the interrupt request reception status of the vAPIC Page on the vCPU, maintain the interrupt request status table of the current vCPU, and realize real-time evaluation of the interrupt request load, thereby avoiding the phenomenon of not being able to ensure the load balancing of the vCPU when allocating the target vCPU for the interrupt request. By introducing the target vCPU redirection module for the interrupt request, and after obtaining the vCPU scheduling status and vCPU load balancing status, the interrupt request is redirected to the online idle vCPU, which reduces the virtual machine I/O event processing delay converted by the vCPU scheduling delay, and avoids the impact of the virtual machine manager's scheduling activities on the virtual machine's I/O performance.
对于步骤S10,响应于中断请求,检测预设在线列表中是否包括在线虚拟中央处理器vCPU;In step S10, in response to the interrupt request, detecting whether the preset online list includes an online virtual central processing unit vCPU;
示例性的,当物理设备或者虚拟设备发送中断请求后,虚拟机响应于接收到的中断请求,并且检测预设在线列表中是否包括在线vCPU。其中,预设在线列表是利用虚拟机提供的vCPU调度产生的通知器为所有的虚拟机维护vCPU的在线状态表,如果一个vCPU线程当前正运行在物理CPU上,它就会被放入预设在线列表中,并且以先入先出的队列统计目前在线的vCPU,以记录其中存储vCPU的先后顺序。Exemplarily, when a physical device or a virtual device sends an interrupt request, the virtual machine responds to the received interrupt request and detects whether an online vCPU is included in a preset online list. The preset online list is a notifier generated by the vCPU scheduling provided by the virtual machine to maintain an online status table of the vCPU for all virtual machines. If a vCPU thread is currently running on a physical CPU, it will be placed in the preset online list, and the currently online vCPUs will be counted in a first-in-first-out queue to record the order in which the vCPUs are stored.
其中,在步骤S10,检测预设在线列表中是否包括在线虚拟中央处理器vCPU之后,包括:Wherein, in step S10, after detecting whether the preset online list includes the online virtual central processing unit vCPU, the following steps are included:
步骤z:在确定所述预设在线列表为空表之后,则按照预设存储顺序从预设离线列表中选择一个离线vCPU作为目标vCPU,其中,所述空表未包括在线vCPU。Step z: after determining that the preset online list is an empty list, selecting an offline vCPU as a target vCPU from the preset offline list according to a preset storage order, wherein the empty list does not include an online vCPU.
示例性的,在检测到预设在线列表为空表之后,确定预设在线列表中未存储有在线vCPU。此时就可以从预设离线列表中按照预设存储顺序选择一个离线vCPU作为目标vCPU处理接收到的中断请求。其中预设离线列表是预设在线列表是利用虚拟机提供的vCPU调度产生的通知器为所有的虚拟机维护vCPU的离线状态表,并且以先入先出(即预设存储顺序)的队列统计目前离线的vCPU,记录其中存储vCPU的先后顺序。离线的vCPU列表被排序,以表明所有vCPU的取消调度顺序,每当某个vCPU被取消调度,它就会从在线列表中移除,并被添加到离线列表的尾部。其中,离线vCPU可以是存储在预设离线列表中处于离线状态的vCPU。Exemplarily, after detecting that the preset online list is an empty table, it is determined that no online vCPU is stored in the preset online list. At this time, an offline vCPU can be selected from the preset offline list according to the preset storage order as the target vCPU to process the received interrupt request. The preset offline list is a preset online list that uses the notifier generated by the vCPU scheduling provided by the virtual machine to maintain the offline status table of the vCPU for all virtual machines, and counts the currently offline vCPUs in a first-in-first-out (i.e., preset storage order) queue, and records the order in which the vCPUs are stored. The offline vCPU list is sorted to indicate the order in which all vCPUs are canceled. Whenever a vCPU is canceled, it will be removed from the online list and added to the end of the offline list. The offline vCPU may be a vCPU stored in the preset offline list that is in an offline state.
示例性的,在虚拟机接收到中断请求之后,如果预设在线列表为空表,即代表不存在有在线vCPU,此时可以按照先入先出的顺序选择队首的离线vCPU作为处理中断请求的目标vCPU。例如,如图2所示,预设离线列表为先入先出的队列结构且存储有4个vCPU,按照存储顺序依次为vCPU5、vCPU6、vCPU7、vCPU8,在预设在线列表为空表时,选择队首的离线vCPU即vCPU5作为目标vCPU,并且离线vCPU被分配有处理中断请求的任务之后会进入到预设在线列表,然后在预设在线列表在被调度运行处理中断请求,从而保证了中请求断分配到目标vCPU后,不会陷入长时间等待,导致无法及时交付处理的中断请求的现象发生。Exemplarily, after the virtual machine receives an interrupt request, if the preset online list is an empty list, it means that there is no online vCPU. At this time, the offline vCPU at the head of the queue can be selected as the target vCPU for processing the interrupt request in a first-in-first-out order. For example, as shown in FIG2, the preset offline list is a first-in-first-out queue structure and stores 4 vCPUs, which are vCPU5, vCPU6, vCPU7, and vCPU8 in the order of storage. When the preset online list is an empty list, the offline vCPU at the head of the queue, that is, vCPU5, is selected as the target vCPU, and the offline vCPU will enter the preset online list after being assigned the task of processing the interrupt request, and then be scheduled to run the processing interrupt request in the preset online list, thereby ensuring that after the interrupt request is assigned to the target vCPU, it will not fall into a long wait, resulting in the phenomenon that the interrupt request cannot be delivered in time.
对于步骤S20,在检测结果为是的情况下,获取至少一个所述在线vCPU对应的调度信息和负载信息; For step S20, if the detection result is yes, obtaining scheduling information and load information corresponding to at least one of the online vCPUs;
示例性的,在确定预设在线列表中包括有至少一个在线vCPU之后,vCPU调度信息处理模块会通过与操作系统的vCPU调度器建立信息通道,采集目前的vCPU调度信息。其中,调度信息记录了所有vCPU的调度状态;vCPU负载信息模块会通过与操作系统的vCPU调度器建立信息通道,采集目前的vCPU负载信息,负载信息记录了所有vCPU包括的中断负载数量。Exemplarily, after determining that the preset online list includes at least one online vCPU, the vCPU scheduling information processing module will establish an information channel with the vCPU scheduler of the operating system to collect the current vCPU scheduling information. The scheduling information records the scheduling status of all vCPUs; the vCPU load information module will establish an information channel with the vCPU scheduler of the operating system to collect the current vCPU load information, and the load information records the number of interrupt loads included in all vCPUs.
示例性的,虚拟机为每个vCPU注册了两个抢占通知器函数,分别记为kvm_sched_in和kvm_sched_out。kvm_sched_in将在一个vCPU线程即将被调度之前被调用,kvm_sched_in被调用时对应的vCPU被放入到预设在线列表中,并记录vCPU的调用状态是处理中断状态还是未处理中断状态,而kvm_sched_out会在一个vCPU线程被取消调度的时候被立刻调用,kvm_sched_out被调用时对应的vCPU被放入到预设离线列表中。通过利用这两个通知器,vCPU调度信息处理模块可以收集和更新每个虚拟机的vCPU调度状态。Exemplarily, the virtual machine registers two preemption notifier functions for each vCPU, which are recorded as kvm_sched_in and kvm_sched_out. kvm_sched_in will be called before a vCPU thread is about to be scheduled. When kvm_sched_in is called, the corresponding vCPU is placed in the preset online list, and the calling state of the vCPU is recorded as whether it is a processing interrupt state or an unprocessed interrupt state. kvm_sched_out will be called immediately when a vCPU thread is canceled. When kvm_sched_out is called, the corresponding vCPU is placed in the preset offline list. By using these two notifiers, the vCPU scheduling information processing module can collect and update the vCPU scheduling state of each virtual machine.
示例性的,虚拟机也设计了kvm_create_vcpu系统调用函数,用户通过kvm_create_vcpu系统调用请求创建vCPU之后,虚拟机为每个vCPU创建对应的kvm_vcpu结构体并进行初始化操作,在中断请求注入虚拟高级可编程中断控制器页时动态更新并维护kvm_vcpu结构体中记录的中断请求负载信息,实时记录当前已经定向到vCPU上的中断请求数量和完成状态并评估当前的vCPU中断负载压力情况。Exemplarily, the virtual machine also designs a kvm_create_vcpu system call function. After the user creates a vCPU through the kvm_create_vcpu system call request, the virtual machine creates a corresponding kvm_vcpu structure for each vCPU and performs initialization operations. When the interrupt request is injected into the virtual advanced programmable interrupt controller page, the interrupt request load information recorded in the kvm_vcpu structure is dynamically updated and maintained, and the number of interrupt requests currently directed to the vCPU and the completion status are recorded in real time, and the current vCPU interrupt load pressure situation is evaluated.
示例性的,在检测到预设在线列中存在有至少一个在线vCPU后,通过虚拟机监视器的vCPU调度信息模块获取预设在线列表中所有在线vCPU的调度信息,其中调度信息包括了每一个在线vCPU相对应的调度状态,通过vCPU负载信息模块获取预设在线列表中所有在线vCPU的负载信息,其中负载信息包括了每一个在线vCPU相对应的中断负载数量。Exemplarily, after detecting that there is at least one online vCPU in the preset online list, the scheduling information of all online vCPUs in the preset online list is obtained through the vCPU scheduling information module of the virtual machine monitor, wherein the scheduling information includes the scheduling status corresponding to each online vCPU, and the load information of all online vCPUs in the preset online list is obtained through the vCPU load information module, wherein the load information includes the number of interrupt loads corresponding to each online vCPU.
对于步骤S30,根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU;For step S30, selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
示例性的,在预设在线列表中的所有在线vCPU都可以进行中断请求的处理事项操作,即可以立即接收PI交付的中断请求,没有任何延迟。因此就可以根据获取到的在线vCPU的调度信息和负载信息在各个在线vCPU中选择负载最小、负载最轻的在线vCPU作为目标vCPU。并且在进行目标vCPU确定时,可以对预设在线列表中所有在线vCPU的调度信息之间进行比较,可以对预设在线列表中所有在线vCPU的负载信息之间进行比较,以此来确定负载最小的在线vCPU,并将此负载最小的在线vCPU作为目标vCPU。Exemplarily, all online vCPUs in the preset online list can perform interrupt request processing operations, that is, they can immediately receive interrupt requests delivered by the PI without any delay. Therefore, the online vCPU with the smallest load and the lightest load can be selected as the target vCPU from among the online vCPUs based on the obtained scheduling information and load information of the online vCPU. And when determining the target vCPU, the scheduling information of all online vCPUs in the preset online list can be compared, and the load information of all online vCPUs in the preset online list can be compared to determine the online vCPU with the smallest load, and use the online vCPU with the smallest load as the target vCPU.
对于步骤S40,将所述中断请求发送至所述目标vCPU进行中断处理。For step S40, the interrupt request is sent to the target vCPU for interrupt processing.
示例性的,在确定目标vCPU之后,就可以直接将中断请求发送至目标vCPU进行中断处理,并在中断处理完成之后,再接收到由物理设备或者虚拟设备发送新的中断请求后,可以继续由此目标vCPU进行处理。Exemplarily, after determining the target vCPU, the interrupt request can be directly sent to the target vCPU for interrupt processing, and after the interrupt processing is completed, after receiving a new interrupt request sent by a physical device or a virtual device, the target vCPU can continue to process it.
此外,为辅助理解本实施例中中断请求处理流程的理解,下面进行举例说明。In addition, to assist in understanding the interrupt request processing flow in this embodiment, an example is given below.
例如,如图3所示,包括虚拟机、硬件和虚拟机监视器,并且在虚拟机监视器中设置vCPU调度信息模块,vCPU负载信息模块和中断请求的目标vCPU重定向模块。在虚拟机监视器监测到虚拟设备或者物理设备产生中断请求之后,会通过中断请求的目标vCPU重定向模块来拦截这个中断请求。并且会创建两个信息通道,vCPU通过两个信息通道分别 获取实时的vCPU调度状态和vCPU负载均衡信息,也就是vCPU调度信息模块通过一个信息通道监测vCPU调度器,以获取vCPU调度信息。vCPU负载信息模块通过另一个信息通道监测各个vCPU的通告中断,以获取vCPU中断负载信息。虚拟机监视器智能地根据vCPU调度状态和vCPU负载均衡信息寻找到最合适的vCPU来处理该中断请求,以完成优化PI机制,从而尽可能减少客户机的IO事件处理延迟。For example, as shown in FIG3 , a virtual machine, hardware, and a virtual machine monitor are included, and a vCPU scheduling information module, a vCPU load information module, and a target vCPU redirection module for interrupt requests are set in the virtual machine monitor. After the virtual machine monitor detects that a virtual device or a physical device generates an interrupt request, the target vCPU redirection module for the interrupt request will intercept the interrupt request. Two information channels will be created, and the vCPUs will be sent to the virtual machine monitor through the two information channels. Get real-time vCPU scheduling status and vCPU load balancing information, that is, the vCPU scheduling information module monitors the vCPU scheduler through an information channel to obtain vCPU scheduling information. The vCPU load information module monitors the notification interrupts of each vCPU through another information channel to obtain vCPU interrupt load information. The virtual machine monitor intelligently finds the most suitable vCPU to handle the interrupt request based on the vCPU scheduling status and vCPU load balancing information to complete the optimization PI mechanism, thereby minimizing the client's IO event processing delay.
再例如,如图4所示,在接收到中断请求之后,获取vCPU的调度信息与中断负载信息(即负载信息),根据vCPU的调度信息与中断负载信息选择一个负载最小的vCPU的作为处理此中断请求的目标vCPU,然后判断预设在线列表中是否存储有在线vCPU且所有在线vCPU的平均中断负载数量出超过阈值,若满足条件则向当前目标vCPU通过中断,进行中断处理,若无法找到在线vCPU或者在线vCPU平均中断负载数量超过阈值,则将预设离线队列的队首vCPU作为目标vCPU,并向此目标vCPU通告中断,确定了处理中断请求的目标vCPU之后,则根据此中断请求更新vCPU的中断负载信息。For another example, as shown in Figure 4, after receiving an interrupt request, the scheduling information and interrupt load information (i.e., load information) of the vCPU are obtained, and a vCPU with the smallest load is selected as the target vCPU for processing the interrupt request based on the scheduling information and interrupt load information of the vCPU. Then, it is determined whether there are online vCPUs stored in the preset online list and whether the average interrupt load number of all online vCPUs exceeds the threshold. If the conditions are met, an interrupt is passed to the current target vCPU for interrupt processing. If the online vCPU cannot be found or the average interrupt load number of the online vCPU exceeds the threshold, the head vCPU of the preset offline queue is used as the target vCPU, and the interrupt is notified to the target vCPU. After the target vCPU for processing the interrupt request is determined, the interrupt load information of the vCPU is updated according to the interrupt request.
本实施例通过响应于中断请求,检测预设在线列表中是否包括在线虚拟中央处理器vCPU;在检测结果为是的情况下,获取至少一个所述在线vCPU对应的调度信息和负载信息;根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU;将所述中断请求发送至所述目标vCPU进行中断处理,实现了根据在线列表中所有vCPU的调度信息与负载信息将中断请求重定向至负载最小的目标vCPU进行处理,克服了现有技术中处理中断请求时虚拟机管理器与虚拟机之间昂贵的上下文切换,或者无法动态地根据vCPU的调度情况和负载情况选择负载最小的vCPU处理接收到的中断请求,从而导致中断请求处理时间延迟长的技术缺陷,所以,减少了vCPU的中断请求处理时间延迟。This embodiment detects whether an online virtual central processing unit vCPU is included in a preset online list in response to an interrupt request; if the detection result is yes, obtains scheduling information and load information corresponding to at least one of the online vCPUs; selects an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information; and sends the interrupt request to the target vCPU for interrupt processing, thereby redirecting the interrupt request to the target vCPU with the smallest load for processing according to the scheduling information and load information of all vCPUs in the online list, overcoming the technical defects of the prior art in which expensive context switching between the virtual machine manager and the virtual machine when processing interrupt requests, or the inability to dynamically select the vCPU with the smallest load to process the received interrupt request according to the scheduling and load conditions of the vCPU, thereby reducing the interrupt request processing time delay of the vCPU.
基于上述本申请的第一实施例,提出本申请中断请求处理方法的第二实施例,在本实施例中,上述实施例步骤S30,根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU,包括:Based on the first embodiment of the present application, a second embodiment of the interrupt request processing method of the present application is proposed. In this embodiment, in step S30 of the above embodiment, selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information includes:
步骤a,基于所述负载信息获取所述在线vCPU对应的中断负载数量,基于所述调度信息获取所述在线vCPU对应的调度状态;Step a, obtaining the interruption load quantity corresponding to the online vCPU based on the load information, and obtaining the scheduling state corresponding to the online vCPU based on the scheduling information;
步骤b,在所有所述调度状态均是未处理中断状态之后,根据所述中断负载数量在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU。Step b: after all the scheduling states are in the unprocessed interrupt state, select an online vCPU with the smallest load from at least one of the online vCPUs as a target vCPU according to the interrupt load quantity.
示例性的,由于vCPU的调度信息记录每一个vCPU的调度状态,在线vCPU的调度状态包括处理中断状态与未处理中断状态。其中处理中断状态是指某个在线vCPU被选中处理一个中断的状态,而除处理中断状态之外的所有状态都为未处于处理中断状态。若根据预设在线列表中所有在线vCPU的调度信息确定每一个在线vCPU的调度状态均是未处理中断状态,进而根据预设在线列表中所有在线vCPU的负载信息确定每一个在线vCPU上的中断负载数量,从而筛选出一个包含最少中断负载数量的在线vCPU作为接收被处理中断请求的目标vCPU。例如,参照图4,如果先入先出队列结构的预设在线列表中有4个在线vCPU分别为vCPU1、vCPU2、vCPU3和vCPU4,且4个在线vCPU的调度状态均是未处理中断状态,与vCPU1、vCPU2、vCPU3和vCPU4相对应的中断负载数量为10、 4、15、8,则选择中断负载数量最小(即4)对应的在线vCPU(即vCPU2)作为目标vCPU。Exemplarily, since the scheduling information of the vCPU records the scheduling status of each vCPU, the scheduling status of the online vCPU includes the processing interrupt status and the unprocessed interrupt status. The processing interrupt status refers to the state in which a certain online vCPU is selected to process an interrupt, and all states except the processing interrupt status are not in the processing interrupt status. If it is determined that the scheduling status of each online vCPU is the unprocessed interrupt status according to the scheduling information of all online vCPUs in the preset online list, and then the number of interrupt loads on each online vCPU is determined according to the load information of all online vCPUs in the preset online list, an online vCPU with the least number of interrupt loads is screened out as the target vCPU for receiving the processed interrupt request. For example, referring to Figure 4, if there are 4 online vCPUs in the preset online list of the first-in-first-out queue structure, namely vCPU1, vCPU2, vCPU3 and vCPU4, and the scheduling status of the 4 online vCPUs is the unprocessed interrupt status, the number of interrupt loads corresponding to vCPU1, vCPU2, vCPU3 and vCPU4 is 10, 4, 15, 8, then the online vCPU (i.e., vCPU2) corresponding to the smallest number of interrupt loads (i.e., 4) is selected as the target vCPU.
在本实施例中,在接收到中断请求之后,通过获取的在线vCPU调度状态和vCPU中断负载数量,将中断请求重定向至在线负载最小的vCPU进行处理,降低了由vCPU的调度延迟转化的虚拟机I/O事件处理延迟,减少了vCPU的中断请求的处理时间延迟,进而避免中断请求处理时间延迟较长对虚拟机的I/O性能影响。In this embodiment, after receiving an interrupt request, the interrupt request is redirected to the vCPU with the smallest online load for processing by obtaining the online vCPU scheduling status and the number of vCPU interrupt loads, thereby reducing the virtual machine I/O event processing delay converted by the vCPU scheduling delay, reducing the processing time delay of the vCPU interrupt request, and thereby avoiding the impact of the long interrupt request processing time delay on the I/O performance of the virtual machine.
在一实施例中,根据所述中断负载数量在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU,包括:In one embodiment, selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the interrupt load quantity includes:
步骤c,确定所有所述中断负载数量对应的平均中断负载数量;Step c, determining an average interruption load quantity corresponding to all the interruption load quantities;
步骤d,在所述平均中断负载数量小于第一预设阈值之后,确定所有所述中断负载数量中的最小中断负载数量;Step d, after the average interruption load quantity is less than a first preset threshold, determining a minimum interruption load quantity among all the interruption load quantities;
步骤e,将所述最小中断负载数量对应的在线vCPU作为目标vCPU。Step e: taking the online vCPU corresponding to the minimum interrupt load number as the target vCPU.
示例性的,在确定了所有在线vCPU均是未处理中断状态之后,获取所有在线vCPU对应的中断负载数量,并对所有中断负载数量取平均值,得到平均中断负载数量。然后将平均中断负载数量与第一预设阈值进行比较。在平均中断负载数量小于第一预设阈值之后,从所有在线vCPU中选择负载最小的在线vCPU作为目标vCPU,即选择最小中断负载数量对应的在线vCPU作为目标vCPU。在平均中断负载数量大于或者等于第一预设阈值之后,在预设离线列表中选择一个满足条件的离线vCPU作为目标vCPU。其中,第一预设阈值可以依据vCPU调度延迟和平均中断请求处理时间的比值而确定。例如,如果4个均是未处于处理中断状态的在线vCPU(vCPU1、vCPU2、vCPU3、vCPU4),对应的中断负载数量为(10、4、15、8),计算得到4个在线vCPU的平均中断负载数量为9.25,此时若第一预设阈值为8,则平均中断负载数量小于第一预设阈值,选择最小中断负载输数量对应的在线vCPU即vCPU2作为目标vCPU。Exemplarily, after determining that all online vCPUs are in an unprocessed interrupt state, the number of interrupt loads corresponding to all online vCPUs is obtained, and the average of all interrupt load numbers is taken to obtain the average interrupt load number. The average interrupt load number is then compared with the first preset threshold. After the average interrupt load number is less than the first preset threshold, the online vCPU with the smallest load is selected from all online vCPUs as the target vCPU, that is, the online vCPU corresponding to the smallest interrupt load number is selected as the target vCPU. After the average interrupt load number is greater than or equal to the first preset threshold, an offline vCPU that meets the conditions is selected in the preset offline list as the target vCPU. Among them, the first preset threshold can be determined based on the ratio of the vCPU scheduling delay and the average interrupt request processing time. For example, if there are four online vCPUs (vCPU1, vCPU2, vCPU3, vCPU4) that are not in the interrupt processing state, the corresponding interrupt load numbers are (10, 4, 15, 8), and the average interrupt load number of the four online vCPUs is calculated to be 9.25. At this time, if the first preset threshold is 8, the average interrupt load number is less than the first preset threshold, and the online vCPU corresponding to the minimum interrupt load number, that is, vCPU2, is selected as the target vCPU.
在本实施例中,在确定了预设在线列表中的所有在线vCPU均是未处理中断状态之后,可以根据在线vCPU的负载信息选择最小中断负载数量对应的在线vCPU作为处理中断请求的目标vCPU,实现了中断请求分发至目标vCPU的负载均衡,设定vCPU上中断负载平均阈值,确保中断请求的处理延迟始终为在vCPU上已有中断请求队列的总计处理时间和vCPU调度延迟开销的最小值,减少中断请求的等待时间。In this embodiment, after determining that all online vCPUs in the preset online list are in an unprocessed interrupt state, the online vCPU corresponding to the minimum interrupt load number can be selected as the target vCPU for processing the interrupt request based on the load information of the online vCPU, thereby achieving load balancing of the interrupt request distribution to the target vCPU, setting the average threshold of the interrupt load on the vCPU, and ensuring that the processing delay of the interrupt request is always the minimum value of the total processing time of the existing interrupt request queue on the vCPU and the vCPU scheduling delay overhead, thereby reducing the waiting time of the interrupt request.
在一实施例中,确定所有所述中断负载数量对应的平均中断负载数量之后,包括:In one embodiment, after determining the average interruption load number corresponding to all the interruption load numbers, the method includes:
步骤f,在所述平均中断负载数量大于或者等于第一预设阈值之后,则按照预设存储顺序从预设离线列表中选择一个离线vCPU作为目标vCPU。Step f: after the average interruption load number is greater than or equal to the first preset threshold, select an offline vCPU from the preset offline list as the target vCPU according to the preset storage order.
示例性的,由于预设在线列表与预设离线列表均是先入先出的队列结构,因此如果所有在线vCPU的平均中断负载数量大于或者等于第一预设阈值时,可以按照先入先出的存储顺序(即预设存储顺序)选择预设离线列表队首的离线vCPU作为目标vCPU,预设离线队表中的队首vCPU是离线时间最长的vCPU,且将是第一个恢复在线状态的vCPU,也会是第一个进入运行状态的vCPU,从而避免了在线vCPU上的中断负载数量过重,而出现CPU运行异常或者中断请求处理异常退出等异常情况的出现,保证了所有在线CPU上所有中断请求均能被有效且准确的完成处理。Exemplarily, since both the preset online list and the preset offline list are first-in-first-out queue structures, if the average interrupt load of all online vCPUs is greater than or equal to the first preset threshold, the offline vCPU at the head of the preset offline list can be selected as the target vCPU according to the first-in-first-out storage order (i.e., the preset storage order). The head vCPU in the preset offline queue is the vCPU with the longest offline time, and will be the first vCPU to resume online status and the first vCPU to enter the running status, thereby avoiding the occurrence of abnormal situations such as CPU operation abnormality or abnormal exit of interrupt request processing due to excessive interrupt load on the online vCPU, and ensuring that all interrupt requests on all online CPUs can be effectively and accurately processed.
例如,如果4个均是未处于处理中断状态的在线vCPU(vCPU1、vCPU2、vCPU3、 vCPU4),对应的中断负载数量为(10、4、15、8),计算得到4个在线vCPU的平均中断负载数量为9.25,若第一预设阈值为10,则平均中断负载数量大于第一预设阈值,此时选择预设离线列表中满足条件的离线vCPU作为目标vCPU。For example, if all four vCPUs are online and not in the interrupt processing state (vCPU1, vCPU2, vCPU3, vCPU4), the corresponding interrupt load quantity is (10, 4, 15, 8), and the average interrupt load quantity of the 4 online vCPUs is calculated to be 9.25. If the first preset threshold is 10, the average interrupt load quantity is greater than the first preset threshold. At this time, the offline vCPU that meets the conditions in the preset offline list is selected as the target vCPU.
在一实施例中,基于所述调度信息获取所述在线vCPU对应的调度状态之后,包括:In one embodiment, after obtaining the scheduling state corresponding to the online vCPU based on the scheduling information, the method includes:
步骤g,在所有所述调度状态中存在处理中断状态之后,确定所有所述中断负载数量中的最大中断负载数量与最小中断负载数量;Step g, after there is a processing interruption state in all the scheduling states, determining the maximum interruption load number and the minimum interruption load number among all the interruption load numbers;
步骤h,确定所述最大中断负载数量与所述最小中断负载数量之间的比值;Step h, determining the ratio between the maximum interruption load number and the minimum interruption load number;
步骤i,在所述比值大于第二预设阈值之后,继续执行根据所述中断负载数量在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU的步骤。Step i, after the ratio is greater than a second preset threshold, continue to execute the step of selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the number of interrupt loads.
示例性的,如果在线vCPU中有一个被选中处理一个中断,即处于处理中断状态,并且当前所有在线vCPU上的中断负载数量最大值以及中断负载数量最小值之间的比值大于预设经验值(即第二预设阈值)时,仍会选择中断负载数量最小值对应的在线vCPU作为目标vCPU,若所述比值小于或者等于预设经验值时则认为此时选择正在处理中断的在线vCPU作为目标vCPU,其中预设经验值可以是用户提前设置的任意值。例如,如果有4个在线vCPU(vCPU1、vCPU2、vCPU3、vCPU4),对应的中断负载数量为(10、4、15、8),且vCPU4是处于处理中断状态,vCPU1、vCPU2与vCPU3均是未处理中断状态,计算得到最大中断负载数量与最小中断负载数量的比值为3.75且平均中断负载数量为9.25,此时若提前设置好的预设检验值为4且第一预设阈值为8,则比值大于预设经验值且平均中断负载数量小于第一预设阈值,此时选择最小中断负载数量对应的在线vCPU即vCPU2作为目标vCPU若提前设置好的预设检验值为4且第一预设阈值为10,则比值大于预设经验值且平均中断负载大于第一预设阈值,此时选择预设连线列表中满足条件的连线vCPU作为目标vCPU;若提前设置好的预设检验值3,则比值小于预设经验值,此时选择处于处理中断状态的在线vCPU即vCPU4作为目标vCPU。Exemplarily, if one of the online vCPUs is selected to handle an interrupt, that is, it is in the interrupt processing state, and the ratio between the maximum number of interrupt loads and the minimum number of interrupt loads on all current online vCPUs is greater than a preset experience value (i.e., the second preset threshold), the online vCPU corresponding to the minimum number of interrupt loads will still be selected as the target vCPU. If the ratio is less than or equal to the preset experience value, it is considered that the online vCPU that is processing the interrupt is selected as the target vCPU at this time, where the preset experience value can be any value set in advance by the user. For example, if there are 4 online vCPUs (vCPU1, vCPU2, vCPU3, vCPU4), the corresponding interrupt load numbers are (10, 4, 15, 8), and vCPU4 is in the interrupt processing state, vCPU1, vCPU2 and vCPU3 are all in the unprocessed interrupt state, and the ratio of the maximum interrupt load number to the minimum interrupt load number is calculated to be 3.75 and the average interrupt load number is 9.25. At this time, if the preset test value set in advance is 4 and the first preset threshold is 8, the ratio is greater than the preset experience value and the average interrupt load number is less than the first preset threshold. At this time, the online vCPU corresponding to the minimum interrupt load number, that is, vCPU2, is selected as the target vCPU. If the preset test value set in advance is 4 and the first preset threshold is 10, the ratio is greater than the preset experience value and the average interrupt load is greater than the first preset threshold. At this time, the connected vCPU that meets the conditions in the preset connection list is selected as the target vCPU; if the preset test value set in advance is 3, the ratio is less than the preset experience value. At this time, the online vCPU in the interrupt processing state, that is, vCPU4, is selected as the target vCPU.
在本实施例中,通过在所有调度状态中存在处理中断状态之后,确定所有中断负载数量中的最大中断负载数量与最小中断负载数量之间的比例,并在比值大于第二预设阈值之后,在各个在线vCPU中选择负载最小的在线vCPU作为目标vCPU,从而保障了确定的目标vCPU的有效性。In this embodiment, after there is an interrupt processing state in all scheduling states, the ratio between the maximum interrupt load number and the minimum interrupt load number among all interrupt load numbers is determined, and after the ratio is greater than a second preset threshold, the online vCPU with the smallest load is selected as the target vCPU among each online vCPU, thereby ensuring the validity of the determined target vCPU.
在一实施例中,确定所述最大中断负载数量与所述最小中断负载数量的比值之后,包括:In one embodiment, after determining the ratio of the maximum interruption load number to the minimum interruption load number, the method further comprises:
步骤j,在所述比值小于或者等于第二预设阈值之后,选择所有所述在线vCPU中处于处理中断状态的在线vCPU作为目标vCPU。Step j: after the ratio is less than or equal to a second preset threshold, select an online vCPU in a processing interrupt state among all the online vCPUs as a target vCPU.
示例性的,如果所有在线vCPU的最大中断负载数量与最小中断负载数量的比值小于或者等于第二预设阈值之后,则选择处理中断状态的在线vCPU作为目标vCPU,并实时更新vCPU负载信息,且会将后续的中断请求均重定向至此在线vCPU,直到它被vCPU调度器取消调度或者所述比值大于预设经验值之后,触发重定向选择一个新的中断负载最小的在线vCPU作为重定向目标vCPU,从而保证了中断请求到来时,如果有正在处理中断的在线vCPU则将中断请求发送至此在线vCPU进行处理,由于此在线vCPU正在处理中断,因此此时将中断请求交付给此在线vCPU可以保证中断请求可以被立即处理而减少 处理时间延迟,而且只有在上述比值小于或者等于预设经验值时才会将中断请求重定向至正在处理中断的在线vCPU,从而确保了每个在线vCPU的负载均衡。Exemplarily, if the ratio of the maximum number of interrupt loads to the minimum number of interrupt loads of all online vCPUs is less than or equal to a second preset threshold value, the online vCPU that is processing the interrupt status is selected as the target vCPU, and the vCPU load information is updated in real time, and subsequent interrupt requests are redirected to this online vCPU until it is canceled by the vCPU scheduler or the ratio is greater than a preset empirical value, triggering redirection to select a new online vCPU with the smallest interrupt load as the redirection target vCPU, thereby ensuring that when an interrupt request arrives, if there is an online vCPU that is processing an interrupt, the interrupt request will be sent to this online vCPU for processing. Since this online vCPU is processing an interrupt, delivering the interrupt request to this online vCPU at this time can ensure that the interrupt request can be processed immediately and reduce The processing time delay is reduced, and the interrupt request is redirected to the online vCPU that is processing the interrupt only when the above ratio is less than or equal to the preset experience value, thereby ensuring the load balancing of each online vCPU.
此外,参照图5,本申请实施例提供了一种中断请求处理系统,包括:In addition, referring to FIG. 5 , an embodiment of the present application provides an interrupt request processing system, including:
检测模块A10,用于响应于中断请求,检测预设在线列表中是否包括在线虚拟中央处理器vCPU;A detection module A10, configured to detect, in response to an interrupt request, whether a preset online list includes an online virtual central processing unit vCPU;
信息获取模块A20,用于在检测结果为是的情况下,获取至少一个所述在线vCPU对应的调度信息和负载信息;The information acquisition module A20 is used to obtain the scheduling information and load information corresponding to at least one of the online vCPUs when the detection result is yes;
重定向模块A30,用于根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的vCPU作为目标vCPU;A redirection module A30, configured to select a vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
处理模块A40,用于将所述中断请求发送至所述目标vCPU进行中断处理。The processing module A40 is used to send the interrupt request to the target vCPU for interrupt processing.
其中,所述重定向模块A30,还用于:Wherein, the redirection module A30 is further used for:
基于所述负载信息获取所述在线vCPU对应的中断负载数量,基于所述调度信息获取所述在线vCPU对应的调度状态;Acquire the interruption load quantity corresponding to the online vCPU based on the load information, and acquire the scheduling state corresponding to the online vCPU based on the scheduling information;
在所有所述调度状态均是未处理中断状态之后,根据所述中断负载数量在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU。After all the scheduling states are in an unprocessed interrupt state, an online vCPU with the smallest load is selected as a target vCPU from at least one of the online vCPUs according to the interrupt load quantity.
其中,所述重定向模块A30,还用于:Wherein, the redirection module A30 is further used for:
确定所有所述中断负载数量对应的平均中断负载数量;Determine an average interruption load quantity corresponding to all of the interruption load quantities;
在所述平均中断负载数量小于第一预设阈值之后,确定所有所述中断负载数量中的最小中断负载数量;After the average interruption load quantity is less than a first preset threshold, determining a minimum interruption load quantity among all the interruption load quantities;
将所述最小中断负载数量对应的在线vCPU作为目标vCPU。The online vCPU corresponding to the minimum interrupt load number is used as the target vCPU.
其中,所述重定向模块A30,还用于:Wherein, the redirection module A30 is further used for:
在所述平均中断负载数量大于或者等于第一预设阈值之后,则按照预设存储顺序从预设离线列表中选择一个离线vCPU作为目标vCPU。After the average interrupt load number is greater than or equal to the first preset threshold, an offline vCPU is selected from the preset offline list as the target vCPU according to the preset storage order.
其中,所述重定向模块A30,还用于:Wherein, the redirection module A30 is further used for:
在所有所述调度状态中存在处理中断状态之后,确定所有所述中断负载数量中的最大中断负载数量与最小中断负载数量;After a processing interruption state exists in all the scheduling states, determining a maximum interruption load number and a minimum interruption load number among all the interruption load numbers;
确定所述最大中断负载数量与所述最小中断负载数量之间的比值;determining a ratio between the maximum interruption load number and the minimum interruption load number;
在所述比值大于第二预设阈值之后,继续执行根据所述中断负载数量在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU的步骤。After the ratio is greater than a second preset threshold, the step of selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the interrupt load quantity is continued.
其中,所述重定向模块A30,还用于:Wherein, the redirection module A30 is further used for:
在所述比值小于或者等于第二预设阈值之后,选择所有所述在线vCPU中处于处理中断状态的在线vCPU作为目标vCPU。After the ratio is less than or equal to the second preset threshold, an online vCPU in a processing interrupt state among all the online vCPUs is selected as a target vCPU.
其中,所述信息获取模块A20,用于:Wherein, the information acquisition module A20 is used to:
在确定所述预设在线列表为空表之后,则按照预设存储顺序从预设离线列表中选择一个离线vCPU作为目标vCPU,其中,所述空表未包括在线vCPU。After determining that the preset online list is an empty list, an offline vCPU is selected as a target vCPU from the preset offline list according to a preset storage order, wherein the empty list does not include an online vCPU.
本申请中断请求处理系统具体实施方式与上述中断请求处理方法各实施例基本相同,在此不再赘述。The specific implementation of the interrupt request processing system of the present application is basically the same as the above-mentioned embodiments of the interrupt request processing method, and will not be repeated here.
此外,本申请还提供一种中断请求处理设备,中断请求处理设备包括存储器、处理器 及存储在存储器上并可在处理器上运行的中断请求处理程序,中断请求处理程序被处理器执行时实现如上述的中断请求处理方法的步骤。In addition, the present application also provides an interrupt request processing device, the interrupt request processing device includes a memory, a processor and an interrupt request processing program stored in the memory and executable on the processor, wherein the interrupt request processing program implements the steps of the interrupt request processing method as described above when executed by the processor.
此外,在一实施例中,图6为本申请的一个实施例中断请求处理设备的结构示意图,如图6所示,在硬件层面,该中断请求处理设备包括处理器,可选地还包括内部总线、网络接口、存储器。其中,存储器可能包含内存,例如高速随机存取存储器(Random-Access Memory,RAM),也可能还包括非易失性存储器(non-volatile memory),例如至少1个磁盘存储器等。当然,该中断请求处理设备还可能包括其他业务所需要的硬件。处理器、网络接口和存储器可以通过内部总线相互连接,该内部总线可以是ISA(Industry Standard Architecture,工业标准体系结构)总线、PCI(Peripheral Component Interconnect,外设部件互连标准)总线或EISA(Extended Industry Standard Architecture,扩展工业标准结构)总线等。所述总线可以分为地址总线、数据总线、控制总线等。为便于表示,图6中仅用一个双向箭头表示,但并不表示仅有一根总线或一种类型的总线。存储器,用于存放程序。在一实施方式中,程序可以包括程序代码,所述程序代码包括计算机操作指令。处理器从非易失性存储器中读取对应的计算机程序到存储器中然后运行,在逻辑层面上形成共享资源访问控制装置。处理器,执行存储器所存放的程序,并具体用于执行上述防窜货管控方法的步骤。In addition, in one embodiment, FIG6 is a schematic diagram of the structure of an interrupt request processing device in one embodiment of the present application. As shown in FIG6, at the hardware level, the interrupt request processing device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. Among them, the memory may include a memory, such as a high-speed random access memory (Random-Access Memory, RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage, etc. Of course, the interrupt request processing device may also include hardware required for other services. The processor, the network interface, and the memory may be interconnected through an internal bus, and the internal bus may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one bidirectional arrow is used in FIG6, but it does not mean that there is only one bus or one type of bus. The memory is used to store programs. In one embodiment, the program may include a program code, and the program code includes a computer operation instruction. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a shared resource access control device at the logical level. The processor executes the program stored in the memory and is specifically used to execute the steps of the above-mentioned anti-channelling control method.
本申请中断请求处理设备具体实施方式与上述网络优化方法各实施例基本相同,在此不再赘述。The specific implementation of the interrupt request processing device of the present application is basically the same as the embodiments of the above-mentioned network optimization method, and will not be repeated here.
此外,本申请还提供了一种存储介质,可以为计算机可读存储介质,所述计算机可读存储介质存储有一个或者一个以上程序,所述一个或者一个以上程序还可被一个或者一个以上的处理器执行以用于实现上述存储器访问方法各实施例的步骤。In addition, the present application also provides a storage medium, which can be a computer-readable storage medium, and the computer-readable storage medium stores one or more programs. The one or more programs can also be executed by one or more processors to implement the steps of each embodiment of the above-mentioned memory access method.
本申请计算机可读存储介质具体实施方式与上述存储器访问方法各实施例基本相同,在此不再赘述。The specific implementation of the computer-readable storage medium of the present application is basically the same as the above-mentioned embodiments of the memory access method, and will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机、计算机、服务器或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application is essentially or the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium (such as ROM/RAM, magnetic disk, optical disk) as described above, including a number of instructions for enabling a terminal device (which can be a mobile phone, computer, server or network device, etc.) to execute the methods described in each embodiment of the present application.
以上仅为本申请的可选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。 The above are only optional embodiments of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent protection scope of the present application.

Claims (10)

  1. 一种中断请求处理方法,其中,所述方法包括:A method for processing an interrupt request, wherein the method comprises:
    响应于中断请求,检测预设在线列表中是否包括在线虚拟中央处理器vCPU;In response to the interrupt request, detecting whether a preset online list includes an online virtual central processing unit vCPU;
    在检测结果为是的情况下,获取至少一个所述在线vCPU对应的调度信息和负载信息;If the detection result is yes, obtaining scheduling information and load information corresponding to at least one of the online vCPUs;
    根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU;Selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
    将所述中断请求发送至所述目标vCPU进行中断处理。The interrupt request is sent to the target vCPU for interrupt processing.
  2. 如权利要求1所述的中断请求处理方法,其中,所述根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU,包括:The interrupt request processing method according to claim 1, wherein the selecting, according to the scheduling information and the load information, an online vCPU with the smallest load as the target vCPU from at least one of the online vCPUs comprises:
    基于所述负载信息获取所述在线vCPU对应的中断负载数量,基于所述调度信息获取所述在线vCPU对应的调度状态;Acquire the interruption load quantity corresponding to the online vCPU based on the load information, and acquire the scheduling state corresponding to the online vCPU based on the scheduling information;
    在所有所述调度状态均是未处理中断状态之后,根据所述中断负载数量在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU。After all the scheduling states are in an unprocessed interrupt state, an online vCPU with the smallest load is selected as a target vCPU from at least one of the online vCPUs according to the interrupt load quantity.
  3. 如权利要求2所述的中断请求处理方法,其中,所述根据所述中断负载数量在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU,包括:The interrupt request processing method according to claim 2, wherein the selecting, according to the interrupt load quantity, an online vCPU with the smallest load from at least one of the online vCPUs as the target vCPU comprises:
    确定所有所述中断负载数量对应的平均中断负载数量;Determine an average interruption load quantity corresponding to all of the interruption load quantities;
    在所述平均中断负载数量小于第一预设阈值之后,确定所有所述中断负载数量中的最小中断负载数量;After the average interruption load quantity is less than a first preset threshold, determining a minimum interruption load quantity among all the interruption load quantities;
    将所述最小中断负载数量对应的在线vCPU作为目标vCPU。The online vCPU corresponding to the minimum interrupt load number is used as the target vCPU.
  4. 如权利要求3所述的中断请求处理方法,其中,所述确定所有所述中断负载数量对应的平均中断负载数量之后,包括:The interrupt request processing method according to claim 3, wherein after determining the average interrupt load number corresponding to all the interrupt load numbers, the method further comprises:
    在所述平均中断负载数量大于或者等于第一预设阈值之后,则按照预设存储顺序从预设离线列表中选择一个离线vCPU作为目标vCPU。After the average interrupt load number is greater than or equal to the first preset threshold, an offline vCPU is selected from the preset offline list as the target vCPU according to the preset storage order.
  5. 如权利要求2所述的中断请求处理方法,其中,所述基于所述调度信息获取所述在线vCPU对应的调度状态之后,包括:The interrupt request processing method according to claim 2, wherein after acquiring the scheduling state corresponding to the online vCPU based on the scheduling information, the method further comprises:
    在所有所述调度状态中存在处理中断状态之后,确定所有所述中断负载数量中的最大中断负载数量与最小中断负载数量;After a processing interruption state exists in all the scheduling states, determining a maximum interruption load number and a minimum interruption load number among all the interruption load numbers;
    确定所述最大中断负载数量与所述最小中断负载数量之间的比值;determining a ratio between the maximum interruption load number and the minimum interruption load number;
    在所述比值大于第二预设阈值之后,继续执行根据所述中断负载数量在至少一个所述在线vCPU中选择负载最小的在线vCPU作为目标vCPU的步骤。After the ratio is greater than a second preset threshold, the step of selecting an online vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the interrupt load quantity is continued.
  6. 如权利要求5所述的中断请求处理方法,其中,所述确定所述最大中断负载数量 与所述最小中断负载数量的比值之后,包括:The interrupt request processing method according to claim 5, wherein the determining of the maximum interrupt load number The ratio of the minimum interruption load number includes:
    在所述比值小于或者等于第二预设阈值之后,选择所有所述在线vCPU中处于处理中断状态的在线vCPU作为目标vCPU。After the ratio is less than or equal to the second preset threshold, an online vCPU in a processing interrupt state among all the online vCPUs is selected as a target vCPU.
  7. 如权利要求1所述的中断请求处理方法,其中,所述检测预设在线列表中是否包括在线虚拟中央处理器vCPU之后,包括:The interrupt request processing method according to claim 1, wherein after detecting whether the preset online list includes an online virtual central processing unit vCPU, the method further comprises:
    在确定所述预设在线列表为空表之后,则按照预设存储顺序从预设离线列表中选择一个离线vCPU作为目标vCPU,其中,所述空表未包括在线vCPU。After determining that the preset online list is an empty list, an offline vCPU is selected as a target vCPU from the preset offline list according to a preset storage order, wherein the empty list does not include an online vCPU.
  8. 一种中断请求处理系统,其中,所述系统包括:An interrupt request processing system, wherein the system comprises:
    检测模块,设置为响应于中断请求,检测预设在线列表中是否包括在线虚拟中央处理器vCPU;A detection module, configured to detect whether a preset online list includes an online virtual central processing unit vCPU in response to an interrupt request;
    信息获取模块,设置为在检测结果为是的情况下,获取至少一个所述在线vCPU对应的调度信息和负载信息;An information acquisition module, configured to acquire scheduling information and load information corresponding to at least one of the online vCPUs when the detection result is yes;
    重定向模块,设置为根据所述调度信息与所述负载信息在至少一个所述在线vCPU中选择负载最小的vCPU作为目标vCPU;A redirection module, configured to select a vCPU with the smallest load as a target vCPU from at least one of the online vCPUs according to the scheduling information and the load information;
    处理模块,设置为将所述中断请求发送至所述目标vCPU进行中断处理。The processing module is configured to send the interrupt request to the target vCPU for interrupt processing.
  9. 一种中断请求处理设备,其中,所述中断请求处理设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上执行的中断请求处理程序,所述中断请求处理程序被所述处理器执行时实现如权利要求1至7中任一项所述的中断请求处理方法的步骤。An interrupt request processing device, wherein the interrupt request processing device comprises a memory, a processor, and an interrupt request processing program stored in the memory and executable on the processor, and when the interrupt request processing program is executed by the processor, the steps of the interrupt request processing method as described in any one of claims 1 to 7 are implemented.
  10. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有中断请求处理程序,所述中断请求处理程序被处理器执行时实现如权利要求1至7中任一项所述的中断请求处理方法的步骤。 A computer-readable storage medium, wherein an interrupt request processing program is stored on the computer-readable storage medium, and when the interrupt request processing program is executed by a processor, the steps of the interrupt request processing method according to any one of claims 1 to 7 are implemented.
PCT/CN2023/130987 2022-12-05 2023-11-10 Interrupt request processing method, system, device and computer-readable storage medium WO2024120118A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211557937.X 2022-12-05
CN202211557937.XA CN118152063A (en) 2022-12-05 2022-12-05 Interrupt request processing method, system, device and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2024120118A1 true WO2024120118A1 (en) 2024-06-13

Family

ID=91299642

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/130987 WO2024120118A1 (en) 2022-12-05 2023-11-10 Interrupt request processing method, system, device and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN118152063A (en)
WO (1) WO2024120118A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150121377A1 (en) * 2013-10-31 2015-04-30 Huawei Technologies Co., Ltd. Method for implementing inter-virtual processor interrupt, related apparatus, and system
US20160259664A1 (en) * 2014-01-15 2016-09-08 Shanghai Jiao Tong University Method for dynamic interrupt balanced mapping based on current scheduling states of vcpus
US20220027183A1 (en) * 2020-07-22 2022-01-27 Vmware, Inc. Fine-grained application-aware latency optimization for virtual machines at runtime
CN114253709A (en) * 2021-11-18 2022-03-29 阿里巴巴(中国)有限公司 Load scheduling method and system
CN114371907A (en) * 2020-10-15 2022-04-19 华为技术有限公司 A chip system, method and corresponding device for processing virtual interrupt

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150121377A1 (en) * 2013-10-31 2015-04-30 Huawei Technologies Co., Ltd. Method for implementing inter-virtual processor interrupt, related apparatus, and system
US20160259664A1 (en) * 2014-01-15 2016-09-08 Shanghai Jiao Tong University Method for dynamic interrupt balanced mapping based on current scheduling states of vcpus
US20220027183A1 (en) * 2020-07-22 2022-01-27 Vmware, Inc. Fine-grained application-aware latency optimization for virtual machines at runtime
CN114371907A (en) * 2020-10-15 2022-04-19 华为技术有限公司 A chip system, method and corresponding device for processing virtual interrupt
CN114253709A (en) * 2021-11-18 2022-03-29 阿里巴巴(中国)有限公司 Load scheduling method and system

Also Published As

Publication number Publication date
CN118152063A (en) 2024-06-07

Similar Documents

Publication Publication Date Title
CN107291547B (en) Task scheduling processing method, device and system
EP2701074B1 (en) Method, device, and system for performing scheduling in multi-processor core system
US10896065B2 (en) Efficient critical thread scheduling for non privileged thread requests
US9772879B2 (en) System and method for isolating I/O execution via compiler and OS support
KR20160033517A (en) Hybrid virtualization scheme for interrupt controller
US20080229319A1 (en) Global Resource Allocation Control
CN102523153B (en) Load balancing method under virtual environment
KR20170139872A (en) Multi-tenant based system and method for providing services
CN102789395A (en) Apparatus and method for managing hypercalls in a virtual machine monitor and monitor thereof
JP2009223842A (en) Virtual machine control program and virtual machine system
Guan et al. Performance enhancement for network I/O virtualization with efficient interrupt coalescing and virtual receive-side scaling
CN109739634A (en) A kind of atomic task execution method and device
Huh et al. Cross‐layer resource control and scheduling for improving interactivity in Android
KR101330609B1 (en) Method For Scheduling of Mobile Multi-Core Virtualization System To Guarantee Real Time Process
US10013283B1 (en) Methods and apparatus for data request scheduling in performing parallel IO operations
CN108255572A (en) A kind of VCPU switching methods and physical host
WO2024120118A1 (en) Interrupt request processing method, system, device and computer-readable storage medium
KR102576443B1 (en) Calculating apparatus and job scheduling method thereof
WO2020166423A1 (en) Resource management device and resource management method
US20230359490A1 (en) Device, system and method for scheduling job requests
CN111427673B (en) Load balancing method, device and equipment
Hu et al. Low latency big data processing without prior information
KR101334842B1 (en) Virtual machine manager for platform of terminal having function of virtualization and method thereof
Liu et al. FEAS: a full-time event aware scheduler for improving responsiveness of virtual machines
Lee et al. Minimizing scheduling delay for multimedia in xen hypervisor

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23899698

Country of ref document: EP

Kind code of ref document: A1