WO2019169582A1 - Method and device for processing interrupt - Google Patents

Method and device for processing interrupt Download PDF

Info

Publication number
WO2019169582A1
WO2019169582A1 PCT/CN2018/078331 CN2018078331W WO2019169582A1 WO 2019169582 A1 WO2019169582 A1 WO 2019169582A1 CN 2018078331 W CN2018078331 W CN 2018078331W WO 2019169582 A1 WO2019169582 A1 WO 2019169582A1
Authority
WO
WIPO (PCT)
Prior art keywords
interrupt
processing unit
sub
cpu
event
Prior art date
Application number
PCT/CN2018/078331
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 华为技术有限公司
Priority to CN201880003669.2A priority Critical patent/CN109791503A/en
Priority to PCT/CN2018/078331 priority patent/WO2019169582A1/en
Publication of WO2019169582A1 publication Critical patent/WO2019169582A1/en

Links

Images

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/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • 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]

Definitions

  • the conventional method of computing device 100 processing system events is described below in conjunction with FIG. 2 based on the architectural diagram of computing device 100 shown in FIG. 2 is a schematic flow diagram of a conventional method of handling system events.
  • the method shown in FIG. 2 includes steps 210 to 220.
  • the method further includes: the interrupt source generates an interrupt request; the interrupt source query interrupt distribution policy determines a target processing unit corresponding to the interrupt request, where the interrupt distribution policy includes: A type of interrupt request is processed by the CPU, and a second type of interrupt request is processed by the co-processing unit; when the interrupt request is the second type of interrupt request, step 310 is performed.
  • the first type of interrupt request is processed by the central processing unit CPU while the CPU has the ability to process the first type of interrupt request.
  • the co-processing unit may not have the ability to process the first type of interrupt request.
  • the co-processing unit cannot acquire a system event that triggers the first type of interrupt request, and therefore, the system event cannot be processed.
  • the routing information may include a port number of a port through which the interrupt request is transmitted, or a routing address of the target processing unit.
  • the interrupt source of the computing device has a one-to-one correspondence with the target processor that processes the system event generated by the interrupt source, the interrupt source may not store the interrupt sub-publish, but directly interrupt the request. Send to the target processing unit corresponding to the interrupt source.
  • the central processing unit may allocate different types of system events to different co-processing unit processing through an event distribution policy. For example, different types of system events are assigned based on the processing capabilities of different co-processing units. Thereby improving the efficiency of the coprocessing unit processing system events.
  • the event distribution policy may be embodied in the form of event sub-publishing, and the event sub-publishing records a mapping relationship between multiple types of system events and multiple co-processing units.
  • the central processing unit instructs the coprocessing unit to process the system event, and the central processing unit is prevented from processing the system due to processing system events, compared to the scheme in which the central processing unit processes all system events in the computing device.
  • the application or OS cannot be run for a long period of time, improving the overall performance of the computing device.
  • the central processing unit may further determine whether to instruct the coprocessing unit to process the system event according to the following three preset rules, where the central processing unit determines whether to instruct the coprocessing unit to process the system event according to the type of the system event.
  • the preset rule 2 when the load of the central processing unit is higher than the target threshold, the coprocessing unit is instructed to process the system event; the preset rule 3, the central processing unit instructs the coprocessing unit to process the sub-event in the system event, so as to cooperate with the co-processing unit Collaborate on system events.
  • the central processing unit may instruct the coprocessing unit to process the system event when the type of the system event is a target type, and the target type indicates the coprocessing unit Process system events with the target type.
  • the sub-events respectively processed by the central processing unit and the co-processing unit may be determined by preset processing rules.
  • the preset processing rule may be set to the coprocessing unit to process the first type of sub-events of the plurality of sub-events, where the first-type sub-event refers to the sub-event that satisfies the target type among the plurality of sub-events; The at least one sub-event satisfies the target type and belongs to the first-type sub-event; the preset rule may be set to the central processing unit to process the second-type sub-event of the plurality of sub-events, the second-type sub-event refers to the multi-event A sub-event to the co-processing unit is not indicated in the sub-event, that is, a sub-event other than the at least one sub-event among the plurality of sub-events
  • the load of the CPU may be specifically represented by parameters such as the occupancy rate of the computing resources of the CPU, the occupancy rate of the storage resources of the CPU, or the number of tasks to be processed by the CPU.
  • the embodiment of the present application does not limit the specific embodiment of the load of the CPU.
  • the target threshold may be preset, for example, may be preset by the CPU at the factory, or may be set by the user during the process of using the CPU. This embodiment of the present application does not specifically limit this.
  • the CPU can handle system events by itself when the CPU load is below or equal to the target threshold.
  • the efficiency of the CPU processing system events is higher relative to the efficiency of the co-processing unit handling system events. Therefore, when the CPU load is lower than or equal to the target threshold, the CPU event can be handled by the CPU itself, which is beneficial to improve the efficiency of processing system events.
  • the preset rule 1 and the preset rule 2 may also be used in combination.
  • the CPU may instruct the coprocessing unit to process the system event. .
  • the sub-events respectively processed by the central processing unit and the co-processing unit may be determined by preset processing rules.
  • the preset processing rule may be set to the coprocessing unit to process the first type of sub-events of the plurality of sub-events, the first type of sub-events including the at least one sub-event;
  • the preset system event processing rule may be set to be centrally processed
  • the unit processes a second type of sub-events of the plurality of sub-events, the second type of sub-events including sub-events of the plurality of sub-events other than the at least one sub-event.
  • the preset rule 3 may be used in combination with the preset rule 2.
  • the method further includes: the CPU acquiring current load information of the CPU; and the CPU is at the current load.
  • the load of the CPU indicated by the information is higher than the target threshold, at least one sub-event is selected from the plurality of sub-events. Further, the CPU instructs the co-processing unit to process the selected at least one sub-event.
  • the preset rule 3 is further used in combination with the preset rule 1.
  • the method further includes: the CPU selecting, from the multiple sub-events, at least one sub-event matching the target type.
  • the target type instructs the co-processing unit to process a sub-event having the target type. Further, the CPU instructs the co-processing unit to process the selected at least one sub-event.
  • FIG. 5 is a schematic flowchart of a method for processing an interrupt according to an embodiment of the present application.
  • the method shown in FIG. 5 includes steps 510 to 530. It should be noted that the description of the nouns in the method shown in FIG. 5 or the specific manner of implementing the method can be referred to the related descriptions in FIG. 3 and FIG. 4. For the sake of brevity, the method shown in FIG. 5 is not specifically described.
  • the central processing unit forwards the interrupt request to the co-processing unit.
  • the co-processing unit may determine a system event that triggers the interrupt request based on the interrupt request, and process the system event.
  • the signaling overhead caused by the transmission interruption information is reduced by reducing the content of the information carried in the interrupt information.
  • the central processing unit forwards the interrupt request directly to the coprocessing unit when the load of the CPU is higher than the target threshold.
  • the above event distribution policy may be preset by the central processing unit at the factory, or may be configured by the user during use.
  • the interrupt forwarding policy may be embodied by an interrupt forwarding table.
  • the interrupt forwarding table may record a correspondence between the interrupt request type and the routing information, and the routing information is used to route the interrupt request to the target processing unit.
  • the CPU may query the interrupt forwarding table to determine routing information corresponding to the interrupt request, and may route the interrupt request to the target processing unit based on the determined routing information.
  • interrupt forwarding table can be stored in the memory of the computing device.
  • the coprocessing unit determines, according to the preset rule, that the coprocessing unit needs to supply power to the newly added memory module in the process of processing the system event.
  • Process flow 2 initialize the memory module.
  • the coprocessing unit writes the memory address of the memory module to a shadow register of the central processing unit.
  • the coprocessor processing unit notifies that the memory address of the central processing unit memory module has been written into the shadow register of the central processing unit.
  • the BIOS notifies the OS to use the memory module.
  • BIOS running in the central processing unit notifies the OS to use the memory module.
  • step 611 can only be processed by the central processing unit.
  • the method for processing interruption of the embodiment of the present application is described in detail above with reference to FIG. 1 to FIG. 6.
  • the apparatus for processing interrupt in the embodiment of the present application is described in detail below with reference to FIG. 7 to FIG. It should be noted that the apparatus shown in FIG. 7 to FIG. 12 can implement various steps in the method, and details are not described herein for brevity.
  • the receiving module 710 is configured to receive an interrupt request.
  • the processing module 720 is configured to acquire a system event corresponding to the interrupt request, where the system event includes processing information of the interrupt request.
  • the processing module 720 is configured to instruct the coprocessing unit to process the system event.
  • the processing module 720 is specifically configured to: acquire current load information of the CPU; and indicate, when the load of the CPU indicated by the current load information is higher than a target threshold.
  • the descriptive processing unit processes the system event.
  • the system event includes multiple sub-events
  • the processing module 720 is specifically configured to instruct the co-processing unit to process at least one of the plurality of sub-events.
  • the processing module 720 is further configured to: acquire current load information of the CPU; and when the load of the CPU indicated by the current load information is higher than a target threshold, The at least one sub-event is selected from the plurality of sub-events.
  • the processing module 720 is further configured to: enter an interrupt according to the interrupt request; when processing a sub-event other than the at least one sub-event in the plurality of sub-events, Exit the interrupt.
  • the receiving module 710 can be an input/output interface 810 in the central processing unit.
  • the processing module 720 can be a control component 820 in the central processing unit.
  • the central processing unit 800 further includes a register component 830. As shown in Figure 8.
  • FIG. 8 is a schematic block diagram of a central processing unit of an embodiment of the present application.
  • the central processing unit shown in FIG. 8 may include an input and output interface 810, a control unit 820, and a register unit 830.
  • the input/output interface 810, the control unit 820, and the register 830 are connected through an internal connection path, the control unit is configured to decode the instruction, and issue a control signal for each operation to be performed for each instruction, and the register component is used for saving The register operands and operation results temporarily stored during the execution of the instruction.
  • the input and output interfaces are used to receive input data and information, and output data operation results and other data.
  • the register component may include at least one of a register, a special register, and a control register.
  • the steps of the method may be completed by an integrated logic circuit of the hardware of the computing device or an instruction in the form of software.
  • the method disclosed in the embodiment of the present application may be directly implemented as a hardware central processing unit, or may be performed by a combination of hardware and software modules in a central processing unit.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium can be located in a memory in the computing device, and the central processing unit reads the information in the memory and, in conjunction with its hardware, performs the steps of the method. To avoid repetition, it will not be described in detail here.
  • the receiving module 930 can be an input/output interface 1010 in the coprocessing unit, and the processing module 920 and the obtaining module 930 can be a control component 1020 in the coprocessing unit, and the coprocessing unit 1000 further includes a register.
  • the component 1030 is specifically as shown in FIG.
  • the steps of the method may be completed by an integrated logic circuit of hardware in the computing device or an instruction in the form of software.
  • the method disclosed in the embodiment of the present application may be directly implemented as a hardware co-processing unit, or may be performed by a combination of hardware and software modules in the co-processing unit.
  • the software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like.
  • the storage medium is located in a memory of the computing device, and the coprocessing unit reads the information in the memory and completes the steps of the method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.
  • a generating module 1110 configured to generate an interrupt request
  • the processing module 1120 is configured to query the interrupt distribution policy to determine a target processing unit corresponding to the interrupt request, where the interrupt distribution policy includes: the first type of interrupt request is processed by the central processing unit CPU, and the second type of interrupt request is processed by the co-processing Unit processing
  • FIG. 12 is a schematic block diagram of an interrupt source of an embodiment of the present application.
  • the interrupt source 1200 shown in FIG. 12 may include a controller 1210 and an input/output interface 1220.
  • the controller 1210 and the input/output interface 1220 are connected through an internal connection path for controlling the input/output interface to receive input data and information, and outputting operation results and the like.
  • controller 1210 shown in FIG. 12 can be located inside the interrupt source, and can also be understood as a controller that controls the interrupt source, that is, two separate devices from the interrupt source.
  • the size of the sequence numbers of the processes does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not be taken to the embodiment of the present application.
  • the implementation process constitutes any limitation.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.).
  • the computer readable storage medium can be any available media that can be read by a computer or a data storage device such as a server, data center, or the like that includes one or more available media.

Landscapes

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

Abstract

Provided are a method and a device (700) for processing an interrupt. The method comprises: a central processing unit (CPU) (130) receiving an interrupt request (410); the CPU (130) obtaining a system event triggering the interrupt request (420); and the CPU (130) instructing a coprocessing unit (120) to process the system event (430). The method and the device (700) directly send interrupt requests sent by a part of interrupt sources (110) in a computing device (100) to the coprocessing unit (120), such that the coprocessing unit (120) processes a system event corresponding to the interrupt requests; compared to a solution in which the CPU (130) processes all interrupt requests in the computing device (100), the scenario is avoided in which the CPU (130) cannot run an application for a long time because the CPU (130) is processing a system event, improving overall performance of the computing device (100).

Description

