Method, device and storage medium for monitoring performance of input / output card

By monitoring the speed difference between the submission queue and completion queue of the input and output cards, performance monitoring results are generated, which solves the problem of errors introduced by driver modifications and achieves high-reliability performance monitoring.

CN119718193BActive Publication Date: 2025-10-17INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In the prior art, when monitoring the performance of input and output cards, modifying the driver is prone to introducing errors, causing the card to be unavailable or downtime, and each card needs to be modified separately, which is a lot of work.

Method used

By monitoring the speed differences between commands and results in the submission queue and completion queue of the input/output card, performance monitoring results are generated to avoid modifying the driver.

Benefits of technology

This reduces the introduction of errors, improves the reliability of performance monitoring, and reduces the workload of modifying the driver.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718193B_ABST
    Figure CN119718193B_ABST
Patent Text Reader

Abstract

The present disclosure relates to the technical field of device performance monitoring, and discloses a performance monitoring method and device of an input / output card, equipment and a storage medium. The input / output card comprises a submission queue and a completion queue. The submission queue is used to store commands issued by a host to the input / output card. The completion queue is used to store command execution results returned by the input / output card to the host. The method comprises: obtaining 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; 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 device performance monitoring, and particularly relates to a performance monitoring method and device of an input / output card, an electronic device and a storage medium. BACKGROUND

[0002] The input / output card, also known as an I / O card, is mainly used for data transmission between a host and an external device. The external device can include, but is not limited to, a storage device, a disk drive, etc. The input / output card can include, but is not limited to, a SAS card, an FC card, a network card, a RoCE card, 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, and 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, restart, etc.

[0004] Therefore, there is an urgent need for a performance monitoring method with high reliability. SUMMARY

[0005] Therefore, the present disclosure provides a performance monitoring method and device of 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 of an input / output card, the input / output card comprising a submission queue and a completion queue, the submission queue being used to store commands issued by a host to the input / output card, and the completion queue being used to store command execution results returned by the input / output card to the host; the method comprising:

[0007] obtaining 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;

[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] 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.

[0010] In a second aspect, the present disclosure provides a performance monitoring device of an input / output card, the input / output card comprising a submission queue and a completion queue, the submission queue being used to store a command to be executed issued by a host to the input / output card, and the completion queue being used to store a result of command execution returned by the input / output card to the host; the device comprising:

[0011] a first speed obtaining module, configured to obtain 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 obtaining module, configured to obtain 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] a performance monitoring module, configured to obtain 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.

[0014] In a third aspect, the present disclosure provides an electronic device, comprising a memory and a processor, which are connected to each other in communication, and the memory stores computer instructions, and the processor executes the computer instructions to perform the above method.

[0015] In a fourth aspect, the present disclosure provides a computer readable storage medium, which stores computer instructions for causing a computer to execute the above method.

[0016] In the technical scheme 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, the problem of introducing errors due to modification of the driver can be prevented, thereby achieving the purposes of reducing error introduction and improving performance monitoring reliability. BRIEF DESCRIPTION OF DRAWINGS

[0017] In order to more clearly illustrate the technical solutions in the specific embodiments or the related art of the present disclosure, the drawings needed to be used in the specific embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative effort.

