Performance monitoring method, device and equipment of input / output card and storage medium

By obtaining speed data in the submission queue and completion queue of the input and output card, and generating performance monitoring results, the problem of easy introduction of errors in modifying drivers in the prior art is solved, and high-reliability performance monitoring is achieved.

CN119718193AActive Publication Date: 2025-03-28INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411774708.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-28
Estimated Expiration
2044-12-04

AI Technical Summary

Technical Problem

When monitoring the performance of input and output cards, the driver needs to be modified, which can easily introduce errors, affect the normal operation of the card, and even cause the card to be unavailable or downtime.

Method used

By obtaining the command writing speed of the host in the submission queue and the command reading speed of the input and output card in the submission queue, and obtaining the result writing speed of the input and output card in the completion queue and the result reading speed of the host in the completion queue, the performance monitoring results are generated based on the speed difference, and the driver has not been modified.

Benefits of technology

Reduces error introduction, improves reliability of performance monitoring, avoids potential problems due to driver modifications, and reduces workload.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718193A_ABST
    Figure CN119718193A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of equipment performance monitoring, and discloses a performance monitoring method and device for an input / output card, equipment and a storage medium, the input / output card comprises a submission queue and a completion queue, and the submission queue is used for storing commands issued by a host to the input / output card; the completion queue is used for storing command execution results returned to the host by the input / output card; the method comprises the following steps: acquiring a command writing speed of a host in a submission queue and a command reading speed of an input / output card in the submission queue; obtaining a result writing speed of the input / output card in the completion queue and a result reading speed of the host in the completion queue; and generating a performance monitoring result of the input / output card according to a first speed difference between the command writing speed and the command reading speed and a second speed difference between the result writing speed and the result reading speed. The reliability is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of equipment performance monitoring, and in particular to a performance monitoring method, device, equipment and storage medium for an input / output card. Background Art

[0002] Input / output cards, also called I / O cards, are mainly used for data transmission between the host and external devices. Among them, external devices may include but are not limited to storage devices, disk drives, etc. Input / output cards may include but are not limited to SAS cards, FC cards, network cards, RoCE cards, etc. Since the input / output card is located between the host and the external device, the performance of the input / output card directly affects the data transmission efficiency between the host and the external device. Therefore, it is necessary to monitor the performance of the input / output card.

[0003] At present, in some technologies, when monitoring the performance of the input / output card, the driver of the input / output card needs to be modified. If the modified driver introduces errors, it will affect the normal operation of the input / output card, and may even cause the input / output card to become unavailable, shut down, or restart.

[0004] Therefore, a performance monitoring method with high reliability is urgently needed. Summary of the invention

[0005] In view of this, the present disclosure provides a performance monitoring method for an input / output card, a performance monitoring device for an input / output card, an electronic device, and a computer-readable storage medium, which can reduce error introduction and improve the reliability of performance monitoring.

[0006] In a first aspect, the present disclosure provides a performance monitoring method for an input / output card, wherein the input / output card comprises a submission queue and a completion queue, wherein the submission queue is used to store commands issued by a host to the input / output card, and the completion queue is used to store command execution results returned by the input / output card to the host; the method comprises:

[0007] Acquire the command writing speed of the host in the submission queue and the command reading speed of the input / output card in the submission queue;

[0008] Obtaining a result writing speed of the input / output card in the completion queue and a result reading speed of the host in the completion queue;

[0009] The performance monitoring result of the input / output card is generated according to a first speed difference between the command writing speed and the command reading speed, and a second speed difference between the result writing speed and the result reading speed.

[0010] In a second aspect, the present disclosure provides a performance monitoring device for an input / output card, wherein the input / output card comprises a submission queue and a completion queue, wherein the submission queue is used to store commands to be executed issued by a host to the input / output card, and the completion queue is used to store command execution results returned by the input / output card to the host; the device comprises:

[0011] A first speed acquisition module, used for acquiring a command writing speed of the host in the submission queue, and a command reading speed of the input / output card in the submission queue;

[0012] A second speed acquisition module, used for acquiring a result writing speed of the input / output card in the completion queue, and a result reading speed of the host in the completion queue;

[0013] The performance monitoring module obtains the performance monitoring result of the input / output card according to a first speed difference between the command writing speed and the command reading speed and a second speed difference between the result writing speed and the result reading speed.

[0014] In a third aspect, the present disclosure provides an electronic device, comprising: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes the above method by executing the computer instructions.

[0015] In a fourth aspect, the present disclosure provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the above method.

