[go: up one dir, main page]

CN118101480A - Adaptive Interrupt Aggregation Device - Google Patents

Adaptive Interrupt Aggregation Device Download PDF

Info

Publication number
CN118101480A
CN118101480A CN202410341931.1A CN202410341931A CN118101480A CN 118101480 A CN118101480 A CN 118101480A CN 202410341931 A CN202410341931 A CN 202410341931A CN 118101480 A CN118101480 A CN 118101480A
Authority
CN
China
Prior art keywords
interrupt
aggregation
threshold
interrupt aggregation
bandwidth
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202410341931.1A
Other languages
Chinese (zh)
Inventor
余锋
叶程豪
陈渭杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang University ZJU
Original Assignee
Zhejiang University ZJU
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 Zhejiang University ZJU filed Critical Zhejiang University ZJU
Priority to CN202410341931.1A priority Critical patent/CN118101480A/en
Publication of CN118101480A publication Critical patent/CN118101480A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0896Bandwidth or capacity management, i.e. automatically increasing or decreasing capacities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/24Multipath
    • H04L45/245Link aggregation, e.g. trunking

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种自适应中断聚合装置,包含:带宽检测模块,用于检测用以产生中断请求的数据帧的平均带宽;中断聚合参数配置模块,用于接收带宽检测模块发送的平均带宽,并基于平均带宽和处理器的可接受带宽范围得到中断聚合阈值;中断聚合判断模块,用于接收中断请求,并基于中断聚合参数配置模块发送的中断聚合阈值判断是否对中断请求进行聚合。本发明的自适应中断聚合装置,能够基于实时检测的带宽和处理器的处理能力,自主对中断聚合的阈值做出准确、合理的设定,从而使整个中断聚合机制具备了根据前级数据带宽变化,动态调整中断聚合阈值的能力。

The present invention discloses an adaptive interrupt aggregation device, comprising: a bandwidth detection module, used to detect the average bandwidth of a data frame used to generate an interrupt request; an interrupt aggregation parameter configuration module, used to receive the average bandwidth sent by the bandwidth detection module, and obtain an interrupt aggregation threshold based on the average bandwidth and the acceptable bandwidth range of the processor; an interrupt aggregation judgment module, used to receive an interrupt request, and judge whether to aggregate the interrupt request based on the interrupt aggregation threshold sent by the interrupt aggregation parameter configuration module. The adaptive interrupt aggregation device of the present invention can independently make accurate and reasonable settings for the interrupt aggregation threshold based on the real-time detected bandwidth and the processing power of the processor, so that the entire interrupt aggregation mechanism has the ability to dynamically adjust the interrupt aggregation threshold according to the change of the previous data bandwidth.

Description

自适应中断聚合装置Adaptive Interrupt Aggregation Device

技术领域Technical Field

本发明涉及一种自适应中断聚合装置。The invention relates to an adaptive interrupt aggregation device.

背景技术Background technique

中断作为软硬件交互的一种机制,常常应用于数据传输的场景中。在具体地,数据由硬件进行接收,当达到一定的数据量时,硬件就会通过递交中断的方式来通知软件取走数据。硬件递交中断请求的频率与其接收数据的带宽挂钩,数据带宽较高时中断请求较多,数据带宽较低时中断请求较少,频繁的中断请求将降低处理器的性能,一般需要通过中断聚合的方式来减少单位时间内产生的中断数量。As a mechanism for hardware-software interaction, interrupts are often used in data transmission scenarios. Specifically, data is received by hardware. When a certain amount of data is reached, the hardware will notify the software to take the data by submitting an interrupt. The frequency of hardware submitting interrupt requests is linked to the bandwidth of the data it receives. When the data bandwidth is high, there are more interrupt requests, and when the data bandwidth is low, there are fewer interrupt requests. Frequent interrupt requests will reduce the performance of the processor. Generally, interrupt aggregation is required to reduce the number of interrupts generated per unit time.

中断聚合,是指将连续的多个中断事件合并为一个中断请求,而后统一发送给后端处理器进行处理的方式。这种方式可以有效地减少中断的请求次数,降低处理器的负载,提高其处理效率。常用的中断聚合的实现方式,一般是采用定时器或计数器。前者对系统时钟的跳变沿进行计数,后者则是对接收到的中断请求进行计数,当计数值达到预设的阈值时,就会产生相应的中断,同时计数值清零,重新开始计数。Interrupt aggregation refers to the method of combining multiple consecutive interrupt events into one interrupt request, and then sending them to the back-end processor for processing. This method can effectively reduce the number of interrupt requests, reduce the processor load, and improve its processing efficiency. Common interrupt aggregation implementation methods generally use timers or counters. The former counts the transition edges of the system clock, while the latter counts the received interrupt requests. When the count value reaches the preset threshold, a corresponding interrupt will be generated, and the count value will be reset to zero and count will start again.