[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 module schematic diagram of a performance monitoring device provided by an embodiment of the present disclosure;

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

[0023] In order to make the objects, technical solutions and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be described clearly and completely below with reference to the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are some 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 effort fall within the scope of protection of the present disclosure.

[0024] The embodiments of the present disclosure will be described in more detail below with reference to the drawings. Although some embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms, and should not be interpreted as being limited to the embodiments set forth herein. Rather, these embodiments are provided to make the present disclosure more thorough and complete. 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 “comprising” and similar terms are to be understood as open-ended, i.e., “including but not limited to”. The term “based on” is to be understood as “based at least in part on”. The term “some embodiments” or “this embodiment” is to be understood as “at least some embodiments”. The term “some embodiments” is to be understood as “at least some embodiments”. Other explicit and implicit definitions can also be included below.

[0026] In this document, unless explicitly stated otherwise, performing a step "in response to" A does not mean that the step is performed immediately after A, but can include one or more intervening steps.

[0027] It can be understood that the data involved in the technical solutions of the present application (including but not limited to the data itself, the obtaining, use, storage or deletion of the data) should comply with the requirements of the relevant laws and regulations and relevant provisions.

[0028] It can be understood that before using the technical solutions disclosed in the embodiments of the present application, the type of information involved in the present application, the use range, the use scenario, etc. should be informed to the relevant user and the authorization of the relevant user should be obtained by appropriate means according to the relevant laws and regulations, wherein the relevant user can include any type of right subject, such as an individual, an enterprise or a group.

[0029] For example, in response to receiving the active request of the user, prompt information is sent to the relevant user to explicitly prompt the relevant user that the operation requested to be performed will require the information of the relevant user to be obtained and used, so that the relevant user can voluntarily choose whether to provide the information to the software or hardware such as an electronic device, an application program, a server or a storage medium performing the operation of the technical solutions of the present application according to the prompt information.

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

[0031] It can be understood that the above notification and user authorization process is only illustrative and does not limit the implementation manner of the present application, and other manners meeting the relevant laws and regulations can also be applied to the implementation manner of the present application.

[0032] In some technologies, in order to monitor the performance of an input / output card, the driver of the input / output card is usually modified. Simply speaking, the statistical information function is added at the place where the command is received or completed in the driver. This method has the following problems:

[0033] 1) If an error is introduced in the process of modifying the driver, the normal operation of the input / output card will be affected, and even the input / output card may become unavailable, or may be restarted due to a crash;

[0034] 2) The driver of each input / output card with performance monitoring needs to be modified respectively, which will bring a large amount of work.

[0035] In view of this, the present disclosure provides a performance monitoring method of an input / output card, which can be implemented without modifying the driver of the input / output card. In this way, not only can the error introduction be reduced and the performance monitoring reliability 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 can include a submission queue and a completion queue. The submission queue, which can also be referred to as an SQ (Submission Queue) queue, is mainly used to store commands issued by a host to the input / output card. The input / output card can continue to send the commands in the submission queue to an external device for execution, and return the command execution result returned by the external device to the host. The completion queue, which can also be referred to as a CQ (Completion Queue) queue, is mainly used to store the command execution result returned by the input / output card to the host.

[0036] For ease of understanding, reference can be made to Figure 1 For an embodiment of the present disclosure, a schematic diagram of the submission queue and the completion queue is provided. Generally, the host can push a command to be issued to the input / output card from the tail of the submission queue. The input / output card can send the command issued by the host to the external device for processing in sequence 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 acquire the command execution result returned by the input / output card in sequence from the head of the completion queue. For example, taking the host reading data from a storage device as an example. The host can push a data read command to the submission queue of the input / output card. The input / output card can issue the data read command in the submission queue to the storage device. The storage device can locally search for the target data to be read by the host according to the data read command, and return the target data as the command execution result to the input / output card. The input / output card can push the target data to the completion queue. The host can read the target data from the completion queue. In this way, through the input / output card, the data interaction between the host and the external device is realized.

[0037] Based on the above description, the performance monitoring method of the present disclosure is implemented based on the submission queue and the completion queue of the input / output card. The performance monitoring method can be applied to performance monitoring software. The performance monitoring software can run in the host, or in other devices other than the host. For ease of understanding, reference can be made to Figure 2 For an embodiment of the present disclosure, a flowchart of the performance monitoring method is provided. Figure 2 Specifically, the performance monitoring method includes the following steps:

[0038] In step S201, 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 are acquired.

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

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

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

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

[0043] Based on the above description, the command write speed and the command read speed can be the command read / write speed of the host and the input / output card within a certain time period.

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

[0045] Specifically, similar to step S201, the first number of results written by the input / output card into the completion queue within the second target time period can be counted, and the second number of 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 write speed of the input / output card within the second target time period can be obtained:

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

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

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

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

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

[0051] Specifically, the first speed difference can be the difference between the command write speed and the command read speed. The second speed difference can be the difference between the result write speed and the result read speed.

[0052] In a case where the first speed difference is greater than 0 (i.e., the command write speed is greater than the command read speed), it indicates that the performance of the input / output card cannot meet the expectation. Conversely, in a case where the first speed difference is less than or equal to 0 (i.e., the command write speed is less than or equal to the command read speed), it indicates that the performance of the input / output card can meet the expectation.