[0016] In the technical solutions of some embodiments of the present disclosure, by obtaining the command writing speed of the host in the submission queue and the command reading speed of the input / output card in the submission queue, and obtaining the result writing speed of the input / output card in the completion queue and the result reading speed of the host in the completion queue, the performance monitoring result of the input / output card can be obtained based on the first speed difference between the command writing speed and the command reading speed, and the second speed difference between the result writing speed and the result reading speed. Since the implementation of performance monitoring does not modify the driver of the input / output card, it can prevent the problem of substitution errors due to modification of the driver, thereby achieving the purpose of reducing error introduction and improving the reliability of performance monitoring. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] In order to more clearly illustrate the specific embodiments of the present disclosure or the technical solutions in the related technologies, the drawings required for use in the specific embodiments or the related technical descriptions will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0018] Figure 1 is a schematic diagram of a submission queue and a completion queue provided by an embodiment of the present disclosure;

[0019] Figure 2 is a flowchart of a performance monitoring method provided by an embodiment of the present disclosure;

[0020] Figure 3 is a schematic diagram of a ring queue provided by an embodiment of the present disclosure;

[0021] Figure 4 is a schematic diagram of a module of a performance monitoring device provided by an embodiment of the present disclosure;

[0022] Figure 5 It is a schematic diagram of the structure of an electronic device provided by some embodiments of the present disclosure. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, rather than all the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present disclosure.

[0024] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments set forth herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0025] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "some embodiments" or "the embodiment" should be understood as "at least some embodiments". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.

[0026] Herein, unless explicitly stated, executing a step “in response to A” does not mean executing the step immediately after “A” but may include one or more intermediate steps.

[0027] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0028] It is understandable that before using the technical solutions disclosed in the various embodiments of the present disclosure, the types, scopes of use, usage scenarios, etc. of the information involved in the present disclosure should be informed to relevant users and their authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations. The relevant users may include any type of right holders, such as individuals, enterprises, and groups.

[0029] For example, in response to receiving an active request from a user, a prompt message is sent to the relevant user to clearly prompt the relevant user that the operation requested to be performed will require obtaining and using the information of the relevant user, so that the relevant user can independently choose whether to provide information to software or hardware such as an electronic device, application, server or storage medium that executes the operation of the technical solution of the present disclosure based on the prompt message.

[0030] As an optional but non-limiting implementation, in response to receiving an active request from a relevant user, a prompt message is sent to the relevant user, for example, in the form of a pop-up window, in which the prompt message may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide information to the electronic device.

[0031] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0032] In some technologies, in order to monitor the performance of input and output cards, the driver of the input and output cards is usually modified. In simple terms, it is to add statistical information functions in the driver where commands are received or completed. This method has the following problems:

[0033] 1) If errors are introduced during the driver modification process, the normal operation of the input / output card will be affected, and may even cause the input / output card to become unavailable, crash, or restart;

[0034] 2) It is necessary to modify the driver for each input and output card that needs performance monitoring, which will bring a lot of work.

[0035] In view of this, the present disclosure provides a performance monitoring method for an input / output card, which can avoid modifying the driver of the input / output card. In this way, not only can the introduction of errors be reduced and the reliability of performance monitoring be improved, but also the workload of driver modification can be reduced. Specifically, the method of the present disclosure is mainly applicable to performance monitoring of an input / output card including a task queue. The task queue may include a submission queue and a completion queue. Among them, the submission queue may also be referred to as an SQ (Submission Queue) queue, which is mainly used to store commands issued by the host to the input / output card. The input / output card may continue to send the commands in the submission queue to an external device for execution, and return the command execution results returned by the external device to the host. The completion queue may also be referred to as a CQ (Completion Queue) queue, which is mainly used to store the command execution results returned by the input / output card to the host.

[0036] For easier understanding, please refer to Figure 1 , is a schematic diagram of a submission queue and a completion queue provided by an embodiment of the present disclosure. Under normal circumstances, the host can push the command that needs to be issued to the input / output card from the tail of the submission queue. The input / output card can sequentially send the command issued by the host to the external device for processing from the head of the submission queue. After receiving the command execution result of the external device, the input / output card can push the received command execution result from the tail of the completion queue. The host can sequentially obtain the command execution result returned by the input / output card from the head of the completion queue. For example, take the host reading data from the storage device as an example. The host can push the data read command into the submission queue of the input / output card. The input / output card sends the data read command in the submission queue to the storage device. The storage device can locally search for the target data that the host needs to read according to the data read command, and return the target data to the input / output card as the command execution result. The input / output card can push the target data into the completion queue. The host can read the target data from the completion queue. In this way, data interaction between the host and the external device is realized through the input / output card.