由此可见,中断聚合的阈值设定是整个中断聚合机制中的重要一环,如果中断聚合的阈值设置过高,即聚合的中断请求过多,会导致处理器接收中断的频率过低,进而导致处理任务的延迟增大,而这对于某些强调高实时性、低延迟的系统来说是不可接受的;如果中断聚合的阈值设置过低,即聚合的中断请求过少,就无法有效起到减少中断请求次数,降低处理器负载的目的。It can be seen that the threshold setting of interrupt aggregation is an important part of the entire interrupt aggregation mechanism. If the threshold of interrupt aggregation is set too high, that is, there are too many interrupt requests aggregated, the processor will receive interrupts too low frequently, which will lead to increased delays in processing tasks, which is unacceptable for some systems that emphasize high real-time performance and low latency. If the threshold of interrupt aggregation is set too low, that is, there are too few interrupt requests aggregated, it will not be able to effectively reduce the number of interrupt requests and reduce the processor load.

通常情况下,中断聚合的阈值是固定不变的。对于一个数据带宽稳定,处理器性能稳定的系统来说,根据实际情况设定一个合适的中断聚合阈值就可以保证整个系统的工作效率。但当数据带宽存在较大波动或处理器上运行的程序处于动态变化时,固定的中断聚合阈值显然不能满足系统对于工作性能以及效率的要求。Normally, the interrupt aggregation threshold is fixed. For a system with stable data bandwidth and stable processor performance, setting a suitable interrupt aggregation threshold according to the actual situation can ensure the working efficiency of the entire system. However, when the data bandwidth fluctuates greatly or the program running on the processor is in dynamic change, the fixed interrupt aggregation threshold obviously cannot meet the system's requirements for working performance and efficiency.

发明内容Summary of the invention

本发明提供了一种自适应中断聚合装置解决上述提到的技术问题,具体采用如下的技术方案:The present invention provides an adaptive interrupt aggregation device to solve the above-mentioned technical problems, and specifically adopts the following technical solutions:

一种自适应中断聚合装置,其特征在于,包含:An adaptive interrupt aggregation device, characterized by comprising:

带宽检测模块,用于检测用以产生中断请求的数据帧的平均带宽;A bandwidth detection module, used for detecting an average bandwidth of a data frame used to generate an interrupt request;

中断聚合参数配置模块,用于接收所述带宽检测模块发送的平均带宽,并基于所述平均带宽和处理器的可接受带宽范围得到中断聚合阈值;An interrupt aggregation parameter configuration module, configured to receive the average bandwidth sent by the bandwidth detection module, and obtain an interrupt aggregation threshold based on the average bandwidth and an acceptable bandwidth range of the processor;

中断聚合判断模块,用于接收中断请求,并基于所述中断聚合参数配置模块发送的中断聚合阈值判断是否对所述中断请求进行聚合。The interrupt aggregation judgment module is used to receive an interrupt request and judge whether to aggregate the interrupt request based on the interrupt aggregation threshold sent by the interrupt aggregation parameter configuration module.

进一步地,所述带宽检测模块每接收一个完整的数据帧时,记录数据帧的长度以及消耗的时钟周期数,当记录的总数据帧长度达到预设的数据量阈值时,根据所述总数据帧长度和总时钟周期数得到当前数据流的所述平均带宽,并将所述平均带宽发送至所述中断聚合参数配置模块。Furthermore, each time the bandwidth detection module receives a complete data frame, it records the length of the data frame and the number of clock cycles consumed. When the total recorded data frame length reaches a preset data volume threshold, the average bandwidth of the current data stream is obtained based on the total data frame length and the total number of clock cycles, and the average bandwidth is sent to the interrupt aggregation parameter configuration module.

进一步地,所述数据量阈值小于产生一次中断请求所需的数据量。Furthermore, the data volume threshold is smaller than the data volume required to generate an interrupt request.