[0053] Similarly, in a case where the first speed difference is greater than or equal to 0 (i.e., the result write speed is greater than or equal to the result read speed), it indicates that the performance of the input / output card can meet the expectation. Conversely, in a case where the first speed difference is less than 0 (i.e., the result write speed is less than the result read speed), it indicates that the performance of the input / output card cannot meet the expectation.

[0054] The performance monitoring result can include a performance pressure of the input / output card converted.

[0055] In the embodiment, the performance pressure of the input / output card can be proportional to the first speed difference and inversely proportional to the second speed difference. After obtaining the performance monitoring result, a performance pressure trend graph of the input / output card can be drawn and displayed according to the relationship between the performance pressure and the first speed difference and the second speed difference, so that the maintenance personnel can intuitively determine whether the input / output card has a performance pressure problem based on the performance pressure trend graph. 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 application, a first performance pressure trend graph can be generated based on the first speed difference, and a second performance pressure trend graph 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 graph and the second performance pressure trend graph.

[0056] In summary, in the technical scheme of some embodiments of the present disclosure, by obtaining the command write speed of the host in the submission queue and the command read speed of the input / output card in the submission queue, and obtaining the result write speed of the input / output card in the completion queue and the result read 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 write speed and the command read speed, and the second speed difference between the result write speed and the result read speed. Since the implementation of performance monitoring does not modify the driver of the input / output card, the problem of introducing errors due to modification of the driver can be prevented, thereby achieving the purposes of reducing error introduction and improving performance monitoring reliability.

[0057] In some embodiments, for any of the submission queue and the completion queue, the queue can be a ring 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. For ease of understanding, reference is made to Figure 3 The underlying data structure of the ring queue is a fixed-size array (as shown in the array on the left side), and the head and tail of the queue are connected to form a ring. In a counterclockwise direction, when data needs to be written into the queue, the data can be written into the data write position currently identified by the producer index. After the data write is completed, the data write position identified by the producer index moves to the next new position. For example Figure 3 , it is assumed that data needs to be written into the queue at present, and the data can be written into position 3. After the data write operation is completed, the data write position identified by the producer index becomes position 4, that is, the producer index = 4. Similarly, in a counterclockwise direction, when data needs to be read from the queue, the data can be read from the data read position currently identified by the consumer index. After the data read is completed, the data read position identified by the consumer index moves to the next new position. For example Figure 3 , it is assumed that data needs to be read from the queue at present, and the data in position 1 can be read. After the data read is completed, the data read position identified by the consumer index becomes position 2, that is, the consumer index = 2. In this way, the array space can be used in a loop, and the storage resources can be effectively utilized. As shown in Figure 3 , the ring queue can also include a reference index. The reference index is used to identify the head of the ring queue and will not move. Figure 3 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 of the producer index and the consumer index, the index can identify different positions in the queue through different index values, and the index value changes in a loop according to the order from small to large as the current data write position or the data read position in the queue changes.

[0058] Based on the above description, the command write speed of the host in the submission queue and the command read speed of the input / output card in the submission queue in step S201 can include:

[0059] According to the difference between the positions identified by the producer index in the submission queue at the first time point and the second time point, the first number of commands written by the host into the submission queue between the first time point and the second time point is determined, and the command write speed is determined according to the first number of commands and the time length between the first time point and the second time point;

[0060] According to the difference between the positions identified by the consumer index in the submission queue at the first time point and the second time point, the first number of commands read by the input / output card from the submission queue between the first time point and the second time point is determined, and the command read speed is determined according to the first number of commands and the time length between the first time point and the second time point.

[0061] According to the difference between the positions identified by the consumer index in the submission queue at the first time point and the second time point, the second number of commands read by the input / output card from the submission queue between the first time point and the second time point is determined, and according to the second number of commands, the length of time between the first time point and the second time point, the command reading speed is determined.