[0037] Based on the above description, the performance monitoring method disclosed in the present invention is implemented based on the submission queue and completion queue of the input and output card. The performance monitoring method can be applied to performance monitoring software. The performance monitoring software can be run in the host or in other devices other than the host. Figure 2 , which is a flow chart of a performance monitoring method provided by an embodiment of the present disclosure. Figure 2 In the performance monitoring method, the following steps are included:

[0038] Step S201, obtaining the command writing speed of the host in the submission queue and the command reading speed of the input / output card in the submission queue.

[0039] Specifically, in this embodiment, the number of first commands written by the host to the submission queue within the first target time period can be counted, and the number of second commands read from the submission queue by the input / output card within the first target time period can be counted. In this way, based on expression (1), the command writing speed of the host within the first target time period can be obtained:

[0040] Command writing speed = number of first commands / length of first target time period (1)

[0041] Based on expression (2), the command reading speed of the input / output card in the first target time period can be obtained:

[0042] Command reading speed = number of second commands / duration of second target time period (2)

[0043] Based on the above description, the command writing speed and the command reading speed may be the command reading and writing speeds of the host and the input / output card within a certain time period.

[0044] Step S202, obtaining the result writing speed of the input / output card in the completion queue and the result reading speed of the host in the completion queue.

[0045] Specifically, similar to step S201, the number of first results written by the input / output card to the completion queue within the second target time period can be counted, and the number of second results read by the host from the completion queue within the second target time period can be counted. In this way, based on expression (3), the result writing speed of the input / output card within the second target time period can be obtained:

[0046] Result writing speed = number of first results / length of second target time period (3)

[0047] Based on expression (4), the result reading speed of the host in the second target time period can be obtained:

[0048] Result reading speed = the number of second results / the length of the second target time period (4)

[0049] The first target time period and the second target time period may be the same or different.

[0050] Step S203, generating a performance monitoring result of the input / output card according to a first speed difference between the command writing speed and the command reading speed, and a second speed difference between the result writing speed and the result reading speed.

[0051] Specifically, the first speed difference may be a difference between a command writing speed and a command reading speed, and the second speed difference may be a difference between a result writing speed and a result reading speed.

[0052] When the first speed difference is greater than 0 (i.e., the command writing speed is greater than the command reading speed), it indicates that the performance of the input / output card cannot meet expectations. Conversely, when the first speed difference is less than or equal to 0 (i.e., the command writing speed is less than or equal to the command reading speed), it indicates that the performance of the input / output card can meet expectations.

[0053] Similarly, when the first speed difference is greater than or equal to 0 (i.e., the result writing speed is greater than or equal to the result reading speed), it indicates that the performance of the input-output card can meet expectations. Conversely, when the first speed difference is less than 0 (i.e., the result writing speed is less than the result reading speed), it indicates that the performance of the input-output card cannot meet expectations.

[0054] The performance monitoring results may include the performance pressure of the input and output cards obtained by conversion, etc.

[0055] In this embodiment, the performance pressure of the input-output card may be proportional to the first speed difference and inversely proportional to the second speed difference. After obtaining the performance monitoring results, a performance pressure trend curve of the input-output card may be drawn and displayed based on the relationship between the performance pressure and the first speed difference and the second speed difference, so that the maintenance personnel can intuitively judge whether the input-output card has a performance pressure problem based on the performance pressure trend curve. Specifically, since the first speed difference reflects the performance problem between the host and the input-output card, and the second speed difference reflects the performance problem between the input-output card and the host, in actual applications, a first performance pressure trend curve can be generated based on the first speed difference, and a second performance pressure trend curve can be generated based on the second speed difference. In this way, the maintenance personnel can further subdivide the performance pressure problem of the input-output card based on the first performance pressure trend curve and the second performance pressure trend curve.

[0056] In summary, in the technical solutions of some embodiments of the present disclosure, by obtaining the command writing speed of the host in the submission queue and the command reading speed of the input / output card in the submission queue, and obtaining the result writing speed of the input / output card in the completion queue and the result reading speed of the host in the completion queue, the performance monitoring result of the input / output card can be obtained based on the first speed difference between the command writing speed and the command reading speed, and the second speed difference between the result writing speed and the result reading speed. Since the implementation of performance monitoring does not modify the driver of the input / output card, it can prevent the problem of substitution errors due to modification of the driver, thereby achieving the purpose of reducing error introduction and improving the reliability of performance monitoring.