进一步地,所述中断聚合参数配置模块将所述平均带宽与处理器的可接受带宽范围进行比较,若所述平均带宽小于等于所述可接受带宽范围的最大值,则所述中断聚合阈值设定为1,若所述平均带宽大于所述可接受带宽范围的最大值,则将所述平均带宽分别除以所述可接受带宽范围的最小值和最大值,并在这两个计算结果之间取最大整数作为所述中断聚合阈值,最后将所述中断聚合阈值发送至所述中断聚合判断模块。Furthermore, the interrupt aggregation parameter configuration module compares the average bandwidth with the acceptable bandwidth range of the processor. If the average bandwidth is less than or equal to the maximum value of the acceptable bandwidth range, the interrupt aggregation threshold is set to 1. If the average bandwidth is greater than the maximum value of the acceptable bandwidth range, the average bandwidth is divided by the minimum value and the maximum value of the acceptable bandwidth range respectively, and the maximum integer between the two calculation results is taken as the interrupt aggregation threshold. Finally, the interrupt aggregation threshold is sent to the interrupt aggregation judgment module.

进一步地,所述中断聚合判断模块接收中断请求并对其进行计数,根据所述中断聚合阈值进行中断聚合判断,若中断请求的计数值大于等于所述中断聚合的阈值,则向后级处理器递交中断请求,若中断请求的计数值小于所述中断聚合的阈值,则继续进行中断聚合。Furthermore, the interrupt aggregation judgment module receives interrupt requests and counts them, and performs interrupt aggregation judgment based on the interrupt aggregation threshold. If the count value of the interrupt request is greater than or equal to the interrupt aggregation threshold, the interrupt request is submitted to the subsequent processor; if the count value of the interrupt request is less than the interrupt aggregation threshold, interrupt aggregation continues.

进一步地,所述中断聚合判断模块根据接收到的最新的所述中断聚合阈值进行中断聚合判断。Furthermore, the interruption aggregation determination module performs interruption aggregation determination according to the latest interruption aggregation threshold received.

进一步地,在所述中断聚合判断模块根据接收到的最新的所述中断聚合阈值进行中断聚合判断时,若基于上一个旧的所述中断聚合阈值的中断聚合刚好完成,则直接更新阈值,若基于上一个旧的所述中断聚合阈值的中断聚合尚未完成,则根据新的所述中断聚合阈值进行判定。Furthermore, when the interrupt aggregation judgment module performs interrupt aggregation judgment based on the latest interrupt aggregation threshold received, if the interrupt aggregation based on the previous old interrupt aggregation threshold has just been completed, the threshold is directly updated; if the interrupt aggregation based on the previous old interrupt aggregation threshold has not been completed, the judgment is performed based on the new interrupt aggregation threshold.

进一步地,在所述中断聚合判断模块根据接收到的最新的所述中断聚合阈值进行中断聚合判断时,若基于上一个旧的所述中断聚合阈值的中断聚合尚未完成,则暂存新接收到的所述中断聚合阈值,待接收到新的中断请求时,将当前中断请求的计数值与暂存的新的所述中断聚合阈值进行对比,若新的所述中断聚合阈值大于当前中断请求的计数值,则更新阈值并继续进行中断聚合,若新的所述中断聚合阈值小于等于当前中断请求的计数值,则向后级处理器递交中断请求,而后更新阈值并继续进行中断聚合。Furthermore, when the interrupt aggregation judgment module performs interrupt aggregation judgment based on the latest interrupt aggregation threshold received, if the interrupt aggregation based on the previous old interrupt aggregation threshold has not been completed, the newly received interrupt aggregation threshold is temporarily stored, and when a new interrupt request is received, the count value of the current interrupt request is compared with the temporarily stored new interrupt aggregation threshold. If the new interrupt aggregation threshold is greater than the count value of the current interrupt request, the threshold is updated and interrupt aggregation continues. If the new interrupt aggregation threshold is less than or equal to the count value of the current interrupt request, the interrupt request is submitted to the post-processor, and then the threshold is updated and interrupt aggregation continues.

进一步地,所述自适应中断聚合装置还包含:Furthermore, the adaptive interrupt aggregation device further comprises:

定时器判断模块,用于限定所述中断聚合判断模块的最大聚合时间。The timer judgment module is used to limit the maximum aggregation time of the interrupt aggregation judgment module.