[0062] Specifically, in combination with the description of Figure 3 Assuming that the first time point is 10 o'clock and the second time point is 11 o'clock, the position identified by the producer index in the submission queue at 10 o'clock is 5, and the position identified at 11 o'clock is 50, it can be determined that between 10 o'clock and 11 o'clock, the host writes commands into positions 5-49, that is, between 10 o'clock and 11 o'clock, the host writes 45 commands into the submission queue. Further, it can be determined that between 10 o'clock and 11 o'clock, the command writing speed of the host is 9 commands per 10 minutes. Similarly, assuming that the position identified by the consumer index in the submission queue at 10 o'clock is 0, and the position identified at 11 o'clock is 30, it can be determined that between 10 o'clock and 11 o'clock, the input / output card reads commands from positions 0-29, that is, between 10 o'clock and 11 o'clock, the input / output card reads 30 commands from the submission queue. Further, it can be determined that between 10 o'clock and 11 o'clock, the command reading speed of the input / output card is 5 commands per 10 minutes.

[0063] Since the producer index and the consumer index are attributes of the ring queue, by tracking the changes of the positions identified by the producer index and the consumer index in the queue, the change of the data amount in the queue can be determined, and additional program code development for obtaining the amount of change can be avoided, reducing the workload.

[0064] Based on similar principles as 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] According to the difference between the positions identified by the producer index in the completion queue at the third time point and the fourth time point, the first number of results written by the input / output card into the completion queue between the third time point and the fourth time point is determined, and according to the first number of results, the length of time between the third time point and the fourth time point, the result writing speed is determined;

[0066] According to the difference between the positions identified by the consumer index in the completion queue at the third time point and the fourth time point, the second number of results read by the host from the completion queue between the first time point and the second time point is determined, and according to the second number of results, the length of time between the third time point and the fourth time point, the result reading speed is determined.

[0067] Further, considering that the position in the ring queue can be repeatedly used in a loop and there is no mechanism in the ring queue to count the number of repeated loops (i.e., the number of turns), if the position identified by the same index repeatedly loops multiple times (i.e., repeatedly turns multiple 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, assuming that the maximum position in the queue is 400, the reference position is 0, and at a previous time point, the index value of the consumer index is 30 (i.e., the position identified by the consumer is position 200). If the index value of the consumer index undergoes the following changes between the previous and subsequent time points: 30 >... > 400 >... > 0 >... > 200 >... > 400 >... > 50. It can be seen that the index value of the consumer index has repeatedly looped multiple times and is at 30 at the subsequent time point. If the number of command reads or the number of result reads is determined according to the index value of the consumer index at the previous time point 30 and the index value of the consumer index at the subsequent time point 50, it is certainly unreasonable.

[0068] In view of this, in some embodiments of the present disclosure, for any of the submission queue and the completion queue, the queue has a queue length threshold value, which represents the shortest length of time 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 minimum length of time for the index to turn one circle). When determining any of the first command number, the second command number, the first result number, and the second result number according to 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 value. In this way, the above problem can be effectively avoided, and the accuracy of data calculation is ensured.

[0069] Further, continuing to refer to Figure 3 Under the constraint of the queue length threshold value (i.e., the index value does not repeatedly loop), the position difference identified by the same index at two different time points in the ring queue can also have multiple cases.

[0070] The first case is that the index value at the subsequent time point is greater than the index value at the previous time point. For example, the index value at the subsequent time point is 400, and the index value at the previous time point is 25. In this case, it can be indicated that the position identified by the index is only part of the position in the queue (in a colloquial way, it is said that the position identified by the index has not turned a circle of the ring queue) between the two time points. In this case, the index value at the subsequent time point can be directly subtracted from the index value at the previous time point to obtain the required number.

[0071] The second case is that the index value of the index at the latter time point is less than the index value of the index at the former time point. For example, the index value of the index at the latter time point is 30, and the index value of the index at the former time point is 25. In this case, it can be indicated that the position identified by the index has passed the position identified by the reference index (i.e., the head of the circular queue) between the two time points. In this case, it is certainly unreasonable to subtract the index value at the former time point from the index value at the latter 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 two time points can be used to obtain the required quantity to be determined. For example, assuming that the maximum index value of the index is 400, the index value of the index at the latter time point is 30, and the index value of the index at the former time point is 25, the calculation process should be 400-|30-25|=395. In this way, the problem of obtaining an incorrect quantity when the index value at the latter time point is less than the index value at the former time point can be avoided.

[0072] The third case is that the index value of the index at the latter time point is equal to the index value of the index at the former time point. In this case, due to the constraint of the queue length threshold, it can be considered that the index value of the index has not changed, i.e., it can be determined that the required quantity to be determined is 0.