[0057] In some embodiments, for any of the submission queues and the completion queues, the queue may be a ring queue, and the queue has a producer index and a consumer index, the producer index is used to identify the current data write position in the queue, and the consumer index is used to identify the current data read position in the queue. Figure 3 The underlying data structure of a ring queue is a fixed-size array (such as Figure 3 As shown in the array on the left, the head and tail of the queue are connected to form a ring. In the counterclockwise direction, when data needs to be written to the queue, the data can be written to the data write position currently identified by the producer index. After the data is written, the data write position identified by the producer index moves to the next new position. For example Figure 3 In the example, assuming that data needs to be written to the queue, the data can be written to position 3. After the data writing operation is completed, the data writing position identified by the producer index becomes position 4, that is, the producer index = 4. Similarly, in the counterclockwise direction, when data needs to be read from the queue, data can be read from the data reading position currently identified by the consumer index. After the data reading is completed, the data reading position identified by the consumer index moves to the next new position. For example Figure 3 In the example, if data needs to be read from the queue, the data in position 1 can be read. After the data is read, the data reading position identified by the consumer index becomes position 2, that is, the consumer index = 2. In this way, the array space can be recycled and storage resources can be used effectively. Figure 3 As shown, the circular queue may further include a reference index. The reference index is used to identify the queue head of the circular queue and will not move.

[0058] In the present disclosure, the position number of the position identified by each index is defined as the index value of the index. That is, for any index in the producer index and the consumer index, the index can identify different positions in the queue through different index values, and as the current data writing position or data reading position in the queue changes, the index value changes cyclically in the order from small to large.

[0059] Based on the above description, obtaining the command writing speed of the host in the submission queue and the command reading speed of the input / output card in the submission queue in step S201 may include:

[0060] Determine, according to a difference in positions identified by a producer index in the submission queue at a first time point and a second time point, the number of first commands written by the host to the submission queue between the first time point and the second time point, and determine a command writing speed according to the number of first commands and a duration between the first time point and the second time point;

[0061] The number of second commands read from the submission queue by the input / output card between the first time point and the second time point is determined based on the position difference identified by the consumer index in the submission queue at the first time point and the second time point, and the command reading speed is determined based on the number of second commands and the duration between the first time point and the second time point.

[0062] For details, please refer to Figure 3 . Assume that the first time point is 10 o'clock and the second time point is 11 o'clock. The producer index in the submission queue identifies position 5 at 10 o'clock and position 50 at 11 o'clock. It can be determined that between 10 o'clock and 11 o'clock, the host wrote commands to positions 5 to 49, that is, between 10 o'clock and 11 o'clock, the host wrote 45 commands to the submission queue. Furthermore, it can be determined that between 10 o'clock and 11 o'clock, the host's command writing speed is 9 commands every 10 minutes. Similarly, assuming that the consumer index in the submission queue identifies position 0 at 10 o'clock and position 30 at 11 o'clock, it can be determined that between 10 o'clock and 11 o'clock, the input and output card read commands from positions 0 to 29, that is, between 10 o'clock and 11 o'clock, the input and output card read 30 commands from the submission queue. Furthermore, it can be determined that between 10 o'clock and 11 o'clock, the command reading speed of the input and output card is 5 commands every 10 minutes.

[0063] Since the producer index and consumer index are inherent attributes of the circular queue, the change in the amount of data in the queue can be determined by tracking the position changes indicated by the producer index and consumer index in the queue. This eliminates the need for additional program code development to obtain the change in quantity, thus reducing the workload.

[0064] Based on principles similar to the above, in some embodiments, obtaining the result writing speed of the input / output card in the completion queue and the result reading speed of the host in the completion queue in step S202 includes:

[0065] Determine the number of first results written to the completion queue by the input / output card between the third time point and the fourth time point according to the difference in positions identified by the producer index in the completion queue at the third time point and the fourth time point, and determine the result writing speed according to the number of first results and the duration between the third time point and the fourth time point;

[0066] The number of second results read by the host from the completion queue between the first time point and the second time point is determined based on the position difference identified by the consumer index in the completion queue at the third time point and the fourth time point, and the result reading speed is determined based on the number of second results and the duration between the third time point and the fourth time point.

[0067] Furthermore, considering that the positions in the circular queue can be used repeatedly and cyclically, and there is no mechanism in the circular queue to count the number of repeated cycles (i.e., the number of turns), if the position identified by the same index is repeatedly cycled in the queue for many times (i.e., it repeatedly turns for many times) between two different time points, there may be a problem that the number of command reads and writes and the number of result reads and writes cannot be determined based on the position difference. For example, assume that the maximum position in the queue is 400, the reference position is 0, and at the previous time point, the index value of the consumer index is 30 (i.e., the position of the consumer identifier is position 200). If between the previous and next time points, the index value of the consumer index undergoes the following changes: 30>…>400>…>0…>200>…>400>…>50. It can be seen that the index value of the consumer index has been repeatedly cycled for many times and stays at 30 at the next time point. It is unreasonable to determine the number of command reads or result reads based on the index value 30 of the consumer index at the previous time point and the index value 50 of the consumer index at the next time point.

[0068] In view of this, in some embodiments of the present disclosure, for any queue in the submission queue and the completion queue, the queue has a queue duration threshold, and the queue duration threshold represents the shortest duration required for the index value in the queue to change from the minimum value to the maximum value, or from the maximum value to the minimum value (i.e., the shortest duration for the index to make a circle). When determining any of the first command quantity, the second command quantity, the first result quantity, and the second result quantity based on the position difference identified by the index at two different time points before and after, the time difference between the two time points before and after is less than the queue duration threshold. In this way, the above problems can be effectively avoided and the accuracy of data calculation can be ensured.

[0069] Further, continue to refer to Figure 3 Under the constraint of the queue duration threshold (ie, the index value will not have a repeated cycle problem), there may be multiple situations in which the position difference indicated by the same index at two different time points in the circular queue is different.

[0070] The first case is that the index value at the later time point is greater than the index value at the previous time point. For example, the index value at the later time point is 400, and the index value at the previous time point is 25. In this case, it can be said that between the two time points, the position identified by the index is only a part of the position in the queue (in layman's terms, the position identified by the index has not yet completed a circle of the circular queue). In this case, the index value at the later time point can be directly subtracted from the index value at the previous time point to obtain the required number.

[0071] The second situation is that the index value of the index at the next time point is less than the index value of the index at the previous time point. For example, the index value of the index at the next time point is 30, and the index value at the previous time point is 25. In this case, it can be said that between the two time points, the position identified by the index has passed the position identified by the reference index (i.e., the queue head of the circular queue). In this case, it is unreasonable to use the index value at the next time point minus the index value at the previous time point. In some embodiments of the present disclosure, in this case, the maximum index value of the index minus the absolute value of the difference between the index values ​​at the previous and next time points can be used to obtain the required number. For example, assuming that the maximum index value of the index is 400, the index value of the index at the next time point is 30, and the index value at the previous time point is 25, then the calculation process should be 400-|30-25|=395. In this way, the problem of obtaining an incorrect number when the index value at the next time point is less than the index value at the previous time point can be avoided.

[0072] The third case is that the index value of the index at the later time point is equal to the index value of the index at the previous time point. In this case, due to the constraint of the queue duration threshold, it can be considered that the index value of the index has not changed, that is, the number to be determined can be determined to be 0.

[0073] In some embodiments, the index value of the index may be stored in a target register of an input-output card, the input-output card includes one or more different types of submission queues, and the one or more different types of submission queues have respective corresponding completion queues;

[0074] Before obtaining the command writing speed, the command reading speed, the result writing speed, and the result reading speed, the method of the present disclosure may further include:

[0075] One or more of the following information is obtained from the specified configuration carrier: address information of the target register, queue time threshold, address information of the input / output card for which performance monitoring is required, and queue identifiers of the submission queue and completion queue for which performance monitoring is required in the input / output card.

[0076] Specifically, the configuration carrier may include but is not limited to a configuration file, etc. For ease of understanding, an example of the contents of some configuration files is given below:

[0077] ADAPTOR_1_BDF=xx.xx.x

[0078] ADAPTOR_1_COMMAND_QUEUES_COUNT=1

[0079] ADAPTOR_1_SQ1_PRODUCER_INDEX_ADDR=0|xxx1

[0080] ADAPTOR_1_SQ1_CONSUMER_INDEX_ADDR=0|xxx2

[0081] ADAPTOR_1_CQ1_PRODUCER_INDEX_ADDR=0|xxx3

[0082] ADAPTOR_1_CQ1_CONSUMER_INDEX_ADDR=0|xxx4

[0083] In the above configuration file:

[0084] ADAPTOR_1_BDF indicates the device address of the input / output card that needs to be monitored for performance. The device address can be a PCIe address.

[0085] ADAPTOR_1_COMMAND_QUEUES_COUNT indicates the number of queues that need to be monitored for performance;

[0086] ADAPTOR_1_SQ1_PRODUCER_INDEX_ADDR indicates the register address A used to store the producer index value of the submission queue. 0|xxx1 indicates that the register address A can be obtained after offsetting xxx1 from the base address BAR 0. The base address BAR0 is recorded in the designated register of the input / output card. The address of the designated register can be obtained by checking the product manual of the input / output card.

[0087] Similarly, ADAPTOR_1_SQ1_CONSUMER_INDEX_ADDR represents the register address B used to store the consumer index value of the submission queue;

[0088] ADAPTOR_1_CQ1_PRODUCER_INDEX_ADDR represents the register address C used to store the producer index value of the completion queue;

[0089] ADAPTOR_1_CQ1_CONSUMER_INDEX_ADDR represents the register address D used to store the consumer index value of the completion queue.

[0090] Based on the above configuration file, in some embodiments, in a Linux environment, the step of performing performance monitoring on the input and output card may include the following steps:

[0091] 1) Use the setpci command to obtain the address of its BAR 0

[0092] 2) Go to the directory / dev / mem and use mmap() to map the address of BAR0 for direct access in the next step;