进一步地,所述定时器判断模块统计一个中断聚合周期内的中断聚合时间,在所述中断聚合判断模块接收到前级中断并开启所述中断聚合周期时,所述定时器判断模块同步开始对所述中断聚合时间进行统计,若所述中断聚合判断模块在所述中断聚合时间超过预设的所述最大聚合时间时还未发送中断请求,则强制直接发送中断请求。Furthermore, the timer judgment module counts the interrupt aggregation time within an interrupt aggregation cycle. When the interrupt aggregation judgment module receives a previous-level interrupt and starts the interrupt aggregation cycle, the timer judgment module synchronously starts to count the interrupt aggregation time. If the interrupt aggregation judgment module has not sent an interrupt request when the interrupt aggregation time exceeds the preset maximum aggregation time, the interrupt request is forced to be sent directly.

本发明的有益之处在于所提供的自适应中断聚合装置,能够基于实时检测的带宽和处理器的处理能力,自主对中断聚合的阈值做出准确、合理的设定,从而使整个中断聚合机制具备了根据前级数据带宽变化,动态调整中断聚合阈值的能力。The benefit of the present invention lies in that the adaptive interrupt aggregation device provided can independently make accurate and reasonable settings for the interrupt aggregation threshold based on the real-time detected bandwidth and the processing power of the processor, thereby enabling the entire interrupt aggregation mechanism to have the ability to dynamically adjust the interrupt aggregation threshold according to changes in the previous-stage data bandwidth.

本发明的有益之处还在于所提供的自适应中断聚合装置,还并行使用了定时器超时机制,以避免出现前级数据传输中断,中断聚合尚未完成而无法产生中断的情况。The invention is also beneficial in that the provided adaptive interrupt aggregation device also uses a timer timeout mechanism in parallel to avoid the situation where the previous data transmission is interrupted and the interrupt aggregation is not completed and an interrupt cannot be generated.

附图说明BRIEF DESCRIPTION OF THE DRAWINGS

为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

图1为本发明的一种自适应中断聚合装置的示意图;FIG1 is a schematic diagram of an adaptive interrupt aggregation device of the present invention;

图2为本发明的一种自适应中断聚合装置的数据带宽检测以及阈值设定的示意图;FIG2 is a schematic diagram of data bandwidth detection and threshold setting of an adaptive interrupt aggregation device of the present invention;

图3为本发明的一种自适应中断聚合装置的数据带宽检测以及阈值设定的流程图;FIG3 is a flow chart of data bandwidth detection and threshold setting of an adaptive interrupt aggregation device of the present invention;

图4为本发明的一种自适应中断聚合装置的中断聚合的流程图;FIG4 is a flow chart of interrupt aggregation of an adaptive interrupt aggregation device according to the present invention;

具体实施方式Detailed ways

下面详细描述本申请的实施例,实施例的示例在附图中示出,其中自始至终相同或类似的标号表示相同或类似的元件或具有相同或类似功能的元件。下面通过参考附图描述的实施例是示例性的,旨在用于解释本申请,而不能理解为对本申请的限制。The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.

如图1所示为本申请的一种自适应中断聚合装置,包含:带宽检测模块、中断聚合参数配置模块、中断聚合判断模块和定时器判断模块。As shown in FIG. 1 , an adaptive interrupt aggregation device of the present application includes: a bandwidth detection module, an interrupt aggregation parameter configuration module, an interrupt aggregation judgment module and a timer judgment module.

带宽检测模块用于检测用以产生中断请求的数据帧的平均带宽。中断聚合参数配置模块用于接收带宽检测模块发送的平均带宽,并基于平均带宽和处理器提供的可接受带宽范围得到中断聚合阈值。中断聚合判断模块用于接收中断请求,并基于中断聚合参数配置模块发送的中断聚合阈值判断是否对中断请求进行聚合。在本申请的实施方式中,中断聚合判断模块包含中断缓存模块,用于缓存接收到的中断请求。(为便于绘制各模块间的关系,图1中将中断缓存模块在框图中单独列出。)定时器判断模块用于限定中断聚合判断模块的最大聚合时间。如图2所示,数据帧进入带宽检测环节进行带宽检测后,就会发往后级进行相应的数据处理,最后产生用于后续中断聚合的中断请求。而当进行带宽检测的数据量达到所需的数据量阈值时,当前的数据带宽就会被计算出来,并与处理器提供的可接受带宽范围一起计算获得中断聚合的阈值。The bandwidth detection module is used to detect the average bandwidth of the data frame used to generate the interrupt request. The interrupt aggregation parameter configuration module is used to receive the average bandwidth sent by the bandwidth detection module, and obtain the interrupt aggregation threshold value based on the average bandwidth and the acceptable bandwidth range provided by the processor. The interrupt aggregation judgment module is used to receive the interrupt request, and judge whether to aggregate the interrupt request based on the interrupt aggregation threshold value sent by the interrupt aggregation parameter configuration module. In the embodiment of the present application, the interrupt aggregation judgment module includes an interrupt cache module for caching the received interrupt request. (In order to facilitate the drawing of the relationship between the modules, the interrupt cache module is listed separately in the block diagram in FIG1.) The timer judgment module is used to limit the maximum aggregation time of the interrupt aggregation judgment module. As shown in FIG2, after the data frame enters the bandwidth detection link for bandwidth detection, it will be sent to the subsequent stage for corresponding data processing, and finally generate an interrupt request for subsequent interrupt aggregation. When the amount of data for bandwidth detection reaches the required data amount threshold, the current data bandwidth will be calculated, and the threshold of interrupt aggregation will be calculated together with the acceptable bandwidth range provided by the processor.