[0073] In some embodiments, the index value of the index can be saved in a target register of an input / output card, the input / output card including one or more different types of submission queues, and the one or more different types of submission queues having respective corresponding completion queues;

[0074] Before obtaining the command write speed, the command read speed, the result write speed, and the result read speed, the method of the present disclosure can further include:

[0075] From the specified configuration carrier, one or more of the following information can be obtained: address information of the target register, the queue length threshold, address information of the input / output card on which performance monitoring needs to be performed, and queue identifiers of the submission queue and the completion queue in the input / output card on which performance monitoring needs to be performed.

[0076] Specifically, the configuration carrier can include but is not limited to a configuration file and the like. For ease of understanding, an example of part of the content of a configuration file 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 represents the device address of the input / output card that needs to be monitored, which can be a PCIe address;

[0085] ADAPTOR_1_COMMAND_QUEUES_COUNT represents the number of queues that need to be monitored;

[0086] ADAPTOR_1_SQ1_PRODUCER_INDEX_ADDR represents the register address A for saving the producer index value of the submission queue, 0 | xxx1 represents the register address A obtained by offsetting xxx1 from the base address BAR 0, where the base address BAR 0 is recorded in a specified register of the input / output card, and the address of the specified register can be obtained by referring to the product manual of the input / output card;

[0087] Similarly, ADAPTOR_1_SQ1_CONSUMER_INDEX_ADDR represents the register address B for saving the consumer index value of the submission queue;

[0088] ADAPTOR_1_CQ1_PRODUCER_INDEX_ADDR represents the register address C for saving the producer index value of the completion queue;

[0089] ADAPTOR_1_CQ1_CONSUMER_INDEX_ADDR represents the register address D for saving the consumer index value of the completion queue.

[0090] Based on the above configuration file, in some embodiments, the steps of monitoring the performance of the input / output card under the Linux environment can include the following steps:

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

[0092] 2) Enter the directory / dev / mem and use mmap() to map the address of BAR 0 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 / output card;

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

[0097] 5) according to the specified time interval, access the producer index and consumer index values in the submission queue and completion queue of each input / output card, and generate performance monitoring results according to the obtained values.

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

[0099] determining the first speed difference in each time period according to the command write speed and the command read speed in the plurality of different time periods, and determining the second speed difference in each time period according to the result write speed and the result read speed in the plurality of different time periods;

[0100] generating the performance monitoring result of the input / output card according to the average value of the first speed difference in the plurality of different time periods and the average value of the second speed difference in the plurality of different time periods.

[0101] Through the average calculation, the result obtained is more accurate.

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

[0103] if the current performance pressure of the input / output card exceeds the pre-set performance pressure threshold, generating an alarm information.

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

[0105] For reference Figure 4 The module schematic diagram of the performance monitoring device provided by one embodiment of the present disclosure is shown. Figure 4 In the embodiment, the performance monitoring device includes:

[0106] The first speed acquisition module 401 is configured to acquire the command write speed of the host in the submission queue and the command read speed of the input / output card in the submission queue;

[0107] The second speed obtaining module 402 is configured to obtain a result write speed of the input / output card in the completion queue and a result read speed of the host in the completion queue.

[0108] The performance monitoring module 403 is configured to obtain a performance monitoring result of the input / output card according to a first speed difference between the command write speed and the command read speed and a second speed difference between the result write speed and the result read speed.

[0109] In some embodiments, for any one of the submission queue and the completion queue, the queue is a ring 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 first speed obtaining module 401 is specifically configured to:

[0110] determine a first command quantity written by the host into the submission queue between the first time point and the second time point according to a position difference identified by the producer index in the submission queue at the first time point and the second time point, and determine the command write speed according to the first command quantity and a time length between the first time point and the second time point;

[0111] determine a second command quantity read by the input / output card from the submission queue between the first time point and the second time point according to a position difference identified by the consumer index in the submission queue at the first time point and the second time point, and determine the command read speed according to the second command quantity and a time length between the first time point and the second time point;

[0112] and the second speed obtaining module 402 is specifically configured to:

[0113] determine a first result quantity written by the input / output card into the completion queue between the third time point and the fourth time point according to a position difference identified by the producer index in the completion queue at the third time point and the fourth time point, and determine the result write speed according to the first result quantity and a time length between the third time point and the fourth time point;

[0114] determine a second result quantity read by the host from the completion queue between the first time point and the second time point according to a position difference identified by the consumer index in the completion queue at the third time point and the fourth time point, and determine the result read speed according to the second result quantity and a time length between the third time point and the fourth time point.

[0115] In some embodiments, for any one of the producer index and the consumer index, the index identifies different positions in the queue through different index values, and the index values change in a circulating manner from small to large as the current data write position or the current data read position in the queue changes.

[0116] The queue has a queue length threshold value, which represents the minimum length of time 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] The performance monitoring module 403 determines 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 the two different time points before and after, and the time difference between the two time points is less than the queue length threshold value.

[0118] In some embodiments, for any one of the producer index and the consumer index, the index identifies different positions in the queue through different index values, and the index value changes in ascending order as the current data write position or data read position in the queue changes;

[0119] 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 the two different time points before and after, and is specifically configured to:

[0120] If the index value at the latter time point is greater than the index value at the former time point, the index value at the latter time point is subtracted from the index value at the former time point to obtain the required quantity to be determined;

[0121] If the index value at the latter time point is less than the index value at the former time point, the maximum index value of the index is subtracted from the absolute value of the difference between the index values at the two time points to obtain the required quantity to be determined;

[0122] If the index value at the latter time point is equal to the index value at the former time point, it is determined that the required quantity 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 different types of submission queues, and the one or more different types of submission queues have respective corresponding completion queues;

[0124] The first speed acquisition module 401 and the second speed acquisition module 402, before acquiring the command write speed, the command read speed, the result write speed and the result read speed, are further configured to:

[0125] From the specified configuration carrier, one or more of the following information is acquired: address information of the target register, queue length threshold value, address information of the input / output card to be executed for performance monitoring, queue identifier of the submission queue and the completion queue in the input / output card to be monitored for performance.

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

[0127] determine a first speed difference in each time period according to the command write speed and the command read speed in the time period, and determine a second speed difference in each time period according to the result write speed and the result read speed in the time period;

[0128] generate the performance monitoring result of the input / output card according to the average of the first speed differences in the plurality of different time periods and the average of the second speed differences in the plurality of different time periods.

[0129] In some embodiments, the performance monitoring result includes the current performance pressure of the input / output card.

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

[0131] generate an alarm information if the current performance pressure of the input / output card exceeds a pre-set performance pressure threshold.

[0132] The performance monitoring device of the input / output card in the embodiments is presented in the form of functional units. The units herein refer to ASIC (Application Specific Integrated Circuit) circuits, processors and memories executing 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 write speed of the host in the submission queue and the command read speed of the input / output card in the submission queue, and obtaining the result write speed of the input / output card in the completion queue and the result read 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 write speed and the command read speed, and the second speed difference between the result write speed and the result read speed. Since the implementation of performance monitoring does not modify the driver of the input / output card, the problem of introducing errors due to modification of the driver can be prevented, thereby achieving the purposes of reducing error introduction and improving performance monitoring reliability.

[0134] The embodiments of the present disclosure further provide an electronic device having the performance monitoring device of the input / output card as described above. Figure 4 The performance monitoring device of the input / output card is shown.

[0135] For reference Figure 5 , the structural schematic diagram of the electronic device provided by some embodiments of the present disclosure is shown. As Figure 5As shown, the electronic device includes one or more processors 10, memory 20, and interfaces 30 for connecting the various components, including high-speed interfaces and low-speed interfaces. The various components communicate over various buses, and can be mounted on a common motherboard or in other manners as appropriate. The processor(s) can process instructions for execution within the electronic device, including instructions stored in the memory or on storage to display graphical information for a GUI on an external input / output device, such as a display device coupled to the interface. In some alternative implementations, multiple processors and / or multiple buses can be employed as appropriate, as well as multiple memories and types of memory. Also, various components can be connected by various interfaces, not only the bus. In some implementations, for example, the interfaces can include a wireless bus, a Bluetooth bus, an Ethernet bus, a LAN, a WAN, a telecommunication bus, or a cellular bus. Figure 5 The processor 10 is taken as an example.