[0093] fd=open(“ / dev / mem”,O_RDWR|O_SYNC)

[0094] bar0=mmap(0,bar_size,PROT_READ,MAP_SHARED,fd,bar0_addr)

[0095] 3) Start the performance monitoring process of the input and output cards;

[0096] 4) According to the configuration content in the configuration file, loop through all the input and output cards that need to be monitored;

[0097] 5) At specified time intervals, access the values ​​of the producer index and consumer index in the submission queue and completion queue of each input and output card, and generate performance monitoring results based on the obtained values.

[0098] In some embodiments, generating the performance monitoring result of the input and output card in step S203 may include:

[0099] Determine a first speed difference in each time period according to the command writing speed and the command reading speed in the multiple different time periods, and determine a second speed difference in each time period according to the result writing speed and the result reading speed in the multiple different time periods;

[0100] The performance monitoring result of the input and output card is generated according to the average value of the first speed difference in multiple different time periods and the average value of the second speed difference in multiple different time periods.

[0101] By averaging, the result is more accurate.

[0102] In some embodiments, after obtaining the performance monitoring result, the method of the present disclosure may further include:

[0103] If the current performance pressure of the input and output card exceeds the preset performance pressure threshold, an alarm message is generated.

[0104] In this way, maintenance personnel can be reminded in time to optimize input and output cards with performance problems to ensure normal operation of the business.