以下结合图3和图4的流程图对本申请的自适应中断聚合装置进行详细说明。The adaptive interrupt aggregation device of the present application is described in detail below in conjunction with the flowcharts of FIG. 3 and FIG. 4 .

在本申请的实施方式中,带宽检测模块在接收到用于产生中断请求的第一个数据帧时便会启动并开始对时钟周期进行计数,进而进行带宽检测。每接收一个完整的数据帧,带宽检测记录的数据量就会增加相应的数据帧长度。记录数据帧的长度以及消耗的时钟周期数,当记录的总数据帧长度达到预设的数据量阈值时,对于时钟周期的计数将会停止,从而获得当前数据量传输完毕所消耗的总时钟周期数。根据总数据帧长度和总时钟周期数的比值得到当前数据流的平均带宽,并将平均带宽发送至中断聚合参数配置模块。In an embodiment of the present application, the bandwidth detection module starts and begins counting clock cycles when receiving the first data frame for generating an interrupt request, and then performs bandwidth detection. Each time a complete data frame is received, the amount of data recorded by the bandwidth detection will increase the corresponding data frame length. The length of the data frame and the number of clock cycles consumed are recorded. When the total recorded data frame length reaches the preset data volume threshold, the counting of the clock cycles will stop, thereby obtaining the total number of clock cycles consumed by the current data volume to be transmitted. The average bandwidth of the current data stream is obtained based on the ratio of the total data frame length and the total number of clock cycles, and the average bandwidth is sent to the interrupt aggregation parameter configuration module.

在初始化配置完成后,带宽检测所需的数据量阈值需设置合理,即带宽检测所需的数据量阈值要小于产生一次中断请求所需的数据量,从而保证了阈值的初始设定会在第一次前级的中断请求到来之前。这个数据量阈值可以是一个确定的数据量,如4MB。也可以是接收的数据帧长度的整数倍,如数据帧的大小为64KB,比例值为1/64,则阈值为4MB。After the initialization configuration is completed, the data volume threshold required for bandwidth detection must be set reasonably, that is, the data volume threshold required for bandwidth detection must be less than the data volume required to generate an interrupt request, thereby ensuring that the initial setting of the threshold will be before the first interrupt request from the previous level arrives. This data volume threshold can be a certain data volume, such as 4MB. It can also be an integer multiple of the length of the received data frame. For example, if the size of the data frame is 64KB and the ratio value is 1/64, the threshold is 4MB.

在本申请的实施方式中,中断聚合参数配置模块将平均带宽与处理器的可接受带宽范围进行比较,若平均带宽小于等于可接受带宽范围的最大值,则中断聚合阈值设定为1,即默认不进行聚合操作。若平均带宽大于可接受带宽范围的最大值,则将平均带宽分别除以可接受带宽范围的最小值和最大值,并在这两个计算结果之间取最大整数作为中断聚合阈值,最后将中断聚合阈值发送至中断聚合判断模块。完成上述操作后,数据量的计数值、计数所用的时钟周期数均会被清零,并启动下一轮的带宽检测。In the implementation mode of the present application, the interrupt aggregation parameter configuration module compares the average bandwidth with the acceptable bandwidth range of the processor. If the average bandwidth is less than or equal to the maximum value of the acceptable bandwidth range, the interrupt aggregation threshold is set to 1, that is, the aggregation operation is not performed by default. If the average bandwidth is greater than the maximum value of the acceptable bandwidth range, the average bandwidth is divided by the minimum and maximum values of the acceptable bandwidth range respectively, and the maximum integer between the two calculation results is taken as the interrupt aggregation threshold, and finally the interrupt aggregation threshold is sent to the interrupt aggregation judgment module. After completing the above operations, the count value of the data volume and the number of clock cycles used for counting will be cleared, and the next round of bandwidth detection will be started.