[0136] The processor 10 can be a first PCIe device, a network processor, or a combination thereof. The processor 10 can further include a hardware chip. The hardware chip can be an application specific integrated circuit, a programmable logic device, or a combination thereof. The programmable logic device can be a complex programmable logic device, a field programmable logic gate array, a generic array logic, or any combination thereof.

[0137] The memory 20 stores instructions executable by the at least one processor 10 to cause the at least one processor 10 to perform the method shown in the above embodiments.

[0138] The memory 20 can include a program region storing an operating system and application programs required by at least one function, and a data region storing data created according to the use of the electronic device. In addition, the memory 20 can include a high-speed random access memory, and can further include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some alternative implementations, the memory 20 can optionally include a memory disposed remotely with respect to the processor 10, which can be connected to the electronic device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.

[0139] The memory 20 can include a volatile memory, such as a random access memory, and can also include a non-volatile memory, such as a flash memory, a hard disk, or a solid state disk. The memory 20 can further include a combination of the above-mentioned types of memories.

[0140] The electronic device further includes a communication interface 30 for communication of the electronic device with other devices or communication networks.

[0141] The embodiments of the present disclosure further provide a computer readable storage medium, and the method according to the embodiments of the present disclosure can be implemented in hardware, firmware, or recorded in a storage medium, or be implemented as computer code originally stored in a remote storage medium or a non-transitory machine readable storage medium and downloaded through a network and stored in a local storage medium, so that the method described herein can be processed by such software on a storage medium using a general purpose computer, a special purpose processor, or programmable or special purpose hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk or a solid state disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that the computer, processor, 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 the computer, processor or hardware, the method shown in the above embodiments is implemented.

[0142] Part of the present disclosure can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present disclosure can be called or provided. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file, etc., accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer compiles the instructions and then executes the corresponding compiled program, or the computer reads and executes the instructions, or the computer reads and installs the instructions 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 are described in conjunction with the accompanying drawings, various modifications and changes can be made by those skilled in the art without departing from the spirit and scope of the present disclosure, and such modifications and changes fall 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 includes a submission queue and a completion queue, 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. For any queue 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. 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 write position or data read position in the queue changes, the index value changes cyclically in ascending order. The method includes: Obtaining 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; Obtaining a writing speed of the result of the input / output card in the completion queue and a reading speed of the result of the host in the completion queue; A 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 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: determining, based on a difference in positions of the producer index in the submission queue at a first time point and a second time point, a number of first commands written by the host to the submission queue between the first time point and the second time point, and determining a command writing speed based on the number of first commands and a duration between the first time point and the second time point; determining, based on a difference in positions identified by consumer indexes in the submission queue at the first time point and the second time point, a number of second commands read from the submission queue by the input / output card between the first time point and the second time point, and determining a command reading speed based on the number of second commands and a duration between the first time point and the second time point; Furthermore, 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: determining, based on a difference in positions identified by producer indexes in the completion queue at a third time point and a fourth time point, a 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 determining a result writing speed based on the number of first results and a duration between the third time point and the fourth time point; 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, the number of second results read by the host from the completion queue between the third time point and the fourth time point is determined, 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 queue of the submission queue and the completion queue, the queue has a queue duration threshold, where 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 number of commands, the second number of commands, the first number of results, and the second number of results 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 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 based on 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; 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 submission queues of different types, and the one or more submission queues of different types have respective 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: The following one or more information is obtained from the specified configuration carrier: the address information of the target register, the queue time threshold, the address information of the input / output card on which performance monitoring is required, and the queue identifiers of the submission queue and completion queue on which performance monitoring is required in the input / output card.

6. The method according to claim 1, characterized in that Generating the performance monitoring result of the input and output card includes: Determining 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 determining a second speed difference in each time period according to result writing speeds and result reading speeds in the plurality of different time periods; A performance monitoring result of the input / output card is generated according to an average value of the first speed differences within the multiple different time periods and an average value of the second speed differences within 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 / 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 pending 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. 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. For any 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 write position or data read position in the queue changes, the index value changes cyclically in ascending order. The device includes: A first speed acquisition module is used to 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; A second speed acquisition module 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; The performance monitoring module obtains 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.

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

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

    CN118778882A

  • Resizable and Relocatable Queue

    US20150355883A1