[0105] Combined with reference Figure 4 , which is a module diagram of a performance monitoring device provided by an embodiment of the present disclosure. Figure 4 The performance monitoring device includes:

[0106] The first speed acquisition module 401 is used to acquire the command writing speed of the host in the submission queue and the command reading speed of the input and output card in the submission queue;

[0107] The second speed acquisition module 402 is used to acquire the result writing speed of the input and output card in the completion queue and the result reading speed of the host in the completion queue;

[0108] The performance monitoring module 403 obtains the performance monitoring result of the input / output card according to the first speed difference between the command writing speed and the command reading speed and the second speed difference between the result writing speed and the result reading speed.

[0109] In some embodiments, for any of the submission queue and the completion queue, the queue is a circular queue, and the queue has a producer index and a consumer index, the producer index is used to identify the current data write position in the queue, and the consumer index is used to identify the current data read position in the queue; the first speed acquisition module 401 is specifically used to:

[0110] Determine, according to a difference in positions identified by a producer index in the submission queue at a first time point and a second time point, the number of first commands written by the host to the submission queue between the first time point and the second time point, and determine a command writing speed according to the number of first commands and a duration between the first time point and the second time point;

[0111] Determine, according to a difference in position between the first time point and the second time point identified by the consumer index in the submission queue, the number of second commands read by the input / output card from the submission queue between the first time point and the second time point, and determine the command reading speed according to the number of second commands and the duration between the first time point and the second time point;

[0112] And, the second speed acquisition module 402 is specifically used for:

[0113] Determine the number of first results written to the completion queue by the input / output card between the third time point and the fourth time point according to the difference in positions identified by the producer index in the completion queue at the third time point and the fourth time point, and determine the result writing speed according to the number of first results and the duration between the third time point and the fourth time point;

[0114] The number of second results read by the host from the completion queue between the first time point and the second time point is determined based on the position difference identified by the consumer index in the completion queue at the third time point and the fourth time point, and the result reading speed is determined based on the number of second results and the duration between the third time point and the fourth time point.

[0115] In some embodiments, for any index in the producer index and the consumer index, the index identifies different positions in the queue by different index values, and as the current data writing position or data reading position in the queue changes, the index value changes cyclically in order from small to large;

[0116] For any queue in the submission queue and the completion queue, the queue has a queue duration threshold, which represents the shortest duration required for the index value in the queue to change from the minimum value to the maximum value, or from the maximum value to the minimum value;

[0117] When the performance monitoring module 403 determines the first command quantity, the second command quantity, the first result quantity and the second result quantity based on the position difference identified by the index at two different time points, the time difference between the two time points is less than the queue length threshold.

[0118] In some embodiments, for any index in the producer index and the consumer index, the index identifies different positions in the queue by different index values, and as the current data writing position or data reading position in the queue changes, the index value changes cyclically in order from small to large;