在本申请的实施方式中,中断聚合判断模块接收中断请求并对其进行计数,根据中断聚合阈值进行中断聚合判断,若中断请求的计数值大于等于中断聚合的阈值,则向后级处理器递交中断请求,若中断请求的计数值小于中断聚合的阈值,则继续进行中断聚合。递交中断请求之后清零该计数值,重新开始计数。In the implementation of the present application, the interrupt aggregation judgment module receives interrupt requests and counts them, and performs interrupt aggregation judgment according to the interrupt aggregation threshold. If the count value of the interrupt request is greater than or equal to the interrupt aggregation threshold, the interrupt request is submitted to the subsequent processor. If the count value of the interrupt request is less than the interrupt aggregation threshold, interrupt aggregation continues. After submitting the interrupt request, the count value is cleared and the counting starts again.

在本申请的实施方式中,中断聚合判断模块根据接收到的最新的中断聚合阈值进行中断聚合判断,进一步保证阈值更新频率不会落后于数据带宽变化。In an implementation manner of the present application, the interruption aggregation determination module performs interruption aggregation determination according to the latest interruption aggregation threshold received, further ensuring that the threshold update frequency does not lag behind the data bandwidth change.

在本申请的实施方式中,在中断聚合判断模块根据接收到的最新的中断聚合阈值进行中断聚合判断时,若基于上一个旧的中断聚合阈值的中断聚合刚好完成,则直接更新阈值。若基于上一个旧的中断聚合阈值的中断聚合尚未完成,则根据新的中断聚合阈值进行判定。具体地,在中断聚合判断模块根据接收到的最新的中断聚合阈值进行中断聚合判断时,若基于上一个旧的中断聚合阈值的中断聚合尚未完成,则暂存新接收到的中断聚合阈值。待接收到前级发来的新的中断请求时,将当前中断请求的计数值与暂存的新的中断聚合阈值进行对比。若新的中断聚合阈值大于当前中断请求的计数值,则更新阈值并继续进行中断聚合,若新的中断聚合阈值小于等于当前中断请求的计数值,则向后级处理器递交中断请求,而后更新阈值并继续进行中断聚合。In an embodiment of the present application, when the interrupt aggregation judgment module performs interrupt aggregation judgment according to the latest interrupt aggregation threshold value received, if the interrupt aggregation based on the previous old interrupt aggregation threshold value has just been completed, the threshold value is directly updated. If the interrupt aggregation based on the previous old interrupt aggregation threshold value has not been completed, the judgment is made according to the new interrupt aggregation threshold value. Specifically, when the interrupt aggregation judgment module performs interrupt aggregation judgment according to the latest interrupt aggregation threshold value received, if the interrupt aggregation based on the previous old interrupt aggregation threshold value has not been completed, the newly received interrupt aggregation threshold value is temporarily stored. When a new interrupt request sent from the previous level is received, the count value of the current interrupt request is compared with the temporarily stored new interrupt aggregation threshold value. If the new interrupt aggregation threshold value is greater than the count value of the current interrupt request, the threshold value is updated and interrupt aggregation is continued. If the new interrupt aggregation threshold value is less than or equal to the count value of the current interrupt request, the interrupt request is submitted to the subsequent processor, and then the threshold value is updated and interrupt aggregation is continued.