处理中断的方法和装置Method and apparatus for handling interruptions 技术领域Technical field
本申请涉及计算机领域,并且更具体地,涉及处理中断的方法和装置。The present application relates to the field of computers and, more particularly, to methods and apparatus for handling interrupts.
背景技术Background technique
计算机、服务器或者其它具有计算能力的设备可以统称为计算设备,计算设备可以包括硬件系统和软件系统,其中硬件系统包括计算机的硬件设备,例如内存、电源等;软件系统包括操作系统(Operating System,OS)。A computer, a server, or other computing capable device may be collectively referred to as a computing device, and the computing device may include a hardware system and a software system, wherein the hardware system includes a hardware device of the computer, such as a memory, a power source, etc.; the software system includes an operating system (Operating System, OS).
当计算设备中有系统事件需要处理,例如,硬件系统中的硬件需要向软件系统发送该硬件的特定运行状态,或需要依靠软件系统运行特定的程序帮助该硬件进入正常工作状态时,硬件可以通过中断机制与软件系统进行交互。也就是说,硬件系统中的硬件设备可以向软件系统发送中断请求,请求软件系统中断当前运行的程序,运行中断处理程序,处理系统事件。When there are system events in the computing device that need to be processed, for example, the hardware in the hardware system needs to send the specific running state of the hardware to the software system, or the software system needs to run a specific program to help the hardware enter the normal working state, the hardware can pass The interrupt mechanism interacts with the software system. That is, the hardware device in the hardware system can send an interrupt request to the software system, request the software system to interrupt the currently running program, run the interrupt handler, and process the system event.
这种处理系统事件的方式,会占用中央处理单元的计算资源,使得中央处理单元在处理系统事件过程中,无法运行被中断的应用程序,降低了计算设备的整体性能。This way of handling system events occupies the computing resources of the central processing unit, so that the central processing unit cannot run the interrupted application during the processing of system events, reducing the overall performance of the computing device.
发明内容Summary of the invention
本申请提供一种处理中断的方法和装置,有利于提高计算设备的整体性能。The present application provides a method and apparatus for handling interrupts that are beneficial for improving the overall performance of a computing device.
第一方面,提供一种处理中断的方法,包括:中央处理单元(central processing unit,CPU)接收中断请求;所述CPU获取触发所述中断请求的系统事件;所述CPU指示协处理单元处理所述系统事件。In a first aspect, a method for processing an interrupt is provided, comprising: a central processing unit (CPU) receiving an interrupt request; the CPU acquiring a system event that triggers the interrupt request; and the CPU instructing a coprocessing unit to process System events.
具体地,该中断请求用于请求CPU中断当前运行的程序,进入中断处理流程。Specifically, the interrupt request is used to request the CPU to interrupt the currently running program and enter the interrupt processing flow.
该系统事件可以是由系统活动产生的,并包括系统数据的一类业务事件。系统事件可以包括资源状态变化,阈值超限,或者非正常的系统状态和行为。The system event can be a type of business event generated by system activity and including system data. System events can include resource state changes, threshold violations, or abnormal system states and behaviors.
在本申请实施例中,CPU将用于处理中断请求的系统事件发送至协处理单元,由协处理单元代替CPU处理中断请求对应的系统事件。相对于由CPU处理所有系统事件的方案而言,避免了CPU因处理系统事件而长时间不能运行被中断的应用程序,有利于提高计算设备的整体性能。In the embodiment of the present application, the CPU sends a system event for processing the interrupt request to the co-processing unit, and the co-processing unit replaces the CPU to process the system event corresponding to the interrupt request. Compared with the scheme of processing all system events by the CPU, the CPU is prevented from running the interrupted application for a long time due to processing system events, which is beneficial to improve the overall performance of the computing device.
结合第一方面,在一种可能的实现方式中,目标处理单元为该协处理单元时,在所述CPU指示协处理单元处理所述系统事件之前,所述方法还包括:中央处理单元可以根据预存的中断请求分发表,确定选择处理系统事件的所述目标处理单元,中断分发表记录多种类型的中断请求与多个处理单元的映射关系,所述多个处理单元包括所述中央处理单元和所述协处理单元。With reference to the first aspect, in a possible implementation, when the target processing unit is the co-processing unit, before the CPU instructs the co-processing unit to process the system event, the method further includes: the central processing unit may The pre-stored interrupt request is published, and the target processing unit that selects a processing system event is determined, and the interrupted sub-publishing records a mapping relationship between the plurality of types of interrupt requests and the plurality of processing units, wherein the plurality of processing units include the central processing unit And the co-processing unit.
该中断分发表可以记录中断请求类型与路由信息的对应关系,路由信息用于将中断请求路由至目标处理单元,中断源通过查该中断分发表,确定中断请求对应的路由信息之后, 可以根据确定后的路由信息对中断请求进行封装,使得中断请求可以基于该确定后的路由信息被路由至目标处理单元。The interrupt sub-publishing can record the correspondence between the interrupt request type and the routing information, and the routing information is used to route the interrupt request to the target processing unit. After the interrupt source is published by checking the interrupt, and determining the routing information corresponding to the interrupt request, the routing information can be determined according to the The subsequent routing information encapsulates the interrupt request such that the interrupt request can be routed to the target processing unit based on the determined routing information.
需要说明的是,该路由信息可以包括传输中断请求通过的端口的端口号,或者目标处理单元的路由地址等。It should be noted that the routing information may include a port number of a port through which the interrupt request is transmitted, or a routing address of the target processing unit.
在本申请实施例中,中央处理单元通过中断分发表,将不同类型的中断分配至不同的目标处理单元处理,即基于不同目标处理单元的处理能力,分配不同类型的中断,处理不同的系统事件,有利于提高目标处理单元处理系统事件的效率。In the embodiment of the present application, the central processing unit allocates different types of interrupts to different target processing unit processing by interrupting the sub-publishing, that is, assigning different types of interrupts according to the processing capabilities of different target processing units, and processing different system events. It is beneficial to improve the efficiency of the target processing unit processing system events.
可选地,中央处理单元可以指示不同的协处理单元处理不同类型的系统事件。Alternatively, the central processing unit may instruct different co-processing units to handle different types of system events.
结合第一方面,在一种可能的实现方式中,所述CPU获取所述CPU的当前负载信息;所述CPU在所述当前负载信息所指示的所述CPU的负载高于目标门限时,指示所述协处理单元处理所述系统事件。With reference to the first aspect, in a possible implementation manner, the CPU acquires current load information of the CPU, and the CPU indicates, when the load of the CPU indicated by the current load information is higher than a target threshold. The coprocessing unit processes the system event.
在本申请实施例中,在CPU的当前负载信息所指示的负载高于目标门限时,CPU指示协处理单元处理所述系统事件,避免了由协处理单元处理系统事件导致处理系统事件的效率下降,有利于兼顾计算设备的性能以及处理系统事件的效率。同时,协处理单元在CPU高负载运行时分担系统事件带来的额外负载。In the embodiment of the present application, when the load indicated by the current load information of the CPU is higher than the target threshold, the CPU instructs the coprocessing unit to process the system event, thereby avoiding the efficiency of processing the system event caused by the coprocessing unit processing the system event. It is beneficial to balance the performance of computing devices and the efficiency of handling system events. At the same time, the co-processing unit shares the extra load caused by system events when the CPU is running at high load.
结合第一方面,在一种可能的实现方式中,所述CPU在所述系统事件的类型为目标类型时,指示所述协处理单元处理所述系统事件,所述目标类型指示所述协处理单元处理具有所述目标类型的系统事件。With reference to the first aspect, in a possible implementation manner, when the type of the system event is a target type, the CPU instructs the co-processing unit to process the system event, and the target type indicates the co-processing The unit processes system events having the target type.
该目标类型指示所述协处理单元处理具有所述目标类型的系统事件。同时协处理单元具有处理目标类型的系统事件的能力。The target type instructs the co-processing unit to process a system event having the target type. At the same time, the co-processing unit has the ability to handle system events of the target type.
当系统事件不是目标类型的系统事件时,非目标类型的系统事件可以由CPU直接处理。When a system event is not a system event of the target type, a system event of a non-target type can be directly processed by the CPU.
一种可能设计,协处理单元不具有处理非目标类型的系统事件的能力。该协处理单元不具有处理非目标类型的系统事件的原因有很多种,例如,可以是计算设备中配置处理该系统事件的程序只能由CPU处理,或者协处理单元无法获取中断请求对应的系统事件的具体内容,无法运行中断处理程序,以处理该系统事件。本申请实施例对此不作具体限定。One possible design, the co-processing unit does not have the ability to handle system events of a non-target type. There are many reasons why the co-processing unit does not have a system event for processing a non-target type. For example, the program configured to process the system event in the computing device can only be processed by the CPU, or the co-processing unit cannot obtain the system corresponding to the interrupt request. The specific content of the event, the interrupt handler could not be run to handle the system event. This embodiment of the present application does not specifically limit this.
结合第一方面,在一种可能的实现方式中,所述系统事件包括多个子事件,所述CPU指示所述协处理单元处理所述系统事件,包括:所述CPU指示所述协处理单元处理所述多个子事件中的至少一个子事件。With reference to the first aspect, in a possible implementation manner, the system event includes multiple sub-events, and the CPU instructs the co-processing unit to process the system event, including: the CPU instructs the co-processing unit to process At least one of the plurality of sub-events.
具体地,所述CPU指示所述协处理单元处理所述多个子事件中的至少一个子事件,可以是指协处理单元处理多个子事件中全部的子事件(即协处理单元处理所述系统事件),或者可以是指协处理单元处理多个子事件中的部分子事件。Specifically, the CPU instructs the coprocessing unit to process at least one of the plurality of sub-events, which may be that the co-processing unit processes all sub-events of the plurality of sub-events (ie, the co-processing unit processes the system event) Or, it may be that the co-processing unit processes some of the sub-events of the plurality of sub-events.
在本申请实施例中,由协处理单元处理该至少一个子事件,由CPU处理该多个子事件中除至少一个子事件之外的子事件,即由协处理单元和CPU协同处理系统事件,有利于减小CPU处理系统事件的时间,提高计算设备的整体性能。In the embodiment of the present application, the at least one sub-event is processed by the co-processing unit, and the sub-event other than the at least one sub-event of the plurality of sub-events is processed by the CPU, that is, the co-processing unit and the CPU co-process the system event, It helps to reduce the time for the CPU to handle system events and improve the overall performance of the computing device.
可选地,该多个子事件中除至少一个子事件之外的子事件,即多个子事件中未指示给协处理单元的子事件,可以由中央处理单元进行处理。Optionally, the sub-event other than the at least one sub-event of the plurality of sub-events, that is, the sub-event that is not indicated to the co-processing unit among the plurality of sub-events, may be processed by the central processing unit.
结合第一方面,在一种可能的实现方式中,所述CPU获取所述CPU的当前负载信息;所述CPU在所述当前负载信息所指示的所述CPU的负载高于目标门限时,从系统事件包 括的多个子事件中选择至少一个子事件。所述CPU指示所述协处理单元处理选择出的子事件。With reference to the first aspect, in a possible implementation manner, the CPU acquires current load information of the CPU; when the CPU loads the CPU indicated by the current load information that is higher than a target threshold, the CPU At least one of the plurality of sub-events included in the system event is selected. The CPU instructs the coprocessing unit to process the selected sub-event.
在本申请实施例中,在CPU的当前负载信息所指示的负载高于目标门限时,CPU指示协处理单元处理所述系统事件中的部分子事件,避免了由协处理单元处理系统事件导致处理整个系统事件的效率下降,有利于兼顾计算设备的性能以及处理系统事件的效率。In the embodiment of the present application, when the load indicated by the current load information of the CPU is higher than the target threshold, the CPU instructs the co-processing unit to process a part of the sub-event in the system event, thereby avoiding processing by the co-processing unit to process the system event. The efficiency of the overall system event is degraded, which is beneficial to the performance of the computing device and the efficiency of handling system events.
结合第一方面,在一种可能的实现方式中,所述CPU从所述多个子事件中选择与目标类型匹配的子事件,所述与目标类型匹配的子事件为所述至少一个子事件,所述目标类型指示所述协处理单元处理具有所述目标类型的子事件。所述CPU指示所述协处理单元处理选择出的子事件。With reference to the first aspect, in a possible implementation manner, the CPU selects a sub-event that matches a target type from the plurality of sub-events, and the sub-event that matches the target type is the at least one sub-event, The target type instructs the co-processing unit to process a sub-event having the target type. The CPU instructs the coprocessing unit to process the selected sub-event.
需要说明的是,该目标类型指示协处理单元处理具有目标类型的子事件。同时,协处理单元具有处理目标类型的子事件的能力。It should be noted that the target type indicates that the coprocessing unit processes the sub-event having the target type. At the same time, the co-processing unit has the ability to process sub-events of the target type.
结合第一方面,在一种可能的实现方式中,所述方法还包括:所述CPU处理所述多个子事件中除所述至少一个子事件之外的子事件。In conjunction with the first aspect, in a possible implementation manner, the method further includes: the CPU processing a sub-event of the plurality of sub-events other than the at least one sub-event.
也就是说,该多个子事件中,非目标类型的子事件可以由CPU处理。或者说,多个子事件包括目标类型的子事件和非目标类型的子事件时,可以由CPU和协处理单元协同处理多个子事件。That is to say, among the plurality of sub-events, sub-events of the non-target type can be processed by the CPU. In other words, when multiple sub-events include sub-events of the target type and sub-events of the non-target type, multiple sub-events can be co-processed by the CPU and the co-processing unit.
结合第一方面,在一种可能的实现方式中,所述CPU根据所述中断请求进入中断;所述CPU在处理完所述多个子事件中除所述至少一个子事件之外的子事件时,退出所述中断。With reference to the first aspect, in a possible implementation, the CPU enters an interrupt according to the interrupt request; and the CPU processes a sub-event other than the at least one sub-event in the plurality of sub-events , exit the interrupt.
在本申请实施例中,当CPU处理完成多个子事件中除所述至少一个子事件之外的子事件时,可以退出中断,继续处理之前被中断的应用程序,相对于中央处理单元需要处理多个子事件中全部子事件的方案而言,有利于减少中央处理单元处理系统事件的时间。In the embodiment of the present application, when the CPU processes a sub-event other than the at least one sub-event among the plurality of sub-events, the interrupt may be exited, and the previously interrupted application is processed, which requires more processing than the central processing unit. For the scenario of all sub-events in a sub-event, it is beneficial to reduce the time that the central processing unit handles system events.
结合第一方面,在一种可能的实现方式中,CPU直接将该中断请求转发至协处理单元时,该CPU可以不用获取触发所述中断请求的系统事件。In combination with the first aspect, in a possible implementation manner, when the CPU directly forwards the interrupt request to the coprocessing unit, the CPU may not acquire the system event that triggers the interrupt request.
可选地,在所述CPU指示协处理单元处理所述系统事件之前,所述方法还包括:所述CPU查询中断转发表,所述中断转发表记录多种类型的中断请求与多个协处理单元的映射关系;所述CPU确定与所述中断请求对应的所述协处理单元。Optionally, before the CPU instructs the coprocessing unit to process the system event, the method further includes: the CPU querying an interrupt forwarding table, where the interrupt forwarding table records multiple types of interrupt requests and multiple coprocessing a mapping relationship of cells; the CPU determines the coprocessing unit corresponding to the interrupt request.
在本申请实施例中,CPU通过中断转发表,将该不同类型的中断请求分配至不同的目标处理单元处理,即基于不同目标处理单元的处理能力,分配不同类型的系统事件,有利于提高目标处理单元处理系统事件的效率。In the embodiment of the present application, the CPU allocates different types of interrupt requests to different target processing unit processing by interrupting the forwarding table, that is, assigning different types of system events based on processing capabilities of different target processing units, which is beneficial to improve the target. The processing unit handles the efficiency of system events.
第二方面,提供一种处理中断的方法,包括:协处理单元获取CPU指示所述协处理单元处理的系统事件,所述CPU指示的系统事件为所述CPU在接收到中断请求时,获取的触发所述中断请求的系统事件;所述协处理单元处理获取的系统事件。A second aspect provides a method for processing an interrupt, comprising: acquiring, by a coprocessing unit, a system event that is instructed by the coprocessing unit, the system event indicated by the CPU being acquired by the CPU when receiving an interrupt request A system event that triggers the interrupt request; the co-processing unit processes the acquired system event.
由协处理单元代替CPU处理中断请求对应的系统事件。相对于由CPU处理所有系统事件的方案而言,避免了CPU因处理系统事件而长时间不能运行被中断的应用程序,有利于提高计算设备的整体性能。The system event corresponding to the interrupt request is processed by the coprocessor unit instead of the CPU. Compared with the scheme of processing all system events by the CPU, the CPU is prevented from running the interrupted application for a long time due to processing system events, which is beneficial to improve the overall performance of the computing device.
结合第二方面,在一种可能的实现方式中,所述方法还包括:所述协处理单元接收中断源发送的中断请求;所述协处理单元获取触发所述中断请求的系统事件。With reference to the second aspect, in a possible implementation manner, the method further includes: the coprocessing unit receives an interrupt request sent by an interrupt source; and the coprocessing unit acquires a system event that triggers the interrupt request.
需要说明的是,可以在中断源和协处理单元之间建立传输中断请求的通信机制,使得 中断源可以直接将中断请求发送至协处理单元。It should be noted that a communication mechanism for transmitting an interrupt request can be established between the interrupt source and the coprocessing unit, so that the interrupt source can directly send the interrupt request to the coprocessing unit.
结合第二方面,在一种可能的实现方式中,所述方法还包括:所述协处理单元接收CPU转发的中断请求,所述中断请求为中断源发送至所述CPU;所述协处理单元获取触发所述中断请求的系统事件。With reference to the second aspect, in a possible implementation manner, the method further includes: the coprocessing unit receives an interrupt request forwarded by a CPU, where the interrupt request is sent to the CPU as an interrupt source; Get the system event that triggered the interrupt request.
在本申请实施例中,可以不用改进中断源与协处理单元之间的硬件连接,通过CPU向协处理单元转发中断请求的方式,使得协处理单元处理触发该中断请求的系统事件。In the embodiment of the present application, the hardware connection between the interrupt source and the co-processing unit may be improved, and the interrupt request may be forwarded by the CPU to the co-processing unit, so that the co-processing unit processes the system event that triggers the interrupt request.
结合第二方面,在一种可能的实现方式中,所述方法还包括:所述协处理单元根据所述中断请求进入中断;所述协处理单元在处理完所述系统事件时,退出所述中断。With reference to the second aspect, in a possible implementation manner, the method further includes: the coprocessing unit enters an interrupt according to the interrupt request; and the coprocessing unit exits the system event when the system event is processed Interrupted.
第三方面,提供一种处理中断的方法,包括:中断源生成中断请求;所述中断源查询中断分发策略确定所述中断请求对应的目标处理单元,所述中断分发策略包括:第一类型的中断请求由中央处理单元CPU处理,第二类型的中断请求由协处理单元处理;所述中断源向所述中断请求对应的目标处理单元发送所述中断请求。A third aspect provides a method for processing an interrupt, including: an interrupt source generating an interrupt request; the interrupt source query interrupt distribution policy determining a target processing unit corresponding to the interrupt request, where the interrupt distribution policy includes: a first type of The interrupt request is processed by the central processing unit CPU, and the second type of interrupt request is processed by the co-processing unit; the interrupt source sends the interrupt request to the target processing unit corresponding to the interrupt request.
该目标处理单元包括所述协处理单元或所述中央处理单元。The target processing unit includes the co-processing unit or the central processing unit.
该中断请求对应的目标处理单元,可以理解为目标处理单元接收该中断请求,进一步地,可以由目标处理单元处理触发该中断请求的系统事件。The target processing unit corresponding to the interrupt request may be understood to be that the target processing unit receives the interrupt request, and further, the system event that triggers the interrupt request may be processed by the target processing unit.
在本申请实施例中,对于同一中断源而言,通过中断分发策略,将该中断源的不同类型的中断请求分配至不同的目标处理单元处理,即基于不同目标处理单元的处理能力,分配不同类型的中断,有利于提高目标处理单元处理系统事件的效率。In the embodiment of the present application, for the same interrupt source, by interrupting the distribution policy, different types of interrupt requests of the interrupt source are allocated to different target processing unit processes, that is, different allocations are based on processing capabilities of different target processing units. Types of interrupts help to improve the efficiency of the target processing unit in handling system events.
结合第三方面,在一种可能的实现方式中,所述中断分发策略包括中断分发表,所述中断分发表记录多种类型的中断请求与多个处理单元的映射关系,所述多个处理单元包括CPU和协处理单元。With reference to the third aspect, in a possible implementation manner, the interrupt distribution policy includes interrupting a sub-publishing, and the interrupt sub-publishing records a mapping relationship between multiple types of interrupt requests and a plurality of processing units, the multiple processing The unit includes a CPU and a coprocessing unit.
结合第三方面,在一种可能的实现方式中,该中断分发表可以记录中断请求类型与路由信息的对应关系,路由信息用于将中断请求路由至目标处理单元,中断源在查询该中断分发表,确定中断请求对应的路由信息之后,可以根据确定后的路由信息对中断请求进行封装,使得中断请求可以基于该确定后的路由信息被路由至目标处理单元。In combination with the third aspect, in a possible implementation manner, the interrupt sub-publishing may record a correspondence between an interrupt request type and routing information, the routing information is used to route the interrupt request to the target processing unit, and the interrupt source queries the interrupt. After the routing information corresponding to the interrupt request is determined, the interrupt request may be encapsulated according to the determined routing information, so that the interrupt request may be routed to the target processing unit based on the determined routing information.
需要说明的是,该路由信息可以包括传输中断请求需要通过的端口的端口号,或者目标处理单元的路由地址等。It should be noted that the routing information may include a port number of a port through which the interrupt request is transmitted, or a routing address of the target processing unit.
在本申请实施例中,对于同一中断源而言,通过中断分发表,将该中断源的不同类型的中断分配至不同的目标处理单元处理,即基于不同目标处理单元的处理能力,分配不同类型的中断,有利于提高目标处理单元处理系统事件的效率。In the embodiment of the present application, for the same interrupt source, different types of interrupts of the interrupt source are allocated to different target processing unit processing by interrupting the sub-publishing, that is, different types are allocated based on the processing capabilities of different target processing units. The interruption helps to improve the efficiency of the target processing unit handling system events.
结合第三方面,在一种可能的实现方式中,所述第二类型的中断请求为故障类型的中断请求。In conjunction with the third aspect, in a possible implementation, the second type of interrupt request is a fault type interrupt request.
第四方面,提供一种计算设备处理中断的方法,该计算设备包括CPU、协处理单元和中断源,其中,CPU、协处理单元和中断源相互配合执行上述各方面中的方法。In a fourth aspect, a method for processing an interrupt by a computing device is provided, the computing device comprising a CPU, a co-processing unit, and an interrupt source, wherein the CPU, the co-processing unit, and the interrupt source cooperate with each other to perform the methods in the above aspects.
第五方面,提供了一种处理中断的装置,所述装置包括用于执行上述各方法中的各个模块。In a fifth aspect, an apparatus for processing an interrupt is provided, the apparatus comprising means for performing each of the various methods described above.
第六方面,提供一种计算设备,所述计算设备包括实现上述方法的CPU。该CPU具有的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件实现一个或多个与上述功能相对应的单元。In a sixth aspect, a computing device is provided, the computing device comprising a CPU implementing the above method. The functions of the CPU can be implemented by hardware or by executing corresponding software through hardware. The hardware or software implements one or more units corresponding to the functions described above.
所述计算设备还可以包括实现上述方法的协处理单元。协处理单元具有的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件实现一个或多个与上述功能相对应的单元。The computing device can also include a co-processing unit that implements the above method. The functions of the co-processing unit can be implemented by hardware or by corresponding software implementation by hardware. The hardware or software implements one or more units corresponding to the functions described above.
第七方面,提供一种计算设备,所述计算设备具有实现上述方法的中断源。中断源的功能可以通过硬件实现,也可以通过硬件执行相应的软件实现。所述硬件或软件实现一个或多个与上述功能相对应的单元。In a seventh aspect, a computing device is provided, the computing device having an interrupt source implementing the above method. The function of the interrupt source can be implemented by hardware or by executing the corresponding software through hardware. The hardware or software implements one or more units corresponding to the functions described above.
第八方面,提供了一种CPU,CPU包括输入/输出接口、控制部件和寄存器。控制部件用于对指令译码,并且发出为完成每条指令所要执行的各个操作的控制信号,寄存器用于保存指令执行过程中临时存放的寄存器操作数和操作结果,输入输出接口用于接收输入的数据和信息,输出数据操作结果等数据。In an eighth aspect, a CPU is provided, the CPU including an input/output interface, a control unit, and a register. The control component is configured to decode the instruction and issue a control signal for each operation to be performed for each instruction, the register is used to store the register operand and the operation result temporarily stored during the execution of the instruction, and the input and output interface is used for receiving the input. Data and information, output data operation results and other data.
第九方面,提供了一种协处理单元,协处理单元包括输入/输出接口、处理单元和寄存器。控制部件用于对指令译码,并且发出为完成每条指令所要执行的各个操作的控制信号,寄存器用于保存指令执行过程中临时存放的寄存器操作数和操作结果,输入输出接口用于接收输入的数据和信息,输出数据操作结果等数据。In a ninth aspect, a coprocessing unit is provided, the coprocessing unit including an input/output interface, a processing unit, and a register. The control component is configured to decode the instruction and issue a control signal for each operation to be performed for each instruction, the register is used to store the register operand and the operation result temporarily stored during the execution of the instruction, and the input and output interface is used for receiving the input. Data and information, output data operation results and other data.
第十方面,提供了一种中断源,中断源包括控制器、输入/输出接口和存储器。该控制器用于控制输入/输出接口接收输入的数据和信息,输出操作结果等数据。该存储器用于存储程序代码,该控制器用于从存储器中调用并运行该程序代码,使得该中断源执行上述方法中中断源的操作。In a tenth aspect, an interrupt source is provided, the interrupt source comprising a controller, an input/output interface, and a memory. The controller is used to control the input/output interface to receive input data and information, and output data such as operation results. The memory is for storing program code, the controller is for calling and running the program code from the memory such that the interrupt source performs the operation of the interrupt source in the above method.
第十一方面,提供了一种计算设备,包括CPU、协处理单元和中断源,其中,CPU用于执行上述方法中CPU的操作,协处理单元用于执行上述方法中协处理单元的操作,中断源用于执行上述方法中中断源的操作。In an eleventh aspect, a computing device is provided, including a CPU, a coprocessing unit, and an interrupt source, wherein the CPU is configured to perform operations of the CPU in the foregoing method, and the coprocessing unit is configured to perform operations of the coprocessing unit in the foregoing method, The interrupt source is used to perform the operation of the interrupt source in the above method.
第十二方面,提供了一种计算机程序产品,所述计算机程序产品包括程序代码。当所述程序代码在计算设备上运行时,使得计算设备执行上述各方面中的方法。In a twelfth aspect, a computer program product is provided, the computer program product comprising program code. When the program code is run on a computing device, the computing device is caused to perform the methods of the various aspects described above.
第十三方面,提供了一种计算机可读介质,所述计算机可读介质存储有程序代码。当所述程序代码在计算设备上运行时,使得计算设备执行上述各方面中的方法。In a thirteenth aspect, a computer readable medium is provided, the computer readable medium storing program code. When the program code is run on a computing device, the computing device is caused to perform the methods of the various aspects described above.
第十四方面,提供了一种芯片系统,该芯片系统设置在CPU中,用于CPU实现上述方面中所涉及的功能,例如,生成、接收、发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存芯片系统必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In a fourteenth aspect, a chip system is provided, the chip system being disposed in a CPU for implementing functions involved in the above aspects, for example, generating, receiving, transmitting, or processing data involved in the above method and/or Or information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the chip system. The chip system can be composed of chips, and can also include chips and other discrete devices.
第十五方面,提供了一种芯片系统,该芯片系统设置在协处理单元中,用于支持协处理单元实现上述方面中所涉及的功能,例如,生成、接收、发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存芯片系统必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In a fifteenth aspect, a chip system is provided, the chip system being disposed in a coprocessing unit for supporting a coprocessing unit to implement functions involved in the above aspects, for example, generating, receiving, transmitting, or processing the above method Data and/or information involved. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the chip system. The chip system can be composed of chips, and can also include chips and other discrete devices.
第十六方面,提供了一种芯片系统,该芯片系统设置在中断源中,用于支持中断源实现上述方面中所涉及的功能,例如,生成、接收、发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器用于保存芯片系统必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In a sixteenth aspect, a chip system is provided, the chip system being disposed in an interrupt source for supporting an interrupt source to implement the functions involved in the above aspects, for example, generating, receiving, transmitting or processing the method involved in the above method Data and / or information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the chip system. The chip system can be composed of chips, and can also include chips and other discrete devices.
附图说明DRAWINGS
图1是本申请实施例适用的计算设备的示意性框图。FIG. 1 is a schematic block diagram of a computing device to which an embodiment of the present application is applied.
图2是处理系统事件的传统方法的示意性流程图。2 is a schematic flow diagram of a conventional method of handling system events.
图3是本申请实施例的处理中断的方法的示意性流程图。FIG. 3 is a schematic flowchart of a method for processing an interrupt according to an embodiment of the present application.
图4是本申请另一实施例的处理中断的方法的示意性流程图。FIG. 4 is a schematic flowchart of a method for processing an interrupt according to another embodiment of the present application.
图5是本申请另一实施例的处理中断的方法的示意性流程图。FIG. 5 is a schematic flowchart of a method for processing an interrupt according to another embodiment of the present application.
图6是本申请另一实施例的处理中断的方法的示意性流程图。FIG. 6 is a schematic flowchart of a method for processing an interrupt according to another embodiment of the present application.
图7是本申请实施例的处理中断的装置的示意性框图。FIG. 7 is a schematic block diagram of an apparatus for processing an interrupt according to an embodiment of the present application.
图8是本申请实施例的中央处理单元的示意性框图。FIG. 8 is a schematic block diagram of a central processing unit of an embodiment of the present application.
图9是本申请实施例的处理中断的装置的示意性框图。FIG. 9 is a schematic block diagram of an apparatus for processing an interrupt according to an embodiment of the present application.
图10是本申请实施例的协处理单元的示意性框图。FIG. 10 is a schematic block diagram of a co-processing unit of an embodiment of the present application.
图11是本申请实施例的处理中断的装置的示意性框图。FIG. 11 is a schematic block diagram of an apparatus for processing an interrupt according to an embodiment of the present application.
图12是本申请实施例的中断源的示意性框图。FIG. 12 is a schematic block diagram of an interrupt source of an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图,对本申请中的技术方案进行描述。The technical solutions in the present application will be described below with reference to the accompanying drawings.
图1是本申请实施例适用的计算设备的示意性框图。图1所示的计算设备100包括中央处理单元(central processing unit,CPU)110、协处理单元120、中断源130和存储器140。中央处理单元110、协处理单元120、中断源130和存储器140之间内部连接,例如可以通过总线连接。FIG. 1 is a schematic block diagram of a computing device to which an embodiment of the present application is applied. The computing device 100 shown in FIG. 1 includes a central processing unit (CPU) 110, a co-processing unit 120, an interrupt source 130, and a memory 140. The internal connection between the central processing unit 110, the coprocessing unit 120, the interrupt source 130, and the memory 140 can be connected, for example, via a bus.
应理解,该计算设备100可以是提供计算服务的设备,例如服务器。该计算设备100还可以是用于高速计算的电子计算机器,例如,计算机。本申请实施例对于计算设备的具体形式不做限定。It should be understood that the computing device 100 can be a device that provides computing services, such as a server. The computing device 100 can also be an electronic computer for high speed computing, such as a computer. The specific embodiments of the computing device are not limited in this embodiment.
还应理解,图1所示的计算设备100中仅仅列出了与本申请实施例相关的部件,图1所示的计算设备100还可以包括其他部件,例如网卡,硬盘等,本申请实施例对此不作具体限定。It should be understood that the computing device 100 shown in FIG. 1 only lists the components related to the embodiment of the present application. The computing device 100 shown in FIG. 1 may further include other components, such as a network card, a hard disk, etc. This is not specifically limited.
中央处理单元110,运行计算设备100的操作系统,以及在该操作系统中运行程序,例如应用程序。The central processing unit 110 runs an operating system of the computing device 100 and runs programs, such as applications, in the operating system.
具体地,中央处理单元110可以是一块大规模的集成电路,作为计算设备100的运算核心和控制核心。In particular, central processing unit 110 can be a large scale integrated circuit that acts as the computing core and control core of computing device 100.
需要说明的是,该中央处理单元110可以是一个芯片,还可以是一个芯片系统。若该中央处理单元110为一个芯片系统时,该芯片系统可以包括多个芯片。It should be noted that the central processing unit 110 can be a chip or a chip system. If the central processing unit 110 is a chip system, the chip system may include a plurality of chips.
协处理单元120,可以运行计算设备100中的部分程序。The co-processing unit 120 can run a portion of the programs in the computing device 100.
可选地,协处理单元120可以是完成中央处理单元110无法执行或执行效率低下的操作任务的协处理单元(co-processor);例如,该协处理单元可以是图形处理单元(Graphics Processing Unit,GPU)或网络处理单元(Neural-network Processing Unit,NPU)等。Optionally, the co-processing unit 120 may be a co-processor that completes the inefficient operation task of the central processing unit 110; for example, the co-processing unit may be a graphics processing unit (Graphics Processing Unit, GPU) or Neural-network Processing Unit (NPU).
可选地,协处理单元120可以是计算设备100中的带外处理单元,例如,计算设备中的服务处理单元(service processor,SP)、片上系统(System on a Chip,Soc)中的处理 单元等。Optionally, the coprocessing unit 120 may be an out-of-band processing unit in the computing device 100, for example, a processing unit in a service processor (SP), a system on a chip (Soc) in a computing device. Wait.
该协处理单元120可以通过芯片实现。例如,协处理单元120可以是一个芯片,或者可以是一个芯片系统。若该协处理单元120为一个芯片系统时,该芯片系统可以包括多个芯片。The coprocessing unit 120 can be implemented by a chip. For example, co-processing unit 120 can be a chip or can be a chip system. If the coprocessing unit 120 is a chip system, the chip system may include a plurality of chips.
中断源130,在计算设备100中能够发起中断请求。中断源130可以是计算设备100中的硬件设备,例如,I/O设备、数据通道、实时时钟或者用户故障源等。The interrupt source 130 is capable of initiating an interrupt request in the computing device 100. The interrupt source 130 can be a hardware device in the computing device 100, such as an I/O device, a data channel, a real time clock, or a source of user faults, and the like.
可选地,该中断请求的具体体现形式可以是中断信号,或者中断信息等等。Optionally, the specific embodiment of the interrupt request may be an interrupt signal, or interrupt information, and the like.
存储器140,向中央处理单元和/或协处理单元提供指令和数据。存储器140可以包括只读存储器或随机存取存储器。The memory 140 provides instructions and data to a central processing unit and/or a co-processing unit. The memory 140 may include a read only memory or a random access memory.
下文基于图1所示的计算设备100的架构图,结合图2说明计算设备100处理系统事件的传统方法。图2是处理系统事件的传统方法的示意性流程图。图2所示的方法包括步骤210至步骤220。The conventional method of computing device 100 processing system events is described below in conjunction with FIG. 2 based on the architectural diagram of computing device 100 shown in FIG. 2 is a schematic flow diagram of a conventional method of handling system events. The method shown in FIG. 2 includes steps 210 to 220.
210,计算设备的中断源向中央处理单元发送中断请求。210. The interrupt source of the computing device sends an interrupt request to the central processing unit.
该中断请求用于请求中央处理单元中断当前运行的应用程序,进入中断处理流程。The interrupt request is used to request the central processing unit to interrupt the currently running application and enter the interrupt processing flow.
220,中央处理单元中断当前运行的程序,对系统事件进行处理。220. The central processing unit interrupts the currently running program and processes the system event.
具体地,中央处理单元在进入中断处理流程后,确定触发该中断请求的系统事件,并对该系统事件进行处理。Specifically, after entering the interrupt processing flow, the central processing unit determines a system event that triggers the interrupt request, and processes the system event.
该系统事件可以是由系统活动产生的,并包括系统数据的一类业务事件。系统事件可以包括资源状态变化,阈值超限,或者非正常的系统状态和行为。例如,该系统事件可以指中断源需要向计算设备中软件系统发送中断源的当前状态,或者中断源需要通过计算设备中的软件系统运行特定的程序使得中断源进入工作状态。The system event can be a type of business event generated by system activity and including system data. System events can include resource state changes, threshold violations, or abnormal system states and behaviors. For example, the system event may refer to the current state of the interrupt source that needs to be sent to the software system in the computing device, or the interrupt source needs to run a particular program through the software system in the computing device to cause the interrupt source to enter a working state.
图2所示方法中,计算设备中的所有中断源都是向中央处理单元发送中断请求,使得中央处理单元进入中断处理流程,处理中断请求对应的系统事件。处理中断请求的方式会占用中央处理单元的计算资源,使得中央处理单元在处理系统事件期间,无法运行被中断的应用程序或者OS,导致应用程序或者OS长时间无法提供服务,从而降低了计算设备的整体性能。In the method shown in FIG. 2, all interrupt sources in the computing device send an interrupt request to the central processing unit, so that the central processing unit enters the interrupt processing flow and processes the system event corresponding to the interrupt request. The way in which the interrupt request is processed occupies the computing resources of the central processing unit, so that the central processing unit cannot run the interrupted application or OS during the processing of the system event, causing the application or the OS to be unable to provide services for a long time, thereby reducing the computing device. Overall performance.
例如,当系统事件为通过软件系统为硬件系统进行动态配置时,CPU处理系统事件时所需的时间较长。CPU会在一段较长的时间内无法运行被中断的应用程序,降低了计算设备的整体性能。For example, when a system event is dynamically configured for a hardware system through a software system, the CPU takes longer to process system events. The CPU will not be able to run the interrupted application for a long period of time, reducing the overall performance of the computing device.
又例如,系统事件指示为计算设备中的硬件进行配置,该系统事件触发的中断通常为系统管理中断(system management interrupt,SMI)。该系统事件是由基本输入输出系统(basic input/output system,BIOS)处理的系统事件,在BIOS处理系统事件的过程中,BIOS会抢夺OS对CPU的控制权。当BIOS占用CPU的时间较长时,OS由于长时间不能控制CPU,会造成业务中断或软件系统卡死。为了避免计算设备的业务中断或软件系统卡死,只能采用BIOS和OS之间交替控制CPU的方式,在一段时间内BIOS接管CPU处理系统事件,在另一段时间内OS接管CPU运行应用程序。这种BIOS和OS交替控制CPU的方式,使得计算设备需要不停切换BIOS和OS对CPU的控制权,也降低了计算设备的整体性能。As another example, a system event indication is configured for hardware in a computing device, and the interrupt triggered by the system event is typically a system management interrupt (SMI). The system event is a system event processed by a basic input/output system (BIOS). During the process of processing the system event by the BIOS, the BIOS will grab the control of the OS on the CPU. When the BIOS takes a long time for the CPU, the OS cannot be controlled for a long time, which may cause service interruption or software system jam. In order to avoid the business interruption of the computing device or the software system is stuck, only the way of alternately controlling the CPU between the BIOS and the OS can be adopted. In a period of time, the BIOS takes over the CPU to handle system events, and in another period, the OS takes over the CPU to run the application. This way in which the BIOS and the OS alternately control the CPU, the computing device needs to constantly switch between the BIOS and the OS to control the CPU, and also reduces the overall performance of the computing device.
本申请提供一种处理中断的方法,该方法通过将计算设备中的全部或部分系统事件分 配给协处理单元处理,避免了传统的中断处理方法中中央处理单元由于处理全部系统事件而长时间不能运行应用程序,有利于提高计算设备的整体性能。The present application provides a method for processing an interrupt, which is implemented by allocating all or part of system events in a computing device to a coprocessing unit, thereby avoiding that the central processing unit cannot handle the entire system event for a long time in the conventional interrupt processing method. Running the application helps to improve the overall performance of the computing device.
下文结合图3至图5举例说明本申请实施例的处理中断的方法。The method for processing interrupts of the embodiment of the present application is exemplified below with reference to FIG. 3 to FIG. 5.
图3是本申请实施例的处理中断的方法的示意性流程图。应理解,图3所示的方法中的计算设备包括协处理单元和中央处理单元,具体的结构请参见图1。图3所示的方法包括步骤310至步骤330。FIG. 3 is a schematic flowchart of a method for processing an interrupt according to an embodiment of the present application. It should be understood that the computing device in the method shown in FIG. 3 includes a co-processing unit and a central processing unit. See FIG. 1 for a specific structure. The method shown in FIG. 3 includes steps 310 through 330.
310,计算设备中的协处理单元接收中断源发送的中断请求。310. The coprocessing unit in the computing device receives the interrupt request sent by the interrupt source.
具体地,该中断请求用于请求协处理单元中断当前运行的程序,进入中断处理过程。Specifically, the interrupt request is used to request the coprocessing unit to interrupt the currently running program and enter the interrupt processing process.
需要说明的是,该中断请求可以是以中断信号或中断信息的方式进行传输。It should be noted that the interrupt request may be transmitted in the form of an interrupt signal or an interrupt message.
一种可选实现方式,该中断请求以中断信号的方式进行传输。具体地,中断源与协处理单元单元之间电性连接,中断源通过该电性连接可以向协处理单元传输中断信号,从而该中断信号可以通过协处理单元的引脚发送至协处理单元。例如,在X86架构中,协处理单元为英特尔管理引擎(Intel management engine,Intel ME)或者基板管理控制器(baseboard management controller,BMC)中的SP时,该中断请求可以直接通过ME的引脚或者SP的引脚发送至ME或者SP。An optional implementation, the interrupt request is transmitted in the form of an interrupt signal. Specifically, the interrupt source and the co-processing unit are electrically connected, and the interrupt source can transmit an interrupt signal to the co-processing unit through the electrical connection, so that the interrupt signal can be sent to the co-processing unit through the pin of the co-processing unit. For example, in the X86 architecture, when the coprocessing unit is an SP in an Intel management engine (Intel ME) or a baseboard management controller (BMC), the interrupt request can be directly passed through the ME pin or The SP pin is sent to the ME or SP.
一种可选实现方式,该中断请求以中断信息的方式进行传输。中断源可以将中断请求的路由信息中的目标节点配置为协处理单元,中断源可以以中断信息的方式向协处理单元传输发送该中断请求。An optional implementation, the interrupt request is transmitted in the form of interrupt information. The interrupt source may configure the target node in the routing information of the interrupt request as a co-processing unit, and the interrupt source may transmit the interrupt request to the co-processing unit in the manner of interrupt information.
320,协处理单元获取触发所述中断请求的系统事件。320. The coprocessing unit acquires a system event that triggers the interrupt request.
具体地,协处理单元进入中断处理流程后,可以获取中断请求对应的系统事件。例如,协处理单元可以通过中断请求中携带的中断号,确定发送该中断请求的中断源,并查询中断源的寄存器中记录的日志,从该日志获取中断源的运行状态,以从该运行状态中获取需要处理的系统事件。Specifically, after the coprocessing unit enters the interrupt processing flow, the system event corresponding to the interrupt request may be obtained. For example, the coprocessing unit can determine the interrupt source that sends the interrupt request by using the interrupt number carried in the interrupt request, and query the log recorded in the register of the interrupt source, and obtain the running state of the interrupt source from the log to obtain the running state. Get the system events that need to be processed.
该系统事件可以是由系统活动产生的,并包括系统数据的一类业务事件。系统事件可以包括资源状态变化,阈值超限,或者非正常的系统状态和行为。可选地,该系统事件可以指中断源需要向计算设备中软件系统发送中断源的当前状态,或者中断源需要通过计算设备中的软件系统运行特定的程序使得中断源进入工作状态。The system event can be a type of business event generated by system activity and including system data. System events can include resource state changes, threshold violations, or abnormal system states and behaviors. Optionally, the system event may refer to an interrupt source that needs to send a current state of the interrupt source to the software system in the computing device, or the interrupt source needs to run a specific program through the software system in the computing device to cause the interrupt source to enter a working state.
330,所述协处理单元处理所述系统事件。330. The coprocessing unit processes the system event.
具体地,协处理单元可以运行处理系统事件所需的程序,以对系统事件进行处理。例如,中断源为网卡,系统事件为将网卡故障记录至网卡的日志中,则可以由协处理单元将网卡故障记录至网卡的日志中。In particular, the co-processing unit can run the programs required to process system events to process system events. For example, if the interrupt source is a network card, and the system event is to log the network card fault to the log of the network card, the coprocessor can record the network card fault to the log of the network card.
可选地,不同的协处理单元可以处理不同类型的系统事件。具体地,协处理单元为BMC时,可以处理记录中断源的运行状态的系统事件,例如,由BMC将该网卡故障的事件记录至网卡的日志中。Alternatively, different co-processing units can handle different types of system events. Specifically, when the coprocessing unit is a BMC, a system event that records the running status of the interrupt source may be processed. For example, the event that the NIC is faulty is recorded by the BMC to the log of the network card.
在本申请实施例中,计算设备中的中断源,可以将中断请求直接发送至协处理单元,请求协处理单元处理中断请求对应的系统事件,相对于由中央处理单元处理计算设备中全部的系统事件的传统方案而言,避免了中央处理单元因处理系统事件而在一段较长的时间内不能运行应用程序或者OS,中央处理单元可以在协处理单元处理系统事件的器件继续运行应用程序或OS,提高了计算设备的整体性能。In the embodiment of the present application, the interrupt source in the computing device may directly send the interrupt request to the co-processing unit, request the co-processing unit to process the system event corresponding to the interrupt request, and process all the systems in the computing device with respect to the central processing unit. In the traditional solution of the event, the central processing unit is prevented from running the application or the OS for a long period of time due to processing of the system event, and the central processing unit can continue to run the application or the OS in the device processing the system event in the coprocessing unit. , improving the overall performance of computing devices.
可选地,作为一个实施例,所述方法还包括:所述协处理单元根据所述中断请求进入中断;所述协处理单元在处理完所述系统事件时,退出所述中断。Optionally, as an embodiment, the method further includes: the coprocessing unit enters an interrupt according to the interrupt request; and the coprocessing unit exits the interrupt when the system event is processed.
该协处理单元在处理完所述系统事件时,退出中断,继续运行之前被中断的程序。即,在协处理单元代替中央处理单元分担处理系统事件后,可以继续运行协处理单元先前中断的程序。The coprocessing unit exits the interrupt when the system event is processed, and continues to run the previously interrupted program. That is, after the coprocessing unit replaces the central processing unit to share the processing system event, the program previously interrupted by the coprocessing unit can be continued to run.
可选地,作为一个实施例,所述方法还包括:所述中断源生成中断请求;所述中断源查询中断分发策略确定所述中断请求对应的目标处理单元,所述中断分发策略包括:第一类型的中断请求由CPU处理,第二类型的中断请求由协处理单元处理;所述中断请求为所述第二类型的中断请求时,执行步骤310。Optionally, as an embodiment, the method further includes: the interrupt source generates an interrupt request; the interrupt source query interrupt distribution policy determines a target processing unit corresponding to the interrupt request, where the interrupt distribution policy includes: A type of interrupt request is processed by the CPU, and a second type of interrupt request is processed by the co-processing unit; when the interrupt request is the second type of interrupt request, step 310 is performed.
需要说明的是,该中断请求为所述第二类型的中断请求时,第二类型的中断请求由协处理单元处理,同时协处理单元具有处理第二类型的中断请求的能力。可选地,CPU也可以具有处理第二类型的中断请求的能力。It should be noted that when the interrupt request is the second type of interrupt request, the second type of interrupt request is processed by the co-processing unit, and the co-processing unit has the capability of processing the second type of interrupt request. Alternatively, the CPU may also have the ability to process a second type of interrupt request.
该第一类型的中断请求由中央处理单元CPU处理,同时CPU具有处理第一类型的中断请求的能力。可选地,协处理单元可能不具有处理第一类型的中断请求的能力。例如,协处理单元无法获取触发该第一类型的中断请求的系统事件,因此,无法处理该系统事件。The first type of interrupt request is processed by the central processing unit CPU while the CPU has the ability to process the first type of interrupt request. Alternatively, the co-processing unit may not have the ability to process the first type of interrupt request. For example, the co-processing unit cannot acquire a system event that triggers the first type of interrupt request, and therefore, the system event cannot be processed.
在本申请实施例中,对于同一中断源而言,通过中断分发策略,将该中断源的不同类型的中断请求分配至不同的目标处理单元处理。例如,基于不同目标处理单元的处理能力,分配不同类型的中断。从而有利于提高目标处理单元处理系统事件的效率。In the embodiment of the present application, for the same interrupt source, different types of interrupt requests of the interrupt source are allocated to different target processing unit processing by interrupting the distribution policy. For example, different types of interrupts are assigned based on the processing capabilities of different target processing units. Thereby, it is beneficial to improve the efficiency of the target processing unit processing system events.
可选地,所述中断分发策略可以以中断分发表的形式,该中断分发表用于记录多种类型的中断请求与多个处理单元的映射关系,所述多种类型包括所述第一类型和所述第二类型,所述多个处理单元包括所述中央处理单元和所述协处理单元。Optionally, the interrupt distribution policy may be in the form of an interrupt sub-publishing for recording a mapping relationship between multiple types of interrupt requests and a plurality of processing units, the plurality of types including the first type And the second type, the plurality of processing units including the central processing unit and the co-processing unit.
该中断分发表可以记录中断请求类型与路由信息的对应关系,路由信息用于将中断请求路由至目标处理单元。中断源可以查询该中断分发表来确定中断请求对应的路由信息,可以基于该确定后的路由信息路由该中断请求至目标处理单元。The interrupt sub-publishing can record the correspondence between the interrupt request type and the routing information, and the routing information is used to route the interrupt request to the target processing unit. The interrupt source may query the interrupt sub-publishing to determine routing information corresponding to the interrupt request, and may route the interrupt request to the target processing unit based on the determined routing information.
需要说明的是,该路由信息可以包括传输中断请求需要通过的端口的端口号,或者目标处理单元的路由地址等。一种可能的替换实施方式,在计算设备的中断源与处理该中断源产生的系统事件的目标处理器为一一对应的情况下,中断源可以不存储该中断分发表,而直接将中断请求发送至该中断源对应的目标处理单元。It should be noted that the routing information may include a port number of a port through which the interrupt request is transmitted, or a routing address of the target processing unit. In a possible alternative implementation, in the case that the interrupt source of the computing device has a one-to-one correspondence with the target processor that processes the system event generated by the interrupt source, the interrupt source may not store the interrupt sub-publish, but directly interrupt the request. Send to the target processing unit corresponding to the interrupt source.
可选地,该第二类型的中断请求为故障类型的中断请求。如果该中断源检测到自身出了故障,该第二类型指示该中断源的故障类型。如果该中断源用于检测其它设备或者检测计算设备的其它器件,则该第二类型指示该中断源检测的故障类型。Optionally, the second type of interrupt request is a fault type interrupt request. If the interrupt source detects that it has failed, the second type indicates the type of fault of the interrupt source. If the interrupt source is used to detect other devices or to detect other devices of the computing device, the second type indicates the type of fault detected by the interrupt source.
下文基于图1所示的计算设备100的示意性框图,结合图4介绍本申请另一实施例的处理中断的方法。Hereinafter, a method of processing an interrupt according to another embodiment of the present application will be described with reference to FIG. 4 based on a schematic block diagram of the computing device 100 shown in FIG. 1.
图4是本申请实施例的处理中断的方法的示意性流程图。图4所示的方法包括步骤410至步骤430。需要说明的是,图4所示的方法中使用的名词描述与图3所示的方法中使用的名词描述是相同的,可以理解为具有相同的含义,为了简洁,在图4所示的方法中不做具体介绍。FIG. 4 is a schematic flowchart of a method for processing an interrupt according to an embodiment of the present application. The method illustrated in FIG. 4 includes steps 410 through 430. It should be noted that the noun description used in the method shown in FIG. 4 is the same as the noun description used in the method shown in FIG. 3, and can be understood as having the same meaning. For the sake of brevity, the method shown in FIG. No specific introduction is made.
410,中央处理单元接收中断源发送的中断请求。410. The central processing unit receives an interrupt request sent by the interrupt source.
具体地,中央处理单元接收到中断请求后,中断当前运行的程序,进入中断处理流程。Specifically, after receiving the interrupt request, the central processing unit interrupts the currently running program and enters an interrupt processing flow.
420,所述中央处理单元获取触发所述中断请求的系统事件。420. The central processing unit acquires a system event that triggers the interrupt request.
具体地,中央处理单元在进入中断处理流程后,可以根据中断请求获取触发中断请求的系统事件。例如,中央处理单元可以通过中断请求中携带的中断号,确定发送该中断请求的中断源,并查询中断源的寄存器中记录的日志,从该日志获取中断源的运行状态,以从该运行状态中获取需要处理的系统事件。Specifically, after entering the interrupt processing flow, the central processing unit may acquire a system event that triggers the interrupt request according to the interrupt request. For example, the central processing unit may determine the interrupt source that sends the interrupt request by using the interrupt number carried in the interrupt request, and query the log recorded in the register of the interrupt source, and obtain the running state of the interrupt source from the log to obtain the running state. Get the system events that need to be processed.
430,所述中央处理单元指示所述协处理单元处理所述系统事件。430. The central processing unit instructs the coprocessing unit to process the system event.
可选地,中央处理单元可以通过查询事件分发策略,确定处理系统事件的协处理单元,所述事件分发策略用于指示处理系统事件的协处理单元,事件分发策略中包含多种类型的系统事件与多个协处理单元的映射关系。从而中央处理单元可以向确定后的协处理单元发送系统事件。Optionally, the central processing unit may determine a co-processing unit that processes the system event by querying an event distribution policy, where the event distribution policy is used to indicate a co-processing unit that processes the system event, and the event distribution policy includes multiple types of system events. A mapping relationship with multiple coprocessing units. Thereby the central processing unit can send a system event to the determined co-processing unit.
应理解,上述事件分发策略可以是中央处理器出厂时预设的,还可以是用户在使用过程中配置的。It should be understood that the above event distribution policy may be preset by the central processing unit at the factory, or may be configured by the user during use.
在本申请实施例中,中央处理单元可以通过事件分发策略,将不同类型的系统事件分配至不同的协处理单元处理。例如,基于不同协处理单元的处理能力,分配不同类型的系统事件。从而提高了协处理单元处理系统事件的效率。In the embodiment of the present application, the central processing unit may allocate different types of system events to different co-processing unit processing through an event distribution policy. For example, different types of system events are assigned based on the processing capabilities of different co-processing units. Thereby improving the efficiency of the coprocessing unit processing system events.
可选地,该事件分发策略可以以事件分发表的形式体现,事件分发表记录多种类型的系统事件与多个协处理单元的映射关系。Optionally, the event distribution policy may be embodied in the form of event sub-publishing, and the event sub-publishing records a mapping relationship between multiple types of system events and multiple co-processing units.
一种可能的具体实现方式,该事件分发表可以记录系统事件的类型与路由信息的对应关系,路由信息用于将系统事件路由至协处理单元。中央处理单元可以查询该事件分发表来确定系统事件对应的路由信息,并可以基于确定后的路由信息将该系统事件路由至对应的协处理单元。A possible specific implementation manner, the event sub-publishing can record the correspondence between the type of the system event and the routing information, and the routing information is used to route the system event to the co-processing unit. The central processing unit may query the event sub-publishing to determine routing information corresponding to the system event, and may route the system event to the corresponding co-processing unit based on the determined routing information.
需要说明的是,该路由信息可以包括传输系统事件通过的端口的端口号,或者协处理单元的路由地址等。It should be noted that the routing information may include a port number of a port through which a system event is transmitted, or a routing address of a coprocessing unit, and the like.
例如,系统事件为处理记录中断源的运行状态时,中央处理单元可以指示处理该系统事件的协处理单元为BMC。For example, when the system event is to process the running state of the recording interrupt source, the central processing unit may indicate that the coprocessing unit that processes the system event is the BMC.
在本申请实施例中,通过中央处理单元指示协处理单元处理系统事件,相对于中央处理单元处理计算设备中全部系统事件的方案而言,避免了中央处理单元因处理系统事件而在处理该系统事件的一段较长的时间内不能运行应用程序或OS,提高了计算设备的整体性能。In the embodiment of the present application, the central processing unit instructs the coprocessing unit to process the system event, and the central processing unit is prevented from processing the system due to processing system events, compared to the scheme in which the central processing unit processes all system events in the computing device. The application or OS cannot be run for a long period of time, improving the overall performance of the computing device.
可选地,中央处理单元还可以根据以下三种预设规则确定是否指示协处理单元处理系统事件,其中,预设规则一,中央处理单元根据系统事件的类型确定是否指示协处理单元处理系统事件;预设规则二,中央处理单元的负载高于目标门限时,指示协处理单元处理系统事件;预设规则三,中央处理单元指示协处理单元处理系统事件中的子事件,以便与协处理单元协同处理系统事件。Optionally, the central processing unit may further determine whether to instruct the coprocessing unit to process the system event according to the following three preset rules, where the central processing unit determines whether to instruct the coprocessing unit to process the system event according to the type of the system event. Preset rule 2, when the load of the central processing unit is higher than the target threshold, the coprocessing unit is instructed to process the system event; the preset rule 3, the central processing unit instructs the coprocessing unit to process the sub-event in the system event, so as to cooperate with the co-processing unit Collaborate on system events.
下文基于该预设规则一,描述本申请实施例中处理中断请求的方法。The method for processing an interrupt request in the embodiment of the present application is described below based on the preset rule 1.
作为实现步骤430的一个可能实施方式,所述中央处理单元在所述系统事件的类型为目标类型时,可以指示所述协处理单元处理所述系统事件,所述目标类型指示所述协处理单元处理具有所述目标类型的系统事件。As a possible implementation manner of the implementation step 430, the central processing unit may instruct the coprocessing unit to process the system event when the type of the system event is a target type, and the target type indicates the coprocessing unit Process system events with the target type.
具体地,该目标类型指示协处理单元处理具有目标类型的系统事件,并且协处理单元 也具有处理目标类型的系统事件的能力。Specifically, the target type indicates that the co-processing unit processes system events having the target type, and the co-processing unit also has the ability to process system events of the target type.
例如,该系统事件为记录读数据时的可纠正错误时,仅仅需要将该读数据时的可纠正错误记录在日志中。这种实现将读数据时的可纠正错误记录在日志中的系统事件,可以由协处理单元单独处理。因此,该记录读数据时的可纠正错误的系统事件的类型为目标类型。For example, when the system event is a correctable error when recording read data, only the correctable error at the time of reading the data needs to be recorded in the log. This implementation of system events that record correctable errors in reading data in the log can be handled separately by the co-processing unit. Therefore, the type of system event that can correct the error when reading the data is the target type.
应理解,该目标类型的系统事件包括多个子事件时,多个子事件中的至少一个子事件可以分配给协处理单元处理。It should be understood that when the target type of system event includes multiple sub-events, at least one of the plurality of sub-events may be assigned to the co-processing unit for processing.
若所述系统事件的类型为所述目标类型,所述系统事件包括多个子事件,在该步骤430中,所述中央处理单元可以指示所述协处理单元处理所述多个子事件中的至少一个子事件。可选地,该多个子事件中未指示给所述协处理单元的子事件,可以由中央处理单元进行处理。If the type of the system event is the target type, the system event includes a plurality of sub-events, and in the step 430, the central processing unit may instruct the co-processing unit to process at least one of the plurality of sub-events Sub-event. Optionally, the sub-events that are not indicated to the co-processing unit among the plurality of sub-events may be processed by the central processing unit.
具体地,该多个子事件中未指示给所述协处理单元的子事件可以包括多个子事件中除至少一个子事件之外的子事件。Specifically, the sub-event that is not indicated to the co-processing unit among the plurality of sub-events may include sub-events other than the at least one sub-event of the plurality of sub-events.
在中央处理单元和协处理单元协同处理系统事件的过程中,中央处理单元和协处理单元分别处理的子事件,可以通过预设的处理规则确定。例如,预设的处理规则可以设置为协处理单元处理该多个子事件中的第一类子事件,第一类子事件是指该多个子事件中满足目标类型的子事件;该多个子事件中的该至少一个子事件满足目标类型,属于该第一类子事件;预设规则可以设置为中央处理单元处理该多个子事件中的第二类子事件,该第二类子事件是指该多个子事件中未指示给所述协处理单元的子事件,即该多个子事件中除该至少一个子事件之外的子事件。In the process in which the central processing unit and the co-processing unit cooperate to process system events, the sub-events respectively processed by the central processing unit and the co-processing unit may be determined by preset processing rules. For example, the preset processing rule may be set to the coprocessing unit to process the first type of sub-events of the plurality of sub-events, where the first-type sub-event refers to the sub-event that satisfies the target type among the plurality of sub-events; The at least one sub-event satisfies the target type and belongs to the first-type sub-event; the preset rule may be set to the central processing unit to process the second-type sub-event of the plurality of sub-events, the second-type sub-event refers to the multi-event A sub-event to the co-processing unit is not indicated in the sub-event, that is, a sub-event other than the at least one sub-event among the plurality of sub-events.
一种可能设计,目标类型是指可以由协处理单元处理。该第一类子事件可以为由协处理单元处理的子事件,该第二类子事件可以为必须由中央处理单元处理的子事件。One possible design, the target type is that it can be processed by the co-processing unit. The first type of sub-event may be a sub-event processed by a co-processing unit, which may be a sub-event that must be processed by a central processing unit.
由协处理单元处理该满足目标类型的第一类子事件,由中央处理单元处理该多个子事件中未指示给所述协处理单元的第二类子事件,即由协处理单元和中央处理单元协同处理系统事件,有利于减小中央处理单元处理系统事件的时间,提高计算设备的整体性能。The first type of sub-event that satisfies the target type is processed by the co-processing unit, and the second type of sub-events of the plurality of sub-events not indicated to the co-processing unit are processed by the central processing unit, that is, by the co-processing unit and the central processing unit Collaborative processing of system events is beneficial to reducing the time that the central processing unit handles system events and improving the overall performance of the computing device.
还应理解,本申请实施例对该第一类子事件和该第二类子事件在处理的时间上的先后关系不做限定,例如,第一类子事件包括的多个子事件与第二类子事件包括的多个子事件在处理时间上可以交叉进行。It should also be understood that the embodiment of the present application does not limit the relationship between the first type of sub-event and the second type of sub-event in the processing time, for example, the plurality of sub-events included in the first-type sub-event and the second type The plurality of sub-events included in the sub-event can be cross-processed in processing time.
下文基于该预设规则二,描述本申请实施例中处理中断请求的方法。The method for processing an interrupt request in the embodiment of the present application is described below based on the preset rule 2.
作为实现步骤430的一个可能实施方式,所述CPU获取所述CPU的当前负载信息;所述CPU在所述当前负载信息所指示的所述CPU的负载高于目标门限时,指示所述协处理单元处理所述系统事件。As a possible implementation manner of the implementation step 430, the CPU acquires current load information of the CPU; the CPU indicates the co-processing when the load of the CPU indicated by the current load information is higher than a target threshold. The unit processes the system event.
具体地,该CPU的负载高于目标门限时,可以理解为CPU当前的负载处于高负载状态。Specifically, when the load of the CPU is higher than the target threshold, it can be understood that the current load of the CPU is in a high load state.
需要说明的是,该CPU的负载具体可以通过CPU的计算资源的占用率,CPU的存储资源的占用率,或者CPU待处理的任务的数量等参数体现。本申请实施例对CPU的负载的具体体现形式不做限定。It should be noted that the load of the CPU may be specifically represented by parameters such as the occupancy rate of the computing resources of the CPU, the occupancy rate of the storage resources of the CPU, or the number of tasks to be processed by the CPU. The embodiment of the present application does not limit the specific embodiment of the load of the CPU.
还应理解,该目标门限可以是预设的,例如可以是CPU在出厂时预设的,还可以是用户在使用CPU的过程中设置的。本申请实施例对此不做具体限定。It should also be understood that the target threshold may be preset, for example, may be preset by the CPU at the factory, or may be set by the user during the process of using the CPU. This embodiment of the present application does not specifically limit this.
在本申请实施例中,在CPU的负载高于目标门限时,CPU可以指示协处理单元处理 系统事件,虽然由协处理单元处理系统事件,可能会降低处理系统事件的效率,但是避免了CPU为处理系统事件而中断当前运行的应用程序或OS,有利于提高计算设备的效率。In the embodiment of the present application, when the load of the CPU is higher than the target threshold, the CPU may instruct the coprocessing unit to process the system event, although processing the system event by the coprocessing unit may reduce the efficiency of processing the system event, but avoiding the CPU Handling system events and interrupting the currently running application or OS helps to increase the efficiency of the computing device.
可选地,若所述CPU在所述当前负载信息所指示的所述CPU的负载低于或等于目标门限时,CPU处理触发所述中断请求的系统事件。Optionally, if the CPU is less than or equal to a target threshold indicated by the current load information, the CPU processes a system event that triggers the interrupt request.
也就是说,在CPU的负载低于或等于该目标门限时,CPU可以自己处理系统事件。That is, the CPU can handle system events by itself when the CPU load is below or equal to the target threshold.
在CPU的负载低于或等于目标门限时,CPU处理系统事件的效率,相对于协处理单元处理系统事件的效率而言较高。因此,当CPU的负载低于或等于目标门限时,可以由CPU自己处理系统事件,有利于提高处理系统事件的效率。When the CPU load is below or equal to the target threshold, the efficiency of the CPU processing system events is higher relative to the efficiency of the co-processing unit handling system events. Therefore, when the CPU load is lower than or equal to the target threshold, the CPU event can be handled by the CPU itself, which is beneficial to improve the efficiency of processing system events.
可选地,该预设规则一和预设规则二还可以结合使用,例如,在CPU的负载高于目标门限,且系统事件的类型为该目标类型时,CPU可以指示协处理单元处理系统事件。Optionally, the preset rule 1 and the preset rule 2 may also be used in combination. For example, when the load of the CPU is higher than the target threshold, and the type of the system event is the target type, the CPU may instruct the coprocessing unit to process the system event. .
需要说明的是,CPU可以指示协处理单元处理系统事件,可以理解为,协处理单元可以执行处理系统事件所需的全部操作;或者说,当系统事件包括多个子事件时,CPU可以指示协处理单元处理多个子事件中的至少一个子事件。It should be noted that the CPU may instruct the coprocessing unit to process system events. It can be understood that the coprocessing unit can perform all operations required to process system events; or, when the system event includes multiple sub-events, the CPU can indicate co-processing. The unit processes at least one of the plurality of sub-events.
关于协处理单元可以执行处理目系统事件所需的全部操作,或者协处理单元处理至少一个子事件的情况,可以参见上文中关于预设规则一中的细节描述,为了简洁,在此不做赘述。For the case where the co-processing unit can perform all the operations required to process the event of the target system, or the co-processing unit processes at least one sub-event, refer to the detailed description in the pre-set rule one above, and for the sake of brevity, no further description is provided herein. .
下文基于该预设规则三,描述本申请实施例中处理中断请求的方法。The method for processing an interrupt request in the embodiment of the present application is described below based on the preset rule 3.
作为实现步骤430的一个可能实施方式,所述系统事件包括多个子事件,所述CPU指示所述协处理单元处理所述多个子事件中的至少一个子事件。可选地,该多个子事件中除至少一个子事件之外的子事件,可以由中央处理单元进行处理。As one possible implementation of the implementing step 430, the system event includes a plurality of sub-events, and the CPU instructs the co-processing unit to process at least one of the plurality of sub-events. Optionally, sub-events other than the at least one sub-event of the plurality of sub-events may be processed by the central processing unit.
在中央处理单元和协处理单元协同处理系统事件的过程中,中央处理单元和协处理单元分别处理的子事件,可以通过预设的处理规则确定。例如,预设的处理规则可以设置为协处理单元处理该多个子事件中的第一类子事件,第一类子事件包括该至少一个子事件;预设的系统事件处理规则可以设置为中央处理单元处理该多个子事件中的第二类子事件,该第二类子事件包括该多个子事件中除该至少一个子事件之外的子事件。In the process in which the central processing unit and the co-processing unit cooperate to process system events, the sub-events respectively processed by the central processing unit and the co-processing unit may be determined by preset processing rules. For example, the preset processing rule may be set to the coprocessing unit to process the first type of sub-events of the plurality of sub-events, the first type of sub-events including the at least one sub-event; the preset system event processing rule may be set to be centrally processed The unit processes a second type of sub-events of the plurality of sub-events, the second type of sub-events including sub-events of the plurality of sub-events other than the at least one sub-event.
一种可能设计,该第一类子事件可以为协处理单元有能力处理的子事件,该第二类子事件可以为协处理单元不能处理的子事件。其中,协处理单元不能处理的子事件可以指协处理单元不具有处理子事件的权限,或者协处理单元不具有处理子事件的机制,本申请实施例对于协处理单元不能处理的子事件的具体原因不做限定。In a possible design, the first type of sub-event can be a sub-event that the co-processing unit has the ability to process, and the second-type sub-event can be a sub-event that the co-processing unit cannot process. The sub-event that the co-processing unit cannot process may refer to that the co-processing unit does not have the permission to process the sub-event, or the co-processing unit does not have the mechanism for processing the sub-event, and the specific embodiment of the present application is not applicable to the sub-event that the co-processing unit cannot process. The reason is not limited.
可选地,作为一个实施例,该预设规则三可以与预设规则二结合使用,,所述方法还包括:所述CPU获取所述CPU的当前负载信息;所述CPU在所述当前负载信息所指示的所述CPU的负载高于目标门限时,从所述多个子事件中选择出至少一个子事件。进而,所述CPU指示所述协处理单元处理选择出的所述至少一个子事件。Optionally, as an embodiment, the preset rule 3 may be used in combination with the preset rule 2. The method further includes: the CPU acquiring current load information of the CPU; and the CPU is at the current load. When the load of the CPU indicated by the information is higher than the target threshold, at least one sub-event is selected from the plurality of sub-events. Further, the CPU instructs the co-processing unit to process the selected at least one sub-event.
应理解,上文中关于预设规则二的详细描述,适用于在本申请实施例中预设规则三与预设规则二结合使用的方案,为了简洁,在此不再赘述。It should be understood that the foregoing detailed description of the preset rule 2 is applicable to the scheme in which the preset rule 3 and the preset rule 2 are used in the embodiment of the present application. For brevity, details are not described herein again.
可选地,作为一个实施例,该预设规则三还可以结合预设规则一使用,在所述方法还包括:所述CPU从所述多个子事件中选择与目标类型匹配的至少一个子事件,所述目标类型指示所述协处理单元处理具有所述目标类型的子事件。进而,所述CPU指示所述协处理单元处理选择出的所述至少一个子事件。Optionally, as an embodiment, the preset rule 3 is further used in combination with the preset rule 1. The method further includes: the CPU selecting, from the multiple sub-events, at least one sub-event matching the target type. The target type instructs the co-processing unit to process a sub-event having the target type. Further, the CPU instructs the co-processing unit to process the selected at least one sub-event.
具体地,该目标类型的子事件与上文中描述的目标类型的子事件的性质相同,即都属于协处理单元有能力处理的子事件。Specifically, the sub-event of the target type has the same properties as the sub-event of the target type described above, that is, all sub-events that the co-processing unit is capable of processing.
需要说明的是,该目标类型的子事件可以是预存的。例如,在CPU出厂时,该目标类型的子事件可以集成在计算设备内部或者CPU内部,以便于CPU从待处理的系统事件中的查找出目标类型的子事件。It should be noted that the sub-event of the target type may be pre-stored. For example, when the CPU is shipped from the factory, the sub-event of the target type can be integrated inside the computing device or inside the CPU, so that the CPU can find out the target type of sub-event from the system event to be processed.
下文基于图1所示的计算设备100的示意性框图,结合图5介绍本申请另一实施例的处理中断的方法。Hereinafter, a method of processing an interrupt according to another embodiment of the present application will be described with reference to FIG. 5 based on a schematic block diagram of the computing device 100 shown in FIG. 1.
图5是本申请实施例的处理中断的方法的示意性流程图。图5所示的方法包括步骤510至步骤530。需要说明的是,图5所示的方法中的名词描述,或者实现方法的具体方式可以参见图3和图4中的相关描述,为了简洁,在图5所示的方法中不做具体介绍。FIG. 5 is a schematic flowchart of a method for processing an interrupt according to an embodiment of the present application. The method shown in FIG. 5 includes steps 510 to 530. It should be noted that the description of the nouns in the method shown in FIG. 5 or the specific manner of implementing the method can be referred to the related descriptions in FIG. 3 and FIG. 4. For the sake of brevity, the method shown in FIG. 5 is not specifically described.
510,中央处理单元接收中断源发送的中断请求。510. The central processing unit receives an interrupt request sent by the interrupt source.
520,中央处理单元直接向协处理单元转发该中断请求,由协处理单元处理触发该中断请求的系统事件。520. The central processing unit directly forwards the interrupt request to the coprocessing unit, and the coprocessor unit processes the system event that triggers the interrupt request.
具体地,中央处理单元将中断请求转发至协处理单元,当协处理单元接收到该中断请求后,可以基于该中断请求确定触发该中断请求的系统事件,并对该系统事件进行处理。Specifically, the central processing unit forwards the interrupt request to the co-processing unit. After receiving the interrupt request, the co-processing unit may determine a system event that triggers the interrupt request based on the interrupt request, and process the system event.
需要说明的是,该基于该中断请求确定触发该中断请求的系统事件的具体过程可以参见上文中描述的协处理单元确定触发中断请求的系统事件的具体过程。It should be noted that the specific process of determining the system event that triggers the interrupt request based on the interrupt request may be referred to the specific process of the system event that triggers the interrupt request by the coprocessing unit described above.
可选地,该中断请求可以以中断信号或中断信息,由中央处理单元向协处理单元传输,以指示所述协处理单元处理中断请求对应的所述系统事件。Optionally, the interrupt request may be transmitted by the central processing unit to the co-processing unit with an interrupt signal or interrupt information to instruct the co-processing unit to process the system event corresponding to the interrupt request.
一种可选实施方式,该中断请求以中断信息的方式传输时,中断信息中可以携带触发该中断请求的系统事件,协处理单元可以直接从中断信息中获取系统事件,无需再通过现有技术中中央处理单元获取系统事件的方式获取系统事件。有利于简化协处理单元获取系统事件的步骤。In an optional implementation manner, when the interrupt request is transmitted by using the interrupt information, the interrupt information may carry a system event that triggers the interrupt request, and the co-processing unit may directly acquire the system event from the interrupt information, without using the prior art. The central processing unit acquires system events in a manner that acquires system events. It is beneficial to simplify the steps of the coprocessing unit to acquire system events.
另一方面,通过在中断信息中携带触发该中断请求的系统事件,避免了协处理单元由于无法获取系统事件而导致无法处理系统事件的情况,提高了协处理单元处理系统事件的可能性。On the other hand, by carrying the system event that triggers the interrupt request in the interrupt information, the situation that the co-processing unit cannot process the system event due to the inability to acquire the system event is avoided, and the possibility that the co-processing unit handles the system event is improved.
一种可选实施方式,该中断请求以中断信息的方式传输时,该中断信息也可以与中断信号的作用相同,仅仅通知协处理单元进入中断处理程序,而不指示协处理单元系统事件的内容,此时,协处理单元需要采用现有技术中中央处理单元获取系统事件的方式,获取系统事件。In an optional implementation manner, when the interrupt request is transmitted in the manner of interrupt information, the interrupt information may also be the same as the interrupt signal, and only notify the coprocessing unit to enter the interrupt processing program without indicating the content of the coprocessing unit system event. At this time, the co-processing unit needs to acquire the system event by using the central processing unit in the prior art to acquire the system event.
通过减少中断信息中携带的信息的内容,以减小传输中断信息造成的信令开销。The signaling overhead caused by the transmission interruption information is reduced by reducing the content of the information carried in the interrupt information.
在本申请实施例中,可以不用改进中断源与协处理单元之间的硬件连接,通过CPU向协处理单元转发中断请求的方式,使得协处理单元处理触发该中断请求的系统事件。In the embodiment of the present application, the hardware connection between the interrupt source and the co-processing unit may be improved, and the interrupt request may be forwarded by the CPU to the co-processing unit, so that the co-processing unit processes the system event that triggers the interrupt request.
作为实现步骤520的一个可能的实现方式,中央处理单元在CPU的负载高于目标门限时,直接向协处理单元转发该中断请求。As a possible implementation of the implementation step 520, the central processing unit forwards the interrupt request directly to the coprocessing unit when the load of the CPU is higher than the target threshold.
在步骤520之前,该方法还包括:CPU查询中断转发策略,确定处理系统事件的协处理单元,所述中断转发策略用于指示处理系统事件的目标处理单元,在CPU确定所述中断请求对应的目标处理单元为该协处理单元时,执行步骤520。Before the step 520, the method further includes: the CPU queries the interrupt forwarding policy, and determines a co-processing unit that processes the system event, where the interrupt forwarding policy is used to indicate a target processing unit that processes the system event, and the CPU determines that the interrupt request corresponds to When the target processing unit is the co-processing unit, step 520 is performed.
具体地,该中断转发策略还用于指示多种类型的中断请求与多个协处理单元的映射关 系,即,中断转发策略记录处理多种类型的中断请求中不同类型的中断请求的协处理单元。Specifically, the interrupt forwarding policy is further used to indicate a mapping relationship between multiple types of interrupt requests and multiple coprocessing units, that is, the interrupt forwarding policy records a coprocessing unit that processes different types of interrupt requests in multiple types of interrupt requests. .
该目标处理单元为可以处理该中断请求的协处理单元。The target processing unit is a co-processing unit that can process the interrupt request.
应理解,上述事件分发策略可以是中央处理器出厂时预设的,还可以是用户在使用过程中配置的。It should be understood that the above event distribution policy may be preset by the central processing unit at the factory, or may be configured by the user during use.
在本申请实施例中,CPU通过中断转发策略,将该不同类型的中断请求分配至不同的目标处理单元处理,即基于不同目标处理单元的处理能力,分配不同类型的系统事件,有利于提高目标处理单元处理系统事件的效率。In the embodiment of the present application, the CPU allocates different types of interrupt requests to different target processing units by interrupting the forwarding policy, that is, assigning different types of system events based on the processing capabilities of different target processing units, which is beneficial to improving the target. The processing unit handles the efficiency of system events.
可选地,该中断转发策略可以通过中断转发表的形式体现。具体地,中断转发表可以记录中断请求类型与路由信息的对应关系,路由信息用于将中断请求路由至目标处理单元。CPU可以查询该中断转发表来确定中断请求对应的路由信息,可以基于该确定后的路由信息路由该中断请求至目标处理单元。Optionally, the interrupt forwarding policy may be embodied by an interrupt forwarding table. Specifically, the interrupt forwarding table may record a correspondence between the interrupt request type and the routing information, and the routing information is used to route the interrupt request to the target processing unit. The CPU may query the interrupt forwarding table to determine routing information corresponding to the interrupt request, and may route the interrupt request to the target processing unit based on the determined routing information.
需要说明的是,该路由信息可以包括传输中断请求需要通过的端口的端口号,或者目标处理单元的路由地址等。It should be noted that the routing information may include a port number of a port through which the interrupt request is transmitted, or a routing address of the target processing unit.
需要说明的是,该中断转发表可以存储在计算设备的存储器中。It should be noted that the interrupt forwarding table can be stored in the memory of the computing device.
一种可能实施方式,在计算设备中处理系统事件的目标处理单元的数量为1的情况下,即只有一个协处理单元可以处理系统事件时,CPU可以不存储该中断转发策略,而直接将中断请求发送至该协处理单元。A possible implementation manner, in the case that the number of target processing units for processing system events in the computing device is 1, that is, when only one coprocessing unit can process system events, the CPU may not store the interrupt forwarding policy, but directly interrupts The request is sent to the co-processing unit.
下文结合图6,以基于在线为计算设备增加内存条产生的系统事件为例,说明中央处理单元和协处理单元协同处理系统事件的方法。具体地处理系统事件的过程可以划分为4个处理流程:为内存条供电,初始化内存条,为内存条分配物理地址以及通知OS使用该内存条。Hereinafter, in conjunction with FIG. 6, a method for cooperating a system event by a central processing unit and a coprocessing unit is illustrated by taking a system event generated by adding a memory stick for a computing device online as an example. The process of specifically processing system events can be divided into four processing flows: powering the memory module, initializing the memory module, assigning a physical address to the memory module, and notifying the OS to use the memory module.
图6是本申请实施例的中央处理单元和协处理单元协同处理系统事件的方法的示意性流程图。图6所示的方法包括步骤610至步骤611。FIG. 6 is a schematic flowchart of a method for a central processing unit and a coprocessing unit to jointly process a system event according to an embodiment of the present application. The method shown in FIG. 6 includes steps 610 to 611.
处理流程一,为内存条供电。Process one, powering the memory module.
601,协处理单元接收中央处理单元发送的IPMI消息,IPMI消息用于指示协处理单元为处理系统事件而中断当前运行的程序。601. The coprocessing unit receives an IPMI message sent by the central processing unit, where the IPMI message is used to instruct the coprocessing unit to interrupt the currently running program for processing a system event.
602,协处理单元基于该预设规则,确定处理该系统事件的过程中协处理单元需要向新增的内存条供电。602. The coprocessing unit determines, according to the preset rule, that the coprocessing unit needs to supply power to the newly added memory module in the process of processing the system event.
具体地,该协处理单元可以是BMC上的SP。Specifically, the co-processing unit may be an SP on the BMC.
603,协处理单元为内存条供电。603. The coprocessing unit supplies power to the memory module.
604,协处理单元通知中央处理单元该为内存条供电的操作完成。604. The coprocessing unit notifies the central processing unit that the operation of powering the memory module is completed.
具体地,协处理单元操作在寄存器中的状态位,通过该状态位指示内存条供电的操作完成,之后协处理单元向中央处理单元发送执行完成信息。中央处理单元在收到执行完成信息,查询该寄存器中的状态位,获知内存条已供电。Specifically, the co-processing unit operates a status bit in the register, by which the operation of the memory strip power supply is completed, and then the co-processing unit transmits execution completion information to the central processing unit. The central processing unit receives the execution completion information, queries the status bits in the register, and knows that the memory module is powered.
需要说明的是,该供中央处理单元查询的状态位可以是协处理单元和中央处理单元预先预定的,用于指示内存条供电的操作是否完成的状态位。It should be noted that the status bit for the central processing unit to query may be a status bit pre-determined by the co-processing unit and the central processing unit for indicating whether the operation of the power supply of the memory module is completed.
应理解,该执行完成信息可以是中断信号,具体地,协处理单元可以通过平台控制芯片(Platform Controller Hub,PCH)上的通用输入/输出(General Purpose Input Output,GPIO)管脚触发该中断信号。It should be understood that the execution completion information may be an interrupt signal. Specifically, the coprocessor may trigger the interrupt signal through a General Purpose Input Output (GPIO) pin on a Platform Controller Hub (PCH). .
605,内存条被上电成功后会使对应的上电状态位变为有效,协处理单元会读取到该有效的上电状态。605, after the memory card is successfully powered on, the corresponding power-on status bit becomes valid, and the co-processing unit reads the valid power-on state.
处理流程二,初始化内存条。Process flow 2, initialize the memory module.
606,协处理单元执行初始化内存条的操作。606. The coprocessing unit performs an operation of initializing the memory module.
具体地,初始化内存条的操作可以包括为内存条和内存数据总线配置电气参数以及对内存条进行自检等操作。Specifically, the operation of initializing the memory module may include configuring electrical parameters for the memory module and the memory data bus, and performing self-checking on the memory module.
需要说明的是,该协处理单元完成初始化内存条的操作后,通知中央处理单元的方式可以参见该处理流程一中协处理单元通知中央处理单元的方式,为了简洁,在此不再赘述。It should be noted that, after the co-processing unit completes the operation of initializing the memory module, the manner of notifying the central processing unit can be referred to the manner in which the co-processing unit notifies the central processing unit in the process flow 1. For brevity, no further details are provided herein.
在本申请实施例中,初始化内存条的过程占用的时间较长,由于协处理单元代替中央处理单元初始化内存条,中央处理单元可以较长时间不受该系统事件(用于初始化内存条)的影响,中央处理单元可以在这段时间执行应用程序,有利于提高计算设备的整体性能。In the embodiment of the present application, the process of initializing the memory module takes a long time. Since the coprocessing unit replaces the central processing unit to initialize the memory module, the central processing unit can be free from the system event (for initializing the memory module) for a long time. Impact, the central processing unit can execute the application during this time, which helps to improve the overall performance of the computing device.
处理流程三,为内存条分配物理地址。Process 3, assigning a physical address to the memory module.
607,协处理单元将内存条的内存地址写入中央处理单元的影子寄存器(shadow register)。607. The coprocessing unit writes the memory address of the memory module to a shadow register of the central processing unit.
608,协处理单元通知中央处理单元内存条的内存地址已经写入中央处理单元的影子寄存器中。608. The coprocessor processing unit notifies that the memory address of the central processing unit memory module has been written into the shadow register of the central processing unit.
需要说明的是,该协处理单元通知中央处理单元的方式可以参见该处理流程一中协处理单元通知中央处理单元的方式,为了简洁,在此不再赘述。It should be noted that, the manner in which the co-processing unit notifies the central processing unit can refer to the manner in which the co-processing unit notifies the central processing unit in the process flow 1. For brevity, no further details are provided herein.
609,中央处理单元发起静默流程。609. The central processing unit initiates a silent process.
具体地,所谓静默流程可以指中央处理单元通知计算设备中所有的中央处理单元、缓存、内存控制器暂定动作,以便中央处理单元把影子寄存器的数据拷贝到有实际控制功能的寄存器里,以及内存控制器可以基于寄存器中的数据建立内存地址和物理地址之间的映射关系。Specifically, the silent process may refer to the central processing unit notifying all central processing units, caches, and memory controller tentative actions in the computing device, so that the central processing unit copies the data of the shadow register into the register having the actual control function, and The memory controller can establish a mapping relationship between the memory address and the physical address based on the data in the register.
610,中央处理单元发起解除静默通知,计算设备中的中央处理单元、缓存、内存控制器恢复运转。610. The central processing unit initiates the release of the silence notification, and the central processing unit, the cache, and the memory controller in the computing device resume operation.
需要说明的是,基于当前的计算设备架构,静默过程需要中央处理单元发出特殊的广播消息,因此属于只能由中央处理单元执行的操作。It should be noted that, based on the current computing device architecture, the silent process requires the central processing unit to issue special broadcast messages, and thus belongs to operations that can only be performed by the central processing unit.
处理流程四,BIOS通知OS使用该内存条。Process 4, the BIOS notifies the OS to use the memory module.
611,在中央处理单元中运行的BIOS通知OS使用内存条。611. The BIOS running in the central processing unit notifies the OS to use the memory module.
需要说明的是,因为BIOS需要在中央处理单元中运行,因此步骤611只能由中央处理单元处理。It should be noted that because the BIOS needs to run in the central processing unit, step 611 can only be processed by the central processing unit.
上文结合图1至图6详细介绍了本申请实施例的处理中断的方法,下文结合图7至图12详细地描述本申请实施例的处理中断的装置。需要说明的是,图7至图12所示的装置可以实现该方法中各个步骤,为了简洁,在此不再赘述。The method for processing interruption of the embodiment of the present application is described in detail above with reference to FIG. 1 to FIG. 6. The apparatus for processing interrupt in the embodiment of the present application is described in detail below with reference to FIG. 7 to FIG. It should be noted that the apparatus shown in FIG. 7 to FIG. 12 can implement various steps in the method, and details are not described herein for brevity.
图7是本申请实施例的处理中断的装置的示意性框图。图7所示的装置700可以是计算设备中的CPU,图7所述装置包括:接收模块710和处理模块720。FIG. 7 is a schematic block diagram of an apparatus for processing an interrupt according to an embodiment of the present application. The apparatus 700 shown in FIG. 7 may be a CPU in a computing device, and the apparatus shown in FIG. 7 includes a receiving module 710 and a processing module 720.
接收模块710,用于接收中断请求;The receiving module 710 is configured to receive an interrupt request.
处理模块720,用于获取所述中断请求对应的系统事件,所述系统事件包括所述中断请求的处理信息;The processing module 720 is configured to acquire a system event corresponding to the interrupt request, where the system event includes processing information of the interrupt request.
所述处理模块720,用于指示协处理单元处理所述系统事件。The processing module 720 is configured to instruct the coprocessing unit to process the system event.
可选地,作为一个实施例,所述处理模块720,具体用于:获取所述CPU的当前负载信息;在所述当前负载信息所指示的所述CPU的负载高于目标门限时,指示所述协处理单元处理所述系统事件。Optionally, as an embodiment, the processing module 720 is specifically configured to: acquire current load information of the CPU; and indicate, when the load of the CPU indicated by the current load information is higher than a target threshold. The descriptive processing unit processes the system event.
可选地,作为一个实施例,所述处理模块720,具体用于:在所述系统事件的类型为目标类型时,指示所述协处理单元处理所述系统事件,所述目标类型指示所述协处理单元处理具有所述目标类型的系统事件。Optionally, as an embodiment, the processing module 720 is specifically configured to: when the type of the system event is a target type, instruct the coprocessing unit to process the system event, where the target type indicates the The co-processing unit processes system events having the target type.
可选地,作为一个实施例,所述系统事件包括多个子事件,所述处理模块720,具体用于指示所述协处理单元处理所述多个子事件中的至少一个子事件。Optionally, as an embodiment, the system event includes multiple sub-events, and the processing module 720 is specifically configured to instruct the co-processing unit to process at least one of the plurality of sub-events.
可选地,作为一个实施例,所述处理模块720,还用于:获取所述CPU的当前负载信息;在所述当前负载信息所指示的所述CPU的负载高于目标门限时,从所述多个子事件中选择所述至少一个子事件。Optionally, as an embodiment, the processing module 720 is further configured to: acquire current load information of the CPU; and when the load of the CPU indicated by the current load information is higher than a target threshold, The at least one sub-event is selected from the plurality of sub-events.
可选地,作为一个实施例,所述处理模块720,还用于:从所述多个子事件中选择与目标类型匹配的子事件,所述与目标类型匹配的子事件为所述至少一个子事件,所述目标类型指示所述协处理单元处理具有所述目标类型的子事件。Optionally, as an embodiment, the processing module 720 is further configured to: select a sub-event matching the target type from the multiple sub-events, where the sub-event matching the target type is the at least one sub-event An event, the target type indicating that the co-processing unit processes a sub-event having the target type.
可选地,作为一个实施例,所述处理模块720,还用于处理所述多个子事件中除所述至少一个子事件之外的子事件。Optionally, as an embodiment, the processing module 720 is further configured to process a sub-event of the plurality of sub-events except the at least one sub-event.
可选地,作为一个实施例,所述处理模块720,还用于:根据所述中断请求进入中断;在处理完所述多个子事件中除所述至少一个子事件之外的子事件时,退出所述中断。Optionally, as an embodiment, the processing module 720 is further configured to: enter an interrupt according to the interrupt request; when processing a sub-event other than the at least one sub-event in the plurality of sub-events, Exit the interrupt.
在可选地实施例中,该接收模块710可以为中央处理单元中的输入输出接口810,该处理模块720可以为中央处理单元中的控制部件820,中央处理单元800还包括寄存器部件830,具体如图8所示。In an optional embodiment, the receiving module 710 can be an input/output interface 810 in the central processing unit. The processing module 720 can be a control component 820 in the central processing unit. The central processing unit 800 further includes a register component 830. As shown in Figure 8.
图8是本申请实施例的中央处理单元的示意性框图。图8所示的中央处理单元可以包括输入输出接口810,控制部件820和寄存器部件830。其中,输入输出接口810,控制部件820,和寄存器830通过内部连接通路相连,控制部件用于对指令译码,并且发出为完成每条指令所要执行的各个操作的控制信号,寄存器部件用于保存指令执行过程中临时存放的寄存器操作数和操作结果,输入输出接口用于接收输入的数据和信息,输出数据操作结果等数据。FIG. 8 is a schematic block diagram of a central processing unit of an embodiment of the present application. The central processing unit shown in FIG. 8 may include an input and output interface 810, a control unit 820, and a register unit 830. Wherein, the input/output interface 810, the control unit 820, and the register 830 are connected through an internal connection path, the control unit is configured to decode the instruction, and issue a control signal for each operation to be performed for each instruction, and the register component is used for saving The register operands and operation results temporarily stored during the execution of the instruction. The input and output interfaces are used to receive input data and information, and output data operation results and other data.
需要说明的是,该寄存器部件中可以包括至少一个寄存器,具体地,寄存器部件可以包括寄存器、专用寄存器和控制寄存器中的至少一种。It should be noted that at least one register may be included in the register component. Specifically, the register component may include at least one of a register, a special register, and a control register.
在实现过程中,该方法的各步骤可以通过计算设备的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法可以直接体现为硬件中央处理单元执行完成,或者用中央处理单元中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质可以位于计算设备中的存储器中,中央处理单元读取存储器中的信息,结合其硬件完成该方法的步骤。为避免重复,这里不再详细描述。In the implementation process, the steps of the method may be completed by an integrated logic circuit of the hardware of the computing device or an instruction in the form of software. The method disclosed in the embodiment of the present application may be directly implemented as a hardware central processing unit, or may be performed by a combination of hardware and software modules in a central processing unit. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like. The storage medium can be located in a memory in the computing device, and the central processing unit reads the information in the memory and, in conjunction with its hardware, performs the steps of the method. To avoid repetition, it will not be described in detail here.
图9是本申请实施例的处理中断的装置的示意性框图。图9所示的装置900包括获取模块910、处理模块920和接收模块930。FIG. 9 is a schematic block diagram of an apparatus for processing an interrupt according to an embodiment of the present application. The apparatus 900 shown in FIG. 9 includes an acquisition module 910, a processing module 920, and a receiving module 930.
获取模块910,用于获取中央处理单元CPU指示所述协处理单元处理的系统事件,所 述CPU指示的系统事件为所述CPU在接收到中断请求时获取的与所述中断请求对应的系统事件,所述系统事件包括所述中断请求的处理信息;The obtaining module 910 is configured to obtain a system event that is processed by the central processing unit CPU, and the system event indicated by the CPU is a system event that is acquired by the CPU when the interrupt request is received. The system event includes processing information of the interrupt request;
处理模块920,还用于处理获取的系统事件。The processing module 920 is further configured to process the acquired system event.
可选地,作为一个实施例,接收模块930,用于接收中断源发送的中断请求;获取模块930,还用于获取与所述协处理单元接收的中断请求对应的系统事件。Optionally, as an embodiment, the receiving module 930 is configured to receive an interrupt request sent by the interrupt source, and the acquiring module 930 is further configured to acquire a system event corresponding to the interrupt request received by the coprocessing unit.
在可选地实施例中,该接收模块930可以为协处理单元中的输入输出接口1010,该处理模块920和获取模块930可以为协处理单元中的控制部件1020,协处理单元1000还包括寄存器部件1030,具体如图10所示。In an optional embodiment, the receiving module 930 can be an input/output interface 1010 in the coprocessing unit, and the processing module 920 and the obtaining module 930 can be a control component 1020 in the coprocessing unit, and the coprocessing unit 1000 further includes a register. The component 1030 is specifically as shown in FIG.
图10是本申请实施例的协处理单元的示意性框图。图10所示的协处理单元1000可以包括输入输出接口1010,控制部件1020和寄存器部件1030。其中,输入输出接口1010,控制部件1020,和寄存器1030通过内部连接通路相连,控制部件用于对指令译码,并且发出为完成每条指令所要执行的各个操作的控制信号,寄存器用于保存指令执行过程中临时存放的寄存器操作数和操作结果,输入输出接口用于接收输入的数据和信息,输出数据操作结果等数据。FIG. 10 is a schematic block diagram of a co-processing unit of an embodiment of the present application. The coprocessing unit 1000 shown in FIG. 10 may include an input and output interface 1010, a control unit 1020, and a register unit 1030. The input/output interface 1010, the control unit 1020, and the register 1030 are connected by an internal connection path, and the control unit is configured to decode the instruction and issue a control signal for each operation to be performed for each instruction, and the register is used to save the instruction. The register operands and operation results temporarily stored during execution, and the input and output interfaces are used to receive input data and information, and output data operation results and other data.
需要说明的是,该寄存器部件中可以包括至少一个寄存器,具体地,寄存器部件可以包括寄存器、专用寄存器和控制寄存器中的至少一种。It should be noted that at least one register may be included in the register component. Specifically, the register component may include at least one of a register, a special register, and a control register.
在实现过程中,该方法的各步骤可以通过计算设备中的硬件的集成逻辑电路或者软件形式的指令完成。结合本申请实施例所公开的方法可以直接体现为硬件协处理单元执行完成,或者用协处理单元中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于计算设备的存储器中,协处理单元读取存储器中的信息,结合其硬件完成该方法的步骤。为避免重复,这里不再详细描述。In the implementation process, the steps of the method may be completed by an integrated logic circuit of hardware in the computing device or an instruction in the form of software. The method disclosed in the embodiment of the present application may be directly implemented as a hardware co-processing unit, or may be performed by a combination of hardware and software modules in the co-processing unit. The software module can be located in a conventional storage medium such as random access memory, flash memory, read only memory, programmable read only memory or electrically erasable programmable memory, registers, and the like. The storage medium is located in a memory of the computing device, and the coprocessing unit reads the information in the memory and completes the steps of the method in conjunction with its hardware. To avoid repetition, it will not be described in detail here.
图11是本申请实施例的处理中断的装置的示意性框图,图11所示的装置1100包括:生成模块1111、处理模块1120和发送模块1130。11 is a schematic block diagram of an apparatus for processing an interrupt according to an embodiment of the present application. The apparatus 1100 shown in FIG. 11 includes: a generating module 1111, a processing module 1120, and a sending module 1130.
生成模块1110,用于生成中断请求;a generating module 1110, configured to generate an interrupt request;
处理模块1120,用于查询中断分发策略确定所述中断请求对应的目标处理单元,所述中断分发策略包括:第一类型的中断请求由中央处理单元CPU处理,第二类型的中断请求由协处理单元处理;The processing module 1120 is configured to query the interrupt distribution policy to determine a target processing unit corresponding to the interrupt request, where the interrupt distribution policy includes: the first type of interrupt request is processed by the central processing unit CPU, and the second type of interrupt request is processed by the co-processing Unit processing
发送模块1130,用于向所述中断请求对应的目标处理单元发送所述中断请求。The sending module 1130 is configured to send the interrupt request to a target processing unit corresponding to the interrupt request.
可选地,作为一个实施例,所述第二类型的中断请求为故障类型的中断请求。Optionally, as an embodiment, the second type of interrupt request is a fault type interrupt request.
在可选的实施例中,该装置1100还可以是中断源1200,具体地,该生成模块1110和处理模块1120可以为控制器1210,所述发送模块1130可以为输入输出接口1220,具体如图12所示。In an optional embodiment, the device 1100 may also be an interrupt source 1200. Specifically, the generating module 1110 and the processing module 1120 may be a controller 1210. The sending module 1130 may be an input/output interface 1220. 12 is shown.
图12是本申请实施例的中断源的示意性框图。图12所示的中断源1200可以包括:控制器1210和输入/输出接口1220。其中,控制器1210和输入/输出接口1220通过内部连接通路相连,该控制器用于控制输入/输出接口接收输入的数据和信息,输出操作结果等数据。FIG. 12 is a schematic block diagram of an interrupt source of an embodiment of the present application. The interrupt source 1200 shown in FIG. 12 may include a controller 1210 and an input/output interface 1220. The controller 1210 and the input/output interface 1220 are connected through an internal connection path for controlling the input/output interface to receive input data and information, and outputting operation results and the like.
需要说明的是,图12所示的控制器1210可以位于中断源内部,还可以理解为对中断源进行控制的控制器,即可以与中断源是两个分离的器件。It should be noted that the controller 1210 shown in FIG. 12 can be located inside the interrupt source, and can also be understood as a controller that controls the interrupt source, that is, two separate devices from the interrupt source.
应理解,在本申请实施例中,“与A相应的B”表示B与A相关联,根据A可以确定B。但还应理解,根据A确定B并不意味着仅仅根据A确定B,还可以根据A和/或其它信息确定B。It should be understood that in the embodiment of the present application, "B corresponding to A" means that B is associated with A, and B can be determined according to A. However, it should also be understood that determining B from A does not mean that B is only determined based on A, and that B can also be determined based on A and/or other information.
应理解,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。It should be understood that the term "and/or" herein is merely an association relationship describing an associated object, indicating that there may be three relationships, for example, A and/or B, which may indicate that A exists separately, and A and B exist simultaneously. There are three cases of B alone. In addition, the character "/" in this article generally indicates that the contextual object is an "or" relationship.
应理解,在本申请的各种实施例中,该各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in the various embodiments of the present application, the size of the sequence numbers of the processes does not mean the order of execution, and the order of execution of each process should be determined by its function and internal logic, and should not be taken to the embodiment of the present application. The implementation process constitutes any limitation.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the unit is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
在该实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括程序代码。在计算机上加载和执行所述程序代码时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(Digital Subscriber Line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够读取的任何可用介质或者是包括一个或多个可用介质集成的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质(例如,数字通用光盘(Digital Video Disc,DVD))或者半导体介质(例如,固态硬盘(Solid State Disk,SSD))等。In this embodiment, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes program code. When the program code is loaded and executed on a computer, the processes or functions described in accordance with embodiments of the present application are generated in whole or in part. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer readable storage medium or transferred from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be from a website site, computer, server or data center Transmission to another website site, computer, server, or data center by wire (eg, coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (eg, infrared, wireless, microwave, etc.). The computer readable storage medium can be any available media that can be read by a computer or a data storage device such as a server, data center, or the like that includes one or more available media. The usable medium may be a magnetic medium (eg, a floppy disk, a hard disk, a magnetic tape), an optical medium (eg, a Digital Video Disc (DVD)), or a semiconductor medium (eg, a Solid State Disk (SSD)). )Wait.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The foregoing is only a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto, and any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application. It should be covered by the scope of protection of this application. Therefore, the scope of protection of the present application should be determined by the scope of the claims.

Claims (24)

  1. 一种处理中断的方法,其特征在于,包括:A method for processing an interrupt, comprising:
    中央处理单元CPU接收中断请求;The central processing unit CPU receives the interrupt request;
    所述CPU获取触发所述中断请求的系统事件;The CPU acquires a system event that triggers the interrupt request;
    所述CPU指示协处理单元处理所述系统事件。The CPU instructs the coprocessing unit to process the system event.
  2. 如权利要求1所述的方法,其特征在于,所述CPU指示所述协处理单元处理所述系统事件,包括:The method of claim 1, wherein the CPU instructs the coprocessing unit to process the system event comprises:
    所述CPU获取所述CPU的当前负载信息;The CPU acquires current load information of the CPU;
    所述CPU在所述当前负载信息所指示的所述CPU的负载高于目标门限时,指示所述协处理单元处理所述系统事件。The CPU instructs the coprocessing unit to process the system event when the load of the CPU indicated by the current load information is higher than a target threshold.
  3. 如权利要求1所述的方法,其特征在于,所述CPU指示所述协处理单元处理所述系统事件,包括:The method of claim 1, wherein the CPU instructs the coprocessing unit to process the system event comprises:
    所述CPU在所述系统事件的类型为目标类型时,指示所述协处理单元处理所述系统事件,所述目标类型指示所述协处理单元处理具有所述目标类型的系统事件。The CPU instructs the coprocessing unit to process the system event when the type of the system event is a target type, the target type instructing the coprocessing unit to process a system event having the target type.
  4. 如权利要求1所述的方法,其特征在于,所述系统事件包括多个子事件,The method of claim 1 wherein said system event comprises a plurality of sub-events,
    所述CPU指示所述协处理单元处理所述系统事件,包括:The CPU instructs the coprocessing unit to process the system event, including:
    所述CPU指示所述协处理单元处理所述多个子事件中的至少一个子事件。The CPU instructs the coprocessing unit to process at least one of the plurality of sub-events.
  5. 如权利要求4所述的方法,其特征在于,在所述CPU指示所述协处理单元处理所述多个子事件中的至少一个子事件之前,所述方法还包括:The method of claim 4, wherein before the CPU instructs the co-processing unit to process at least one of the plurality of sub-events, the method further comprises:
    所述CPU获取所述CPU的当前负载信息;The CPU acquires current load information of the CPU;
    所述CPU在所述当前负载信息所指示的所述CPU的负载高于目标门限时,从所述多个子事件中选择所述至少一个子事件。The CPU selects the at least one sub-event from the plurality of sub-events when a load of the CPU indicated by the current load information is higher than a target threshold.
  6. 如权利要求4所述的方法,其特征在于,在所述CPU指示协处理单元处理所述多个子事件中的至少一个子事件之前,所述方法还包括:The method of claim 4, wherein before the CPU instructs the coprocessing unit to process at least one of the plurality of sub-events, the method further comprises:
    所述CPU从所述多个子事件中选择与目标类型匹配的子事件,所述与目标类型匹配的子事件为所述至少一个子事件,所述目标类型指示所述协处理单元处理具有所述目标类型的子事件。The CPU selects a sub-event matching the target type from the plurality of sub-events, the sub-event matching the target type is the at least one sub-event, the target type indicating that the co-processing unit processing has the Sub-event of the target type.
  7. 如权利要求4至6任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 4 to 6, wherein the method further comprises:
    所述CPU处理所述多个子事件中未指示给所述协处理单元的子事件。The CPU processes a sub-event that is not indicated to the co-processing unit among the plurality of sub-events.
  8. 如权利要求4至7任一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 4 to 7, wherein the method further comprises:
    所述CPU根据所述中断请求进入中断;The CPU enters an interrupt according to the interrupt request;
    所述CPU在处理完所述多个子事件中未指示给所述协处理单元的子事件时,退出所述中断。The CPU exits the interrupt when processing a sub-event that is not indicated to the co-processing unit in the plurality of sub-events.
  9. 一种处理中断的方法,其特征在于,包括:A method for processing an interrupt, comprising:
    中断源生成中断请求;The interrupt source generates an interrupt request;
    所述中断源查询中断分发策略确定所述中断请求对应的目标处理单元,所述中断分发策略包括:第一类型的中断请求由中央处理单元CPU处理,第二类型的中断请求由协处 理单元处理;The interrupt source query interrupt distribution policy determines a target processing unit corresponding to the interrupt request, and the interrupt distribution policy includes: a first type of interrupt request is processed by a central processing unit CPU, and a second type of interrupt request is processed by a coprocessing unit ;
    所述中断源向所述中断请求对应的目标处理单元发送所述中断请求。The interrupt source sends the interrupt request to a target processing unit corresponding to the interrupt request.
  10. 如权利要求9所述的方法,其特征在于,所述第二类型的中断请求为故障类型的中断请求。The method of claim 9 wherein said second type of interrupt request is a fault type interrupt request.
  11. 一种处理中断的装置,其特征在于,包括:A device for processing an interrupt, comprising:
    接收模块,用于接收中断请求;a receiving module, configured to receive an interrupt request;
    处理模块,用于获取触发所述中断请求的系统事件;a processing module, configured to acquire a system event that triggers the interrupt request;
    所述处理模块,用于指示协处理单元处理所述系统事件。The processing module is configured to instruct the coprocessing unit to process the system event.
  12. 如权利要求11所述的装置,其特征在于,所述处理模块,具体用于:The device according to claim 11, wherein the processing module is specifically configured to:
    获取所述CPU的当前负载信息;Obtaining current load information of the CPU;
    在所述当前负载信息所指示的所述CPU的负载高于目标门限时,指示所述协处理单元处理所述系统事件。And when the load of the CPU indicated by the current load information is higher than a target threshold, instructing the coprocessing unit to process the system event.
  13. 如权利要求11所述的装置,其特征在于,所述处理模块,具体用于:The device according to claim 11, wherein the processing module is specifically configured to:
    在所述系统事件的类型为目标类型时,指示所述协处理单元处理所述系统事件,所述目标类型指示所述协处理单元处理具有所述目标类型的系统事件。And when the type of the system event is a target type, instructing the co-processing unit to process the system event, the target type instructing the co-processing unit to process a system event having the target type.
  14. 如权利要求11所述的装置,其特征在于,所述系统事件包括多个子事件,The device of claim 11 wherein said system event comprises a plurality of sub-events,
    所述处理模块,具体用于指示所述协处理单元处理所述多个子事件中的至少一个子事件。The processing module is specifically configured to instruct the coprocessing unit to process at least one of the plurality of sub-events.
  15. 如权利要求14所述的装置,其特征在于,所述处理模块,还用于:The device according to claim 14, wherein the processing module is further configured to:
    获取所述CPU的当前负载信息;Obtaining current load information of the CPU;
    在所述当前负载信息所指示的所述CPU的负载高于目标门限时,从所述多个子事件中选择所述至少一个子事件。The at least one sub-event is selected from the plurality of sub-events when a load of the CPU indicated by the current load information is higher than a target threshold.
  16. 如权利要求14所述的装置,其特征在于,所述处理模块,还用于:The device according to claim 14, wherein the processing module is further configured to:
    从所述多个子事件中选择与目标类型匹配的子事件,所述与目标类型匹配的子事件为所述至少一个子事件,所述目标类型指示所述协处理单元处理具有所述目标类型的子事件。Selecting a sub-event matching the target type from the plurality of sub-events, the sub-event matching the target type being the at least one sub-event, the target type indicating that the co-processing unit processes the target type Sub-event.
  17. 如权利要求14至16任一项所述的装置,其特征在于,所述处理模块,还用于处理所述多个子事件中未指示给所述协处理单元的子事件。The device according to any one of claims 14 to 16, wherein the processing module is further configured to process a sub-event that is not indicated to the co-processing unit among the plurality of sub-events.
  18. 如权利要求14至17任一项所述的装置,其特征在于,所述处理模块,还用于:The device according to any one of claims 14 to 17, wherein the processing module is further configured to:
    根据所述中断请求进入中断;Entering an interrupt according to the interrupt request;
    在处理完所述多个子事件中未指示给所述协处理单元的子事件时,退出所述中断。The interrupt is exited when a sub-event to the co-processing unit is not indicated in the plurality of sub-events.
  19. 一种处理中断的装置,其特征在于,包括:A device for processing an interrupt, comprising:
    生成模块,用于生成中断请求;Generating a module for generating an interrupt request;
    处理模块,用于查询中断分发策略确定所述中断请求对应的目标处理单元,所述中断分发策略包括:第一类型的中断请求由中央处理单元CPU处理,第二类型的中断请求由协处理单元处理;a processing module, configured to query an interrupt distribution policy to determine a target processing unit corresponding to the interrupt request, where the interrupt distribution policy includes: a first type of interrupt request is processed by a central processing unit CPU, and a second type of interrupt request is processed by a coprocessing unit deal with;
    发送模块,用于向所述中断请求对应的目标处理单元发送所述中断请求。And a sending module, configured to send the interrupt request to a target processing unit corresponding to the interrupt request.
  20. 如权利要求19所述的装置,其特征在于,所述第二类型的中断请求为故障类型的中断请求。The apparatus of claim 19 wherein said second type of interrupt request is a fault type interrupt request.
  21. 一种中央处理单元CPU,其特征在于,所述中央处理单元执行程序代码来实现权利要求1-8中任一项所述的方法。A central processing unit CPU, characterized in that the central processing unit executes program code to implement the method of any one of claims 1-8.
  22. 一种中断源,其特征在于,所述中断源执行程序代码来实现权利要求9或10所述的方法。An interrupt source, characterized in that the interrupt source executes program code to implement the method of claim 9 or 10.
  23. 一种计算机可读介质,所述计算机可读介质存储有程序代码;当所述程序代码在计算设备上运行时,使得所述计算设备执行权利要求1-8中任一项所述的方法。A computer readable medium storing program code; when the program code is run on a computing device, causing the computing device to perform the method of any of claims 1-8.
  24. 一种计算机可读介质,所述计算机可读介质存储有程序代码;当所述程序代码在计算设备上运行时,使得所述计算设备执行权利要求9或10中任一项所述的方法。A computer readable medium storing program code; when the program code is run on a computing device, causing the computing device to perform the method of any one of claims 9 or 10.
PCT/CN2018/078331 2018-03-07 2018-03-07 Method and device for processing interrupt WO2019169582A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201880003669.2A CN109791503A (en) 2018-03-07 2018-03-07 Handle the method and apparatus interrupted
PCT/CN2018/078331 WO2019169582A1 (en) 2018-03-07 2018-03-07 Method and device for processing interrupt

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/078331 WO2019169582A1 (en) 2018-03-07 2018-03-07 Method and device for processing interrupt

Publications (1)

Publication Number Publication Date
WO2019169582A1 true WO2019169582A1 (en) 2019-09-12

Family

ID=66500722

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/078331 WO2019169582A1 (en) 2018-03-07 2018-03-07 Method and device for processing interrupt

Country Status (2)

Country Link
CN (1) CN109791503A (en)
WO (1) WO2019169582A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113076213B (en) * 2021-03-30 2022-05-27 山东英信计算机技术有限公司 Method and system for optimizing system management interrupt handling hardware error time
CN114281492A (en) * 2021-11-12 2022-04-05 北京智芯微电子科技有限公司 Interrupt processing method and device, chip, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159765A (en) * 2006-10-06 2008-04-09 英特尔公司 Network interface techniques
CN101246438A (en) * 2008-03-07 2008-08-20 中兴通讯股份有限公司 Process and interrupt processing method and device for symmetrical multiprocessing system
CN101308469A (en) * 2008-07-07 2008-11-19 华为技术有限公司 Soft interruption load balancing realization method and apparatus
CN101354664A (en) * 2008-08-19 2009-01-28 中兴通讯股份有限公司 Method and apparatus for interrupting load equilibrium of multi-core processor

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2987308B2 (en) * 1995-04-28 1999-12-06 松下電器産業株式会社 Information processing device
US6189065B1 (en) * 1998-09-28 2001-02-13 International Business Machines Corporation Method and apparatus for interrupt load balancing for powerPC processors
CN101419278B (en) * 2008-12-05 2011-08-17 航天恒星科技有限公司 Multichannel high speed remote sensing data acquiring and processing device
US10037292B2 (en) * 2015-05-21 2018-07-31 Red Hat Israel, Ltd. Sharing message-signaled interrupt vectors in multi-processor computer systems

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101159765A (en) * 2006-10-06 2008-04-09 英特尔公司 Network interface techniques
CN101246438A (en) * 2008-03-07 2008-08-20 中兴通讯股份有限公司 Process and interrupt processing method and device for symmetrical multiprocessing system
CN101308469A (en) * 2008-07-07 2008-11-19 华为技术有限公司 Soft interruption load balancing realization method and apparatus
CN101354664A (en) * 2008-08-19 2009-01-28 中兴通讯股份有限公司 Method and apparatus for interrupting load equilibrium of multi-core processor

Also Published As

Publication number Publication date
CN109791503A (en) 2019-05-21

Similar Documents

Publication Publication Date Title
US9569398B2 (en) Routing data communications packets in a parallel computer
US8458722B2 (en) Thread selection according to predefined power characteristics during context switching on compute nodes
US8874681B2 (en) Remote direct memory access (‘RDMA’) in a parallel computer
US8436720B2 (en) Monitoring operating parameters in a distributed computing system with active messages
US7552312B2 (en) Identifying messaging completion in a parallel computer by checking for change in message received and transmitted count at each node
US8422402B2 (en) Broadcasting a message in a parallel computer
US20130061238A1 (en) Optimizing the deployment of a workload on a distributed processing system
US7797445B2 (en) Dynamic network link selection for transmitting a message between compute nodes of a parallel computer
US9720676B2 (en) Implementing updates to source code executing on a plurality of compute nodes
US7941681B2 (en) Proactive power management in a parallel computer
US7793139B2 (en) Partial link-down status for virtual Ethernet adapters
US20070165520A1 (en) Port trunking between switches
US9189276B2 (en) Background collective operation management in a parallel computer
WO2019169582A1 (en) Method and device for processing interrupt
US8688831B2 (en) Managing workload distribution among a plurality of compute nodes
US7831866B2 (en) Link failure detection in a parallel computer
US8139595B2 (en) Packet transfer in a virtual partitioned environment
US20130103926A1 (en) Establishing a data communications connection between a lightweight kernel in a compute node of a parallel computer and an input-output ('i/o') node of the parallel computer
JP4852585B2 (en) Computer-implemented method, computer-usable program product, and data processing system for saving energy in multipath data communication
WO2017020572A1 (en) Interrupt processing method, ioapic and computer system
US9588555B2 (en) Managing cooling operations in a parallel computer comprising a plurality of compute nodes

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: 18908853

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18908853

Country of ref document: EP

Kind code of ref document: A1