[0119] When the performance monitoring module 403 determines any one of the first command quantity, the second command quantity, the first result quantity, and the second result quantity according to the position difference identified by the index at two different time points, the performance monitoring module 403 is specifically used to:

[0120] If the index value at the later time point is greater than the index value at the previous time point, the index value at the later time point is subtracted from the index value at the previous time point to obtain the required number.

[0121] If the index value at the later time point is less than the index value at the previous time point, the maximum index value minus the absolute value of the difference between the index values ​​at the previous and next time points is used to obtain the required number.

[0122] If the index value of the index at the later time point is equal to the index value of the index at the previous time point, it is determined that the number to be determined is 0.

[0123] In some embodiments, the index value of the index is stored in a target register of an input-output card, the input-output card includes one or more submission queues of different types, and the one or more submission queues of different types have respective corresponding completion queues;

[0124] Before acquiring the command writing speed, the command reading speed, the result writing speed, and the result reading speed, the first speed acquiring module 401 and the second speed acquiring module 402 are further used to:

[0125] One or more of the following information is obtained from the specified configuration carrier: address information of the target register, queue time threshold, address information of the input / output card for which performance monitoring is required, and queue identifiers of the submission queue and completion queue for which performance monitoring is required in the input / output card.

[0126] In some embodiments, the performance monitoring module 403 is specifically used to:

[0127] Determine a first speed difference in each time period according to the command writing speed and the command reading speed in the multiple different time periods, and determine a second speed difference in each time period according to the result writing speed and the result reading speed in the multiple different time periods;

[0128] The performance monitoring result of the input and output card is generated according to the average value of the first speed difference in multiple different time periods and the average value of the second speed difference in multiple different time periods.

[0129] In some embodiments, the performance monitoring results include the current performance pressure of the input and output card;

[0130] After obtaining the performance monitoring result, the performance monitoring module 403 is further used to:

[0131] If the current performance pressure of the input and output card exceeds the preset performance pressure threshold, an alarm message is generated.

[0132] The performance monitoring device of the input and output card in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.

[0133] In the technical solutions of some embodiments of the present disclosure, by obtaining the command writing speed of the host in the submission queue and the command reading speed of the input / output card in the submission queue, and obtaining the result writing speed of the input / output card in the completion queue and the result reading speed of the host in the completion queue, the performance monitoring result of the input / output card can be obtained based on the first speed difference between the command writing speed and the command reading speed, and the second speed difference between the result writing speed and the result reading speed. Since the implementation of performance monitoring does not modify the driver of the input / output card, it can prevent the problem of substitution errors due to modification of the driver, thereby achieving the purpose of reducing error introduction and improving the reliability of performance monitoring.

[0134] The present disclosure also provides an electronic device having the above Figure 4 The performance monitoring device of the input and output card is shown.

[0135] Combined with reference Figure 5 , is a schematic diagram of the structure of an electronic device provided by some embodiments of the present disclosure. Figure 5As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 5 A processor 10 is taken as an example.

[0136] The processor 10 may be a first PCIe device, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0137] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0138] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0139] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0140] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.

[0141] The embodiments of the present disclosure also provide a computer-readable storage medium. The above-mentioned method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state drive, etc.; further, the storage medium can also include a combination of the above-mentioned types of memory. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0142] A part of the present disclosure may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present disclosure through the operation of the computer. Those skilled in the art should understand that the existence of computer program instructions in computer-readable media includes, but is not limited to, source files, executable files, installation package files, etc., and accordingly, the way in which computer program instructions are executed by a computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium can be any available computer-readable storage medium or communication medium accessible to the computer.

[0143] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A performance monitoring method for an input / output card, characterized in that: The input / output card comprises a submission queue and a completion queue, wherein the submission queue is used to store commands issued by the host to the input / output card, and the completion queue is used to store command execution results returned by the input / output card to the host; the method comprises: Acquire the command writing speed of the host in the submission queue and the command reading speed of the input / output card in the submission queue; Obtaining a result writing speed of the input / output card in the completion queue and a result reading speed of the host in the completion queue; The performance monitoring result of the input / output card is generated according to a first speed difference between the command writing speed and the command reading speed, and a second speed difference between the result writing speed and the result reading speed.