在本申请的实施方式中,定时器判断模块统计一个中断聚合周期内的中断聚合时间。所谓中断聚合周期是中断聚合判断模块执行一次中断的时间。在中断聚合判断模块接收到前级中断并开启所述中断聚合周期时,定时器判断模块同步开始对中断聚合时间进行统计,若中断聚合判断模块在中断聚合时间超过预设的最大聚合时间时还未发送中断请求,则强制直接发送中断请求。具体而言,初始化配置完成后,定时器就处于就绪状态,设定的最大聚合时间一般远大于中断聚合所需的时间。当中断聚合判断模块接收到第一个前级发来的中断请求时,定时器就会启动,在定时器尚未超时前,若中断聚合完成并向后级递交中断请求,则定时器清零并重新开始计时;若中断聚合未完成,则强制产生并递交中断请求,而后定时器清零,待装置再次接收到前级发来中断请求时重新开始计时,如此循环往复。定时机制的存在是为了确保当出现数据传输停止,中断产生异常等突发现象而导致中断聚合无法完成时,装置仍可以向后级递交中断请求。In the implementation of the present application, the timer judgment module counts the interrupt aggregation time within an interrupt aggregation cycle. The so-called interrupt aggregation cycle is the time for the interrupt aggregation judgment module to execute an interrupt. When the interrupt aggregation judgment module receives the previous interrupt and starts the interrupt aggregation cycle, the timer judgment module starts to count the interrupt aggregation time synchronously. If the interrupt aggregation judgment module has not sent an interrupt request when the interrupt aggregation time exceeds the preset maximum aggregation time, the interrupt request is forced to be sent directly. Specifically, after the initialization configuration is completed, the timer is in a ready state, and the set maximum aggregation time is generally much longer than the time required for interrupt aggregation. When the interrupt aggregation judgment module receives the first interrupt request sent by the previous level, the timer will start. Before the timer times out, if the interrupt aggregation is completed and the interrupt request is submitted to the next level, the timer is cleared and the timing is restarted; if the interrupt aggregation is not completed, the interrupt request is forced to be generated and submitted, and then the timer is cleared, and the timing is restarted when the device receives the interrupt request from the previous level again, and so on. The timing mechanism exists to ensure that when the interrupt aggregation cannot be completed due to sudden phenomena such as data transmission stopping and interruption generating abnormalities, the device can still submit an interrupt request to the next level.

以上显示和描述了本发明的基本原理、主要特征和优点。本行业的技术人员应该了解,上述实施例不以任何形式限制本发明,凡采用等同替换或等效变换的方式所获得的技术方案,均落在本发明的保护范围内。The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any form, and any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.

Claims (10)

1. An adaptive interrupt coalescing apparatus, comprising:
A bandwidth detection module for detecting an average bandwidth of data frames used for generating an interrupt request;
The interrupt aggregation parameter configuration module is used for receiving the average bandwidth sent by the bandwidth detection module and obtaining an interrupt aggregation threshold value based on the average bandwidth and the acceptable bandwidth range of the processor;
And the interrupt aggregation judging module is used for receiving the interrupt request and judging whether to aggregate the interrupt request based on the interrupt aggregation threshold value sent by the interrupt aggregation parameter configuration module.
2. The adaptive interrupt coalescing device of claim 1 wherein,
And when the length of the recorded total data frame reaches a preset data quantity threshold value, obtaining the average bandwidth of the current data stream according to the total data frame length and the total clock cycle number, and transmitting the average bandwidth to the interrupt aggregation parameter configuration module.
3. The adaptive interrupt coalescing device of claim 2 wherein,
The data amount threshold is smaller than the amount of data required to generate an interrupt request.
4. The adaptive interrupt coalescing device of claim 1 wherein,
The interrupt aggregation parameter configuration module compares the average bandwidth with an acceptable bandwidth range of a processor, if the average bandwidth is smaller than or equal to the maximum value of the acceptable bandwidth range, the interrupt aggregation threshold is set to be 1, if the average bandwidth is larger than the maximum value of the acceptable bandwidth range, the average bandwidth is divided by the minimum value and the maximum value of the acceptable bandwidth range respectively, the maximum integer is taken as the interrupt aggregation threshold between the two calculation results, and finally the interrupt aggregation threshold is sent to the interrupt aggregation judgment module.
5. The adaptive interrupt coalescing device of claim 1 wherein,
The interrupt aggregation judging module receives and counts the interrupt requests, carries out interrupt aggregation judgment according to the interrupt aggregation threshold, submits the interrupt requests to a later processor if the count value of the interrupt requests is greater than or equal to the interrupt aggregation threshold, and continues to carry out interrupt aggregation if the count value of the interrupt requests is less than the interrupt aggregation threshold.
6. The adaptive interrupt coalescing device of claim 5 wherein,
And the interrupt aggregation judgment module judges interrupt aggregation according to the received latest interrupt aggregation threshold.
7. The adaptive interrupt coalescing device of claim 6 wherein,
When the interrupt aggregation judgment module judges interrupt aggregation according to the received latest interrupt aggregation threshold, if interrupt aggregation based on the last old interrupt aggregation threshold is just completed, the threshold is directly updated, and if interrupt aggregation based on the last old interrupt aggregation threshold is not completed, judgment is carried out according to the new interrupt aggregation threshold.
8. The adaptive interrupt coalescing device of claim 7 wherein,
And when the interrupt aggregation judgment module judges the interrupt aggregation according to the received latest interrupt aggregation threshold, if the interrupt aggregation based on the last old interrupt aggregation threshold is not completed yet, temporarily storing the newly received interrupt aggregation threshold, when a new interrupt request is received, comparing the count value of the current interrupt request with the temporarily stored new interrupt aggregation threshold, if the new interrupt aggregation threshold is larger than the count value of the current interrupt request, updating the threshold and continuing to perform interrupt aggregation, and if the new interrupt aggregation threshold is smaller than or equal to the count value of the current interrupt request, submitting the interrupt request to a rear-stage processor, and then updating the threshold and continuing to perform interrupt aggregation.
9. The adaptive interrupt coalescing device of claim 1 wherein,
The adaptive interrupt aggregation device further includes:
And the timer judging module is used for limiting the maximum aggregation time of the interrupt aggregation judging module.
10. The adaptive interrupt coalescing device of claim 9 wherein,
The timer judging module counts the interrupt aggregation time in an interrupt aggregation period, when the interrupt aggregation judging module receives a previous interrupt and starts the interrupt aggregation period, the timer judging module synchronously starts counting the interrupt aggregation time, and if the interrupt aggregation judging module does not send an interrupt request when the interrupt aggregation time exceeds the preset maximum aggregation time, the interrupt request is forced to be directly sent.
CN202410341931.1A 2024-03-25 2024-03-25 Adaptive Interrupt Aggregation Device Pending CN118101480A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410341931.1A CN118101480A (en) 2024-03-25 2024-03-25 Adaptive Interrupt Aggregation Device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410341931.1A CN118101480A (en) 2024-03-25 2024-03-25 Adaptive Interrupt Aggregation Device

