Request Retry Method, Device, Electronic Device and Storage Medium Based on CHI Protocol
By prioritizing the processing of the highest QoS level requests in the cache consistency management node HN-F and recording the number of competition failures, the problem of low-level transaction requests being starved to death is solved, HN-F deadlock is avoided, and the fairness and efficiency of request processing are improved.
Patent Information
- Application Number
- CN202410742971.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2025-07-25
- Estimated Expiration
- 2044-06-07
AI Technical Summary
In the CHI protocol, low-level transaction requests may starve to death, resulting in a cache consistency management node HN-F deadlock.
In the cache consistency management node HN-F, when multiple requests to be retryed, the requests of the highest QoS level are processed first, and the number of competition failures of each QoS level lower than the highest QoS level is recorded; when a new transaction is dequeued, if the number of competition failures of the first QoS level reaches a preset value, the number of failures of the first QoS level is processed and the number of failures of the first QoS level is cleared.
It avoids the starvation of low-level transaction requests, prevents the cache consistency management node HN-F deadlock, and improves the fairness and efficiency of request processing.
Smart Images

Figure CN118519776B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technologies, and in particular, to a request retry method, apparatus, electronic device, and storage medium based on the CHI protocol. Background Art
[0002] With the development of multi-core processors and system-on-chip (SoC), the number of concurrently executed tasks in the system has increased significantly, and these tasks usually have different performance requirements and priorities. Modern SoCs adopt a network-on-chip (NoC) architecture to connect multiple processor cores, caches, memory controllers, and other peripherals. Their complexity and diverse data traffic require more advanced traffic management and scheduling mechanisms to ensure efficient operation. As an important device responsible for managing and maintaining cache coherence, the cache coherence management node (HN-F) must have such a flow control function in the NoC.
[0003] In the CHI (Coherent Hub Interface) protocol, the QoS (Quality of Service) field is used to indicate the quality of service level of a request. This field can affect the processing priority of the request, ensuring that different types of requests can be appropriately scheduled and processed according to the requirements of the system design. The QoS field is represented by 4 bits, so its value can be divided into multiple priority levels, from high to low, for example, 0 to 15, where 15 represents the highest priority and 0 represents the lowest priority. High-priority requests will be processed first to ensure that critical tasks can obtain system data in a timely manner.
[0004] When implementing the retry mechanism, HN-F must consider the QoS field. According to the CHI protocol, when a transaction arrives at HN-F, HN-F must determine whether it has resources to process the current transaction request. If the processing of transactions has reached the upper limit, the Retry mechanism will be triggered to notify the request node (RN) of the upper-layer sending task to wait until there is an idle position in HN-F and then resend the current request. Figure 1 It is an interaction diagram for request retry in the prior art. As Figure 1 shown, the steps from sending a request to performing request retry include the following:
[0005] (1) RN sends a new request (AllowRetry field is 1) to reach HN-F;
[0006] (2) HN-F discovers that it has no available resources;
[0007] (3) HN-F records the information of this request and replies to RN with a response of type RetryAck. The RetryAck response is used to notify RN that the current request has not been queued and needs to be resent after HN-F has resources;
[0008] (4) After receiving the RetryAck, RN knows that HN-F's resources are busy. At this time, new requests should not be sent again, and it waits for the PcrdGrant response from HN-F. The PcrdGrant response is used to notify RN that HN-F has an idle position and the previously Retried request can be resent;
[0009] (5) When a processed transaction dequeues in HN-F, if it is found that there were previously Retried requests, select a request according to the priority, reserve this part of the resources and send a PcrdGrant response to the RN;
[0010] (6) After receiving the PcrdGrant response, RN resends the request (AllowRetry field is 0) to HN-F. At this time, HN-F must ensure that it can be successfully queued without being Retried.
[0011] In the above step (5), when a transaction dequeues in HN-F, it is particularly crucial to determine which Retry requests should be processed first. If high-level transactions are always selected to send PcrdGrant, then low-level transaction requests may be starved forever, and even cause a deadlock in HN-F. Summary of the Invention
[0012] Embodiments of the present application provide a request retry method, device, electronic device, and storage medium based on the CHI protocol, which helps to solve the problem of low-level transaction requests being starved and avoid causing a deadlock in HN-F.
[0013] To solve the above problems, in a first aspect, embodiments of the present application provide a request retry method based on the CHI protocol, which is applied to a cache coherence management node and includes:
[0014] When a transaction dequeues, process the Retry request with the highest QoS level among multiple Retry requests, and record the number of competition failures for each QoS level lower than the highest QoS level;
[0015] When a new transaction dequeues, if the number of competition failures of the first QoS level among the QoS levels reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there are retry requests of the second QoS level, process the retry requests of the first QoS level and clear the number of competition failures corresponding to the first QoS level, where the first QoS level is lower than the second QoS level, and the second QoS level is the highest QoS level among the retry requests when the new transaction dequeues.
[0016] In a second aspect, an embodiment of the present application provides a request retry device based on the CHI protocol, which is applied to a cache coherence management node and includes:
[0017] A first request processing module, configured to process the retry request with the highest QoS level among multiple retry requests when a transaction dequeues, and record the number of competition failures of each QoS level lower than the highest QoS level;
[0018] A second request processing module, configured to, when a new transaction dequeues, if the number of competition failures of the first QoS level among the QoS levels reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there are retry requests of the second QoS level, process the retry requests of the first QoS level and clear the number of competition failures corresponding to the first QoS level, where the first QoS level is lower than the second QoS level, and the second QoS level is the highest QoS level among the retry requests when the new transaction dequeues.
[0019] In a third aspect, an embodiment of the present application further provides an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor implements the request retry method based on the CHI protocol described in the embodiments of the present application when executing the computer program.
[0020] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, the steps of the request retry method based on the CHI protocol disclosed in the embodiments of the present application are implemented.
[0021] The request retry method, apparatus, electronic device, and storage medium based on the CHI protocol provided by the embodiments of the present application, when a transaction dequeues, process the retry request with the highest QoS level among multiple retry requests to be processed, and record the number of competition failures for each QoS level lower than the highest QoS level. When a new transaction dequeues, if the number of competition failures for the first QoS level among each QoS level reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there are retry requests for the second QoS level, where the second QoS level is the highest QoS level among the retry requests when the new transaction dequeues, then process the retry request for the first QoS level. In this way, by recording the number of competition failures for the lower-level retry requests, when the number of competition failures reaches the preset value for blocking the higher-level retry requests, the lower-level retry requests can be processed, solving the problem of starvation of low-level transaction requests and avoiding deadlocks in the cache coherence management node. Description of the Drawings
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0023] Figure 1 is an interaction diagram for request retry in the prior art;
[0024] Figure 2 is a flowchart of a request retry method based on the CHI protocol provided by the embodiments of the present application;
[0025] Figure 3 is a schematic diagram of the retry requests recorded by HN-F in the embodiments of the present application;
[0026] Figure 4 is a schematic structural diagram of a request retry apparatus based on the CHI protocol provided by the embodiments of the present application;
[0027] Figure 5 is a schematic structural diagram of an electronic device provided by the embodiments of the present application. Detailed Embodiments
[0028] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are some, but not all, of the embodiments of the present application. All other embodiments obtained by those of ordinary skill in the art without creative efforts based on the embodiments of the present application belong to the scope of protection of the present application.
[0029] Figure 2 It is a flowchart of a request retry method based on the CHI protocol provided by an embodiment of the present application. The request retry method based on the CHI protocol is applied to a cache coherence management node (HN-F), as Figure 2 shown, the method includes: step 210 to step 220.
[0030] Step 210, when there is a transaction dequeued, process the retry request with the highest QoS level among multiple retry requests to be processed, and record the number of competition failures for each QoS level lower than the highest QoS level.
[0031] When the cache coherence management node receives a request, it needs to determine whether it has resources to process the current transaction request. If its own transaction processing has reached the upper limit, that is, there are no resources to process the newly received request, the Retry mechanism will be triggered at this time, notifying the upper-layer RN that sent the request to wait until the cache coherence management node has an idle position and then resend the current request. This request is used as a retry request to be processed, and the QoS level of this request is recorded. Among them, the cache coherence management node (HN-F) is a key component in the cache coherence protocol, responsible for managing and maintaining cache coherence. The RN is the node that initiates the request in the CHI protocol, usually a processor core, a DMA (Direct Memory Access) engine, or other devices that can initiate memory access requests. QoS is a field in the request in the CHI protocol, used to distinguish the quality of service of the request.
[0032] When a transaction is processed and dequeued in the cache coherence management node, there is an idle position in the cache coherence management node, and other requests can be processed. At this time, if there is only one retry request to be processed, the retry request can be directly processed. If there are multiple retry requests to be processed, a retry request to be processed needs to be selected from all the retry requests to be processed. When selecting the retry request to be processed, the retry request with the current highest QoS level can be selected from all the retry requests to be processed. This highest QoS level is the highest QoS level among the current retry requests to be processed, rather than necessarily the highest QoS level among all QoS levels, and the selected retry request to be processed is processed, that is, a PcrdGrant response is sent to the RN of the retry request to be processed, notifying the RN that it can resend the request now. HN-F will reserve this resource until it receives the request from this RN. At this time, the request will definitely not be Retried. The other retry requests to be processed fail in this competition, and the number of competition failures corresponding to the QoS levels of these retry requests to be processed that fail in the competition is recorded and updated. During this period, newly received requests need to be Retried and participate in subsequent competitions as retry requests to be processed.
[0033] In an embodiment of the present application, recording the number of contention failures of each QoS level lower than the highest QoS level includes: recording the number of contention failures of each QoS level through a counter corresponding to each QoS level.
[0034] For each level below the highest QoS level among all QoS levels that the cache coherence management node can receive requests for, a corresponding counter is set respectively. The number of contention failures of the corresponding QoS level is recorded through the counter. The highest QoS level does not need to be recorded because the highest level has the highest priority and does not need to block other levels. For example, the requests that the cache coherence management node can receive can have four levels: low level, medium level, high level, and highest level. The highest level does not need to set a counter, and counters are set for the low level, medium level, and high level respectively.
[0035] Step 220, when a new transaction dequeues, if the number of contention failures of the first QoS level among the QoS levels reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there are pending retry requests for the second QoS level, process the pending retry requests for the first QoS level and clear the number of contention failures corresponding to the first QoS level, where the first QoS level is lower than the second QoS level, and the second QoS level is the highest QoS level among the pending retry requests when the new transaction dequeues.
[0036] Among them, when a new transaction dequeues, all pending retry requests include pending retry requests for the first QoS level and the second QoS level, and the second QoS level is the current highest QoS level.
[0037] In the above manner, when a transaction dequeues, the pending retry request with the highest level among all current pending retry requests is preferentially selected until the highest QoS level among all current pending retry requests is the second QoS level, and the number of contention failures of the first QoS level among the QoS levels of all current pending retry requests reaches the first preset value corresponding to the first QoS level blocking the second QoS level. At this time, process the pending retry request for the first QoS level, and when the second QoS level is not the highest level among the requests that the cache coherence management node can process, update the number of contention failures for the second QoS level. If there are multiple pending retry requests for the first QoS level, the polling strategy can be adopted in the order of arrival of the requests at the cache coherence management node, starting from the time order of the requests that occur Retry and reaching the cache coherence management node, selecting the first request that reaches the cache coherence management node found, and then sequentially selecting from the current pending retry requests backward.
[0038] The request retry method based on the CHI protocol provided in this embodiment processes the retry request with the highest QoS level among multiple retry requests to be retried when a transaction dequeues, and records the number of competition failures for each QoS level lower than the highest QoS level. When a new transaction dequeues, if the number of competition failures for the first QoS level among each QoS level reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there is a retry request for the second QoS level, where the second QoS level is the highest QoS level among the retry requests when the new transaction dequeues, the retry request for the first QoS level is processed at this time. In this way, by recording the number of competition failures of the retry requests with lower levels, when the number of competition failures reaches the preset value for blocking the retry requests with higher levels, the retry requests with lower levels can be processed, solving the problem of starvation of low-level transaction requests and avoiding deadlocks in the cache coherence management node.
[0039] Based on the above technical solution, the recording of the number of competition failures for each QoS level lower than the highest QoS level includes: recording the number of competition failures for each QoS level lower than the highest level and higher than or equal to the QoS level of the dequeued transaction.
[0040] When a transaction dequeues, based on the QoS level of the dequeued transaction, select the retry request with the highest QoS level among multiple retry requests to be retried for processing, and the highest QoS level is higher than the QoS level of the dequeued transaction. Record the number of competition failures for each QoS level higher than or equal to the QoS level of the dequeued transaction and lower than the highest level. For the QoS levels lower than the QoS level of the dequeued transaction, there is no need to record the corresponding number of competition failures. That is to say, when the number of competition failures for each QoS level has not reached the threshold for blocking higher levels, if the QoS level of the dequeued transaction is M and the arbitration success level is N, N can be equal to M, record the number of competition failures for all levels greater than or equal to level M and lower than level N. For example, if there are four levels of transactions X, Y, Z, W to be retried (i.e., retry requests), and their QoS level relationship is X>Y>Z>W, when the dequeued transaction level is Z and Y is successfully arbitrated, record that Z fails once; if there are four levels of transactions X, Y, Z, W to be retried, and their QoS level relationship is X>Y>Z>W, when the dequeued transaction level is Z and X is successfully arbitrated, record that Y and Z each fail once. Among them, arbitration refers to selecting which retry request to process, that is, determining a retry request to be processed at one time.
[0041] Each QoS level for recording the number of competition failures is the QoS level of the current retry request with a corresponding retry request.
[0042] By recording the number of competition failures for each QoS level that is lower than the highest level and higher than or equal to the QoS level of the dequeued transaction, the QoS levels lower than the QoS level of the dequeued transaction do not need to be recorded, which can ensure the fairness of resource allocation and further improve the processing efficiency of requests.
[0043] In an embodiment of the present application, when there is a transaction dequeued, processing the retry request with the highest QoS level among multiple retry requests to be retried includes: when there is a transaction dequeued, if there are multiple retry requests with the highest QoS level, then processing the retry request with the smallest request reception time among the multiple retry requests with the highest QoS level.
[0044] Among them, the request reception time is the time when the retry request arrives at the cache coherence management node.
[0045] When there is a transaction dequeued and there are multiple retry requests with the highest QoS level, at this time, a polling strategy can be adopted according to the order in which the retry requests arrive at the cache coherence management node, and selection starts in the order of the time when the requests that occur Retry arrive at the cache coherence management node. Select the first retry request that arrives at the cache coherence management node among the queried ones, that is, select the retry request with the smallest request reception time among the multiple retry requests with the highest QoS level, and process the selected retry request. Subsequently, select from the current retry requests in sequence backward. This can ensure that the retry requests that arrive earlier are processed first.
[0046] In another embodiment of the present application, when there is a transaction dequeued, processing the retry request with the highest QoS level among multiple retry requests to be retried includes: when there is a transaction dequeued, if there are multiple retry requests with the highest QoS level, determining the retry request to be processed according to the distance between the cache coherence management node and the request nodes of each retry request and the request reception time, and processing the determined retry request to be processed.
[0047] In a large NoC network, the RN may be at different distances from the cache coherence management node. The order in which requests arrive at the cache coherence management node is not necessarily the order in which the RNs are sent out. At this time, the retry request to be processed among multiple retry requests with the same QoS level can be determined according to the distance between the RN and the cache coherence management node and the request reception time of the retry request, so as to more reasonably arrange the processing order of multiple retry requests with the same QoS level.
[0048] Exemplarily, when the request reception times of two requests to be retried are relatively close, and the RN of one request to be retried is far from the cache coherence management node while the other request to be retried is close to the cache coherence management node, the request to be retried with a later request reception time can be selected for processing. For example, for the same QoS level, there are two requests to be retried, and the RNs of these two requests to be retried are RN0 and RN1 respectively. It is found that the request to be retried with RN0 arrives at the cache coherence management node earlier than the request to be retried with RN1, but RN0 is closer to the cache coherence management node. At this time, RN1 can be selected for processing instead of RN0.
[0049] Based on the above technical solution, when a new transaction dequeues, if the number of competition failures of the first QoS level among the QoS levels reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there is a request to be retried of the second QoS level, processing the request to be retried of the first QoS level includes: when a new transaction dequeues, if the number of competition failures of the first QoS level reaches the first preset value corresponding to the first QoS level blocking the second QoS level, the number of competition failures of the third QoS level reaches the second preset value corresponding to the third QoS level blocking the second QoS level, and there is a request to be retried of the second QoS level, processing the request to be retried of the first QoS level, where the first QoS level is lower than the third QoS level, the third QoS level is lower than the second QoS level, and the first preset value is greater than the second preset value.
[0050] When a new transaction dequeues, the highest QoS level among the current requests to be retried is the second QoS level. At this time, the number of competition failures of the first QoS level reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and the number of competition failures of the third QoS level reaches the second preset value corresponding to the third QoS level blocking the second QoS level. At this time, the request to be retried of the first QoS level can be preferentially processed, which can further avoid the problem that requests with a low QoS level are starved.
[0051] Based on the above technical solution, after processing the request to be retried of the first QoS level, it further includes: recording the number of competition failures of each QoS level other than the first QoS level and the absolute highest QoS level in the QoS levels higher than or equal to the QoS level of the dequeued new transaction, where the absolute highest QoS level is the highest QoS level that the cache coherence management node can process requests.
[0052] When a retry - pending request with a lower QoS level blocks a retry - pending request with a higher QoS level, it is necessary to record the number of competitive failures corresponding to each QoS level that is higher than or equal to the QoS level of the dequeued new transaction. However, since the first QoS level is the level of successful arbitration, it is no longer recorded, and the absolute highest level is the highest level among the requests that the cache coherence management node can handle, so it also does not need to be recorded. That is to say, if the QoS level of the dequeued new transaction is M, and the successful arbitration level (i.e., the first QoS level) is N, where N can be equal to M, record the number of competitive failures of all retry - pending requests with a level greater than or equal to M (except for level N and the highest level). For example, there are retry - pending requests with four QoS levels X, Y, Z, and W. If the QoS level of the dequeued new transaction is W, and the QoS level Z is successfully arbitrated (Z blocks X and Y), then record that Y and W each fail once.
[0053] When the number of competitive failures of a retry - pending request with a low QoS level reaches a certain number threshold, it can block a retry - pending request with a high QoS level. For a high QoS level, when two or more low QoS levels simultaneously reach the number threshold for blocking this high QoS level, among these two or more low QoS levels, in the order from high to low according to the QoS level, the number threshold gradually increases. For example, the 4 - bit QoS levels that the cache coherence management node can receive can be divided into four levels: low level, medium level, high level, and highest level. The arbitration priorities of each level are shown in Table 1. It can be seen that for a lower level blocking the same higher level, the lower the level, the higher the number threshold, and the higher the arbitration priority of this level.
[0054] Table 1 Arbitration Priority
[0055]
[0056]
[0057] The following is an example for illustration with reference to the four levels and the corresponding arbitration priorities shown in Table 1.
[0058] Take an example where there are 8 RNs (RN0 - RN7) and a cache coherence management node (HN - F) in a NoC system. The available resources of HN - F are 32, that is, it can receive at most 32 transactions for simultaneous processing. Suppose that at a certain time, the 32 resource pools of HN - F are full, and these 32 resource pools are occupied by 2 highest - level requests, 6 high - level requests, 8 medium - level requests, and 16 low - level requests respectively.
[0059] At this time, RN0 to RN7 each sent a request to HN-F. Among them, the QoS level of the request sent by RN0 is medium, the QoS levels of the requests sent by RN1 and RN2 are both the highest level, and the QoS levels of the requests sent by RN3 to RN7 are all high levels. When these eight requests reached HN-F respectively, there was no dequeued transaction at HN-F. Immediately, these eight requests triggered the Retry mechanism of HN-F respectively. HN-F sent RetryAck responses to RN0 to RN7 respectively, and noted that there were request transactions to be retried for RN0 to RN7 at present. The schematic diagram of the requests to be retried recorded by HN-F is as shown in Figure 3 shown.
[0060] After a period of time, a medium-level transaction dequeued at HN-F. At this time, HN-F had idle medium-level resources. Since there were the highest-level requests among the requests waiting to be retried, the highest-level requests would be preferentially selected for retry. The high-level and medium-level requests to be retried failed in the competition, and the high-level and medium-level counters were each incremented by 1. After querying, HN-F learned that there were two RNs with the highest level among the requests to be retried, namely RN1 and RN2 (assuming that the order of arrival of the previous requests at HN-F was RN1 earlier than RN2). Therefore, the polling strategy was adopted, starting from RN1, the first to reach HN-F, for selection. HN-F sent a PcrdGrant response to RN1, notifying RN1 that it could now resend the request. HN-F would reserve this resource until it received the request from RN1. At this time, the request would definitely not be retried.
[0061] After another period of time, HN-F dequeued a low-level transaction. Similarly, HN-F preferentially selected the highest-level requests among the requests to be retried. HN-F chose to send a PcrdGrant response to RN2. The high-level and medium-level requests to be retried failed in the competition again, and the high-level and medium-level counters were incremented by 1 again. If a low-level request to be retried was received before HN-F dequeued this low-level transaction, then the low-level request to be retried also failed in the competition at this time, and the low-level counter also needed to be incremented by 1.
[0062] Subsequently, another 3 transactions dequeued from HN-F. These 3 transactions are all low-priority transactions. HN-F will preferentially select 3 high-priority requests from the requests to be retried, and in chronological order, selects RN3, RN4, and RN5. At this time, PcrdGrant responses are sent to RN3, RN4, and RN5 respectively. Since the high-priority requests are selected, the high-priority counter is reset to 0, while the medium-priority requests failed in all three competitions, so the counter has been incremented to 5. If low-priority requests to be retried were received before the previous dequeue of low-priority transactions, and the low-priority requests to be retried also failed in all three competitions at this time, then the low-priority counter also needs to be incremented by 3, and the count value of the low-priority counter is 4 at this time.
[0063] Finally, at the sixth time, HN-F dequeued a medium-priority transaction. At this time, although there are still 2 high-priority requests in HN-F to be retried, since the medium-priority counter has been incremented to 5, reaching the threshold of the number of times that medium-priority blocks high-priority, the medium-priority blocks the high-priority, and at this time, the medium-priority requests in the requests to be retried will be selected, and the medium-priority counter is reset to 0. At the same time, since the high-priority requests to be retried failed in the competition, the high-priority counter is incremented by 1. HN-F queries that the only medium-priority request in the requests to be retried is RN0, so HN-F sends a PcrdGrant response to RN0, and HN-F will retain this resource until it receives the request from RN0.
[0064] It can be seen that when the count value of the medium-priority counter (i.e., the number of competition failures) reaches the threshold of the number of times that medium-priority blocks high-priority, medium-priority requests will be selected for processing, avoiding low-priority requests from being starved.
[0065] When HN-F dequeues a medium-priority transaction for the sixth time, if the counter method is not used (i.e., in the traditional way), HN-F will continue to select high-priority requests to be retried, and medium-priority requests will be selected when the next transaction dequeues. However, if HN-F continuously receives multiple new high-priority requests at this time, then the medium-priority requests will be delayed in selection again, and even due to the association between requests, lower-priority requests may be starved forever. By using the method of this application embodiment, lower-priority requests can be selected when the number of competition failures of lower-priority reaches the threshold of blocking high-priority, avoiding lower-priority requests from being starved.
[0066] For ease of understanding, taking requests to be retried with four QoS levels of X, Y, Z, and W as an example for further illustration. The priority relationship of these four QoS levels is X>Y>Z>W, and X is the highest level among the requests processed by the cache coherence management node. For the update of the counter, there are the following situations:
[0067] When the dequeued transaction level is X and the arbitration of X is successful, there is no need to record (because X is the highest level among the requests processed by the cache coherence management node, and no counter is set for the highest level);
[0068] When the dequeued transaction level is Y and the arbitration of X is successful, record that Y fails once;
[0069] When the dequeued transaction level is Y and the arbitration of Y is successful (Y blocks X), there is no need to record;
[0070] When the dequeued transaction level is Z and the arbitration of X is successful, record that Y and Z each fail once;
[0071] When the dequeued transaction level is Z and the arbitration of Y is successful, record that Z fails once;
[0072] When the dequeued transaction level is Z and the arbitration of Z is successful (Z blocks X and Y), record that Y fails once;
[0073] When the dequeued transaction level is W and the arbitration of X is successful, record that Y, Z, and W each fail once;
[0074] When the dequeued transaction level is W and the arbitration of Y is successful (Y blocks X), record that Z and W each fail once;
[0075] When the dequeued transaction level is W and the arbitration of Z is successful (Z blocks X and Y), record that Y and W each fail once;
[0076] When the dequeued transaction level is W and the arbitration of W is successful (W blocks X, Y, and Z), record that Y and Z each fail once.
[0077] The embodiment of the present application uses a counting method. Except for the highest level, a counter is set for each level. After a level fails in competition each time, the priority level is upgraded by accumulating the counter to reach the set number threshold, blocking the priority of requests at a higher level, so that transaction requests at a lower level can be selected. At the same time, when the selected level includes multiple requests to be retried, a polling strategy is adopted to traverse the RN in the order of arrival of the requests at the HN-F, solving the situation where low-level transactions in the Retry mechanism may be starved.
[0078] Figure 4 It is a schematic structural diagram of a request retry device based on the CHI protocol provided by the embodiment of the present application. The request retry device based on the CHI protocol is applied to a cache coherence management node, such as Figure 4 shown, the device includes:
[0079] The first request processing module 410 is used to process the retry request with the highest QoS level among multiple retry requests when a transaction dequeues, and record the number of competition failures for each QoS level lower than the highest QoS level.
[0080] The second request processing module 420 is used to, when a new transaction dequeues, if the number of competition failures for the first QoS level among the QoS levels reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there are retry requests for the second QoS level, process the retry requests for the first QoS level and clear the number of competition failures corresponding to the first QoS level, where the first QoS level is lower than the second QoS level, and the second QoS level is the highest QoS level among the retry requests when the new transaction dequeues.
[0081] Optionally, the first request processing module includes:
[0082] The failure count recording unit is used to record the number of competition failures for each QoS level that is lower than the highest level and higher than or equal to the QoS level of the dequeued transaction.
[0083] Optionally, the first request processing module includes:
[0084] The first request processing unit is used to, when a transaction dequeues, if there are multiple retry requests for the highest QoS level, process the retry request with the smallest request reception time among the multiple retry requests for the highest QoS level.
[0085] Optionally, the first request processing module includes:
[0086] The second request processing unit is used to, when a transaction dequeues, if there are multiple retry requests for the highest QoS level, determine the retry request to be processed according to the distance between the cache coherence management node and the request nodes of each retry request and the request reception time, and process the retry request to be processed.
[0087] Optionally, the second request processing module includes:
[0088] A third request processing unit, configured to, when a new transaction dequeues, if the number of competition failures at the first QoS level reaches a first preset value corresponding to the first QoS level blocking the second QoS level, the number of competition failures at the third QoS level reaches a second preset value corresponding to the third QoS level blocking the second QoS level, and there are pending retry requests at the second QoS level, process the pending retry requests at the first QoS level, where the first QoS level is lower than the third QoS level, the third QoS level is lower than the second QoS level, and the first preset value is greater than the second preset value.
[0089] Optionally, the first request processing module includes:
[0090] A counter recording unit, configured to record the number of competition failures at each QoS level through counters corresponding to each QoS level.
[0091] The request retry device based on the CHI protocol provided by an embodiment of the present application is used to implement the steps of the request retry method based on the CHI protocol described in the embodiments of the present application. For the specific implementation manners of the modules of the device, refer to the corresponding steps and will not be elaborated here.
[0092] The request retry device based on the CHI protocol provided by an embodiment of the present application, when a transaction dequeues, processes the pending retry request with the highest QoS level among multiple pending retry requests, and records the number of competition failures at each QoS level lower than the highest QoS level. When a new transaction dequeues, if the number of competition failures at the first QoS level among each QoS level reaches a first preset value corresponding to the first QoS level blocking the second QoS level, and there are pending retry requests at the second QoS level, and the second QoS level is the highest QoS level among the pending retry requests when the new transaction dequeues, at this time, process the pending retry requests at the first QoS level. In this way, by recording the number of competition failures of the pending retry requests at the lower level, when the number of competition failures reaches the preset value for blocking the pending retry requests at the higher level, the pending retry requests at the lower level can be processed, solving the problem that low-level transaction requests are starved to death and avoiding deadlocks in the cache coherence management node.
[0093] Figure 5 It is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 5 shown, the electronic device 500 may include one or more processors 510 and one or more memories 520 connected to the processors 510. The electronic device 500 may further include an input interface 530 and an output interface 540 for communicating with another device or system. The program code executed by the processor 510 may be stored in the memory 520.
[0094] The processor 510 in the electronic device 500 calls the program code stored in the memory 520 to execute the request retry method based on the CHI protocol in the above embodiments.
[0095] An embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the request retry method based on the CHI protocol as described in the embodiments of the present application are implemented.
[0096] Each embodiment in this specification is described in a progressive manner. The key point of each embodiment is to illustrate the differences from other embodiments. The same or similar parts among the embodiments can be referred to each other. For the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the description of the method embodiments.
[0097] The above has introduced in detail a request retry method, device, electronic device and storage medium based on the CHI protocol provided by the embodiments of the present application. Specific examples are used in this article to elaborate on the principle and implementation manner of the present application. The description of the above embodiments is only used to help understand the method and its core idea of the present application; at the same time, for those of ordinary skill in the art, according to the idea of the present application, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present application.
[0098] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on such an understanding, the above technical solution, in essence, or the part that contributes to the prior art can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disc, etc., and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
Claims
1. A request retry method based on the CHI protocol, characterized in that, Applied to a cache coherence management node, including: When a transaction dequeues, process the retry request with the highest QoS level among multiple retry requests to be retried, and record the number of competition failures for each QoS level lower than the highest QoS level; When a new transaction dequeues, if the number of competition failures for the first QoS level among the QoS levels reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there is a retry request for the second QoS level, process the retry request for the first QoS level and clear the number of competition failures corresponding to the first QoS level, where the first QoS level is lower than the second QoS level, and the second QoS level is the highest QoS level among the retry requests when the new transaction dequeues; After processing the retry request for the first QoS level, it further includes: recording the number of competition failures for each QoS level higher than or equal to the QoS level of the dequeued new transaction except the first QoS level and the absolute highest QoS level, where the absolute highest QoS level is the highest QoS level that the cache coherence management node can process requests.
2. The method according to claim 1, characterized in that, The recording the number of competition failures for each QoS level lower than the highest QoS level includes: Recording the number of competition failures for each QoS level lower than the highest level and higher than or equal to the QoS level of the dequeued transaction.
3. The method according to claim 1, wherein The processing the retry request with the highest QoS level among multiple retry requests when a transaction dequeues includes: When a transaction dequeues, if there are multiple retry requests with the highest QoS level, process the retry request with the earliest request reception time among the multiple retry requests with the highest QoS level.
4. The method according to claim 1, wherein The processing the retry request with the highest QoS level among multiple retry requests when a transaction dequeues includes: When a transaction dequeues, if there are multiple retry requests with the highest QoS level, determine the retry request to be processed based on the distance between the cache coherence management node and the request nodes of each retry request and the request reception time, and process the determined retry request.
5. The method according to any one of claims 1-4, characterized in that, The processing the retry request for the first QoS level when a new transaction dequeues, if the number of competition failures for the first QoS level among the QoS levels reaches the first preset value corresponding to the first QoS level blocking the second QoS level, and there is a retry request for the second QoS level, includes: When a new transaction dequeues, if the number of competition failures for the first QoS level reaches the first preset value corresponding to the first QoS level blocking the second QoS level, the number of competition failures for the third QoS level reaches the second preset value corresponding to the third QoS level blocking the second QoS level, and there is a retry request for the second QoS level, process the retry request for the first QoS level, where the first QoS level is lower than the third QoS level, the third QoS level is lower than the second QoS level, and the first preset value is greater than the second preset value.
6. The method according to any one of claims 1 to 4, characterized in that, Recording the number of competition failures for each QoS level lower than the highest QoS level, including: Recording the number of competition failures for each QoS level through a counter corresponding to each QoS level.
7. A request retry device based on the CHI protocol, characterized in that, Applied to the cache coherence management node, including: A first request processing module, configured to, when a transaction dequeues, process the retry request with the highest QoS level among multiple retry requests to be processed, and record the number of competition failures for each QoS level lower than the highest QoS level; A second request processing module, configured to, when a new transaction dequeues, if the number of competition failures for the first QoS level among the QoS levels reaches a first preset value corresponding to the first QoS level blocking the second QoS level, and there is a retry request for the second QoS level, process the retry request for the first QoS level, and clear the number of competition failures corresponding to the first QoS level, where the first QoS level is lower than the second QoS level, and the second QoS level is the highest QoS level among the retry requests when the new transaction dequeues. After processing the retry request for the first QoS level, it further includes: recording the number of competition failures for each QoS level higher than or equal to the QoS level of the dequeued new transaction except the first QoS level and the absolute highest QoS level, and the absolute highest QoS level is the highest QoS level that the cache coherence management node can process requests.
8. The device according to claim 7, characterized in that, The first request processing module includes: A failure count recording unit, configured to record the number of competition failures for each QoS level lower than the highest level and higher than or equal to the QoS level of the dequeued transaction.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the request retry method based on the CHI protocol according to any one of claims 1 to 6.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps of the request retry method based on the CHI protocol according to any one of claims 1 to 6.
Citation Information
Patent Citations
Priority comparator and priority comparison method
CN101710294A