2. The method according to claim 1, characterized in that For any queue in the submission queue and the completion queue, the queue is a circular queue, and the queue has a producer index and a consumer index, the producer index is used to identify a current data write position in the queue, and the consumer index is used to identify a current data read position in the queue; The obtaining of the command writing speed of the host in the submission queue and the command reading speed of the input / output card in the submission queue includes: Determine, according to a difference in positions identified by a producer index in the submission queue at a first time point and a second time point, the number of first commands written by the host to the submission queue between the first time point and the second time point, and determine the command writing speed according to the first command number and the duration between the first time point and the second time point; Determine, according to a difference in position identified by a consumer index in the submission queue at the first time point and the second time point, the number of second commands read by the input / output card from the submission queue between the first time point and the second time point, and determine, according to the number of the second commands and the duration between the first time point and the second time point, the command reading speed; And, obtaining the result writing speed of the input / output card in the completion queue and the result reading speed of the host in the completion queue includes: Determine, according to the difference in position identified by the producer index in the completion queue at the third time point and the fourth time point, the number of first results written by the input / output card to the completion queue between the third time point and the fourth time point, and determine the result writing speed according to the first number of results and the duration between the third time point and the fourth time point; The number of second results read by the host from the completion queue between the first time point and the second time point is determined based on the difference in positions identified by the consumer index in the completion queue at the third time point and the fourth time point, and the result reading speed is determined based on the number of second results and the duration between the third time point and the fourth time point.

3. The method according to claim 2, characterized in that For any index of the producer index and the consumer index, the index identifies different positions in the queue by different index values, and as the current data writing position or data reading position in the queue changes, the index value changes cyclically in the order from small to large; For any queue of the submission queue and the completion queue, the queue has a queue duration threshold, and the queue duration threshold represents the shortest duration required for an index value in the queue to change from a minimum value to a maximum value, or from a maximum value to a minimum value; When determining the first command quantity, the second command quantity, the first result quantity and the second result quantity based on the position difference identified by the index at two different time points, the time difference between the two time points is less than the queue time length threshold.

4. The method according to claim 3, characterized in that When determining any one of the first command quantity, the second command quantity, the first result quantity, and the second result quantity according to a position difference identified by the index at two different time points, the method includes: If the index value of the index at the later time point is greater than the index value of the index at the previous time point, the index value at the later time point is subtracted from the index value at the previous time point to obtain the required number to be determined; If the index value of the index at the later time point is less than the index value of the index at the previous time point, the maximum index value of the index minus the absolute value of the difference between the index values ​​at the previous and next time points is used to obtain the required number to be determined; If the index value of the index at the later time point is equal to the index value of the index at the previous time point, it is determined that the required number is 0.

5. The method according to claim 4, characterized in that The index value of the index is stored in a target register of the input / output card, the input / output card includes one or more different types of submission queues, and the one or more different types of submission queues have their own corresponding completion queues; Before acquiring the command writing speed, the command reading speed, the result writing speed, and the result reading speed, the method further includes: One or more of the following information is obtained from the specified configuration carrier: address information of the target register, the queue time threshold, address information of the input / output card that needs to perform performance monitoring, and queue identifiers of the submission queue and completion queue in the input / output card that need to perform performance monitoring.

6. The method according to claim 1, characterized in that The generating the performance monitoring result of the input and output card comprises: Determine a first speed difference in each time period according to command writing speeds and command reading speeds in a plurality of different time periods, and determine a second speed difference in each time period according to result writing speeds and result reading speeds in the plurality of different time periods; The performance monitoring result of the input and output card is generated according to the average value of the first speed difference in the multiple different time periods and the average value of the second speed difference in the multiple different time periods.

7. The method according to claim 1 or 6, characterized in that: The performance monitoring result includes the current performance pressure of the input and output card; After obtaining the performance monitoring result, the method further includes: If the current performance pressure of the input and output card exceeds a preset performance pressure threshold, an alarm message is generated.

8. A performance monitoring device for an input / output card, characterized in that: The input / output card includes a submission queue and a completion queue, wherein the submission queue is used to store commands to be executed issued by the host to the input / output card, and the completion queue is used to store command execution results returned by the input / output card to the host; the device includes: A first speed acquisition module, used for acquiring a command writing speed of the host in the submission queue, and a command reading speed of the input / output card in the submission queue; A second speed acquisition module, used for acquiring a result writing speed of the input / output card in the completion queue, and a result reading speed of the host in the completion queue; The performance monitoring module obtains the performance monitoring result of the input / output card according to a first speed difference between the command writing speed and the command reading speed and a second speed difference between the result writing speed and the result reading speed.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the performance monitoring method of the input and output card according to any one of claims 1 to 7 by executing the computer instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the performance monitoring method of the input and output card according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Data transmission processing method and device, electronic equipment and storage medium

    CN113672406A

  • Solid state disk write delay processing method and device, solid state disk and medium

    CN117573029A

  • Apparatus and method for supporting data input / output operations based on data attributes

    CN118778882A

  • Resizable and Relocatable Queue

    US20150355883A1

  • System and method for consistent performance in a storage device

    US20160342367A1