Publications (1)

Publication Number Publication Date
CN118101480A true CN118101480A (en) 2024-05-28

Family

ID=91158527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410341931.1A Pending CN118101480A (en) 2024-03-25 2024-03-25 Adaptive Interrupt Aggregation Device

Country Status (1)

Country Link
CN (1) CN118101480A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119376952A (en) * 2024-12-24 2025-01-28 苏州元脑智能科技有限公司 A heterogeneous acceleration system, method, computing device and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN119376952A (en) * 2024-12-24 2025-01-28 苏州元脑智能科技有限公司 A heterogeneous acceleration system, method, computing device and storage medium

Similar Documents

Publication Publication Date Title
US8112555B2 (en) Peripheral adapter interrupt frequency control by estimating processor load at the peripheral adapter
CN112511456B (en) Flow control method, apparatus, device, storage medium, and computer program product
CN111813548A (en) A resource scheduling method, device, electronic device and storage medium
CN118101480A (en) Adaptive Interrupt Aggregation Device
CN116684659B (en) Video output control module, method, equipment and server of BMC chip
CN111008157B (en) Storage system write cache data issuing method and related components
US20080147905A1 (en) Method and system for generating a DMA controller interrupt
US11734183B2 (en) Method and apparatus for controlling data flow in storage device, storage device, and storage medium
CN105516024A (en) Queue-based task flow monitoring method and system
CN116225198B (en) A CPU load control method and system
CN117097679B (en) A network interruption aggregation method, device and network communication equipment
US12147676B1 (en) Data storage system with dynamic adjustment of polling intervals
JP2025515469A (en) Data transmission method, data transmission device, storage medium, and electronic device
WO2025044642A1 (en) Software bypass implementation method and apparatus, and storage medium
CN101241451A (en) A serial port reliable communication control method for embedded systems
CN109274550B (en) iSCSI self-adaptive IO queue depth matching method
CN103117958B (en) Network data packet aggregation method, system and device
CN113242434B (en) A video compression method and related device
CN117354254B (en) Combined interrupt control method and device based on LRO timeout and interrupt ITR timeout
CN102760079B (en) Adaptive interrupt control method and device for mobile application processor
US20160342540A1 (en) Low latency memory and bus frequency scaling based upon hardware monitoring
EP3328009A1 (en) Method, device, and apparatus for detecting message backpressure
CN106685719A (en) A network card performance optimization method and system
CN115686863A (en) Hybrid polling method, device, equipment and readable storage medium
JP2001331329A (en) Interrupt control device and interrupt control method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination