Data reading method, device and multi-core processor

By introducing a listening request mechanism into the multiprocessor core architecture, the problem of read request conflict between cache agents is solved, and the stability and efficiency of data reading are improved.

CN113168400BActive Publication Date: 2025-02-28HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201880099938.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2018-12-26
Publication Date
2025-02-28
Estimated Expiration
2038-12-26

AI Technical Summary

Technical Problem

In a multiprocessor core architecture, read requests between cache agents may lead to conflicts, resulting in out-of-order messages and invalid permissions during data reading.

Method used

By introducing a listening request mechanism between the cache proxy and the local proxy, the cache proxy suspends the listening request until it receives a read reply before responding, thereby avoiding read request conflicts.

Benefits of technology

It ensures that while ensuring cache consistency, the processing of each request is completed in turn, solving the problem of read request conflicts and improving the stability and efficiency of data reading.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113168400B_ABST
    Figure CN113168400B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides a data reading method, device and multi-core processor, wherein the method includes: a first CA sends a first exclusive read request to a HA, the first exclusive read request is used to instruct the HA to update the state of the target data to the first CA exclusive state; before receiving the first exclusive read response to the first exclusive read request, if the first CA receives a first listening request sent by the HA and determines that the state of the target data is the first CA exclusive state according to the first listening request, the first listening request is suspended; after receiving the first exclusive read response, the first CA updates the read and write permissions of the target data according to the first listening request, and sends the first listening response to the HA. The above method is used to solve the read request conflict while ensuring cache consistency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to a data reading method, device and multi-core processor. Background Art

[0002] In order to improve the performance of processors, more and more processors adopt a multi-processor core architecture. In processors that adopt a multi-processor core architecture, each processor core is usually configured with a corresponding cache agent (CA). The processor core quickly reads and writes data from the corresponding CA, and the home agent (HA) can manage the read and write permissions of multiple CAs to the data. For example, CA1 can send an exclusive read request to HA to request exclusive permission (a type of read and write permission) to the target data. HA receives CA1's exclusive read request, provides CA1 with the target data according to CA1's exclusive read request, and instructs other CAs to invalidate the cached target data, so that CA1 obtains exclusive permission to the target data.

[0003] However, since different CAs can independently send read requests to the same HA, a read request conflict may occur during the data reading process of CA. For example, HA receives an exclusive read request sent by CA1, and provides the target data to CA1 according to the exclusive read request, and instructs other CAs to invalidate the cached target data. Afterwards, HA receives an exclusive read request sent by CA2, and HA instructs CA1 to provide the target data to CA2 according to the exclusive read request, and instructs CA1 to invalidate the cached target data. Since messages may be out of order between CA1 and HA, after sending the exclusive read request, CA1 may receive a request from HA instructing CA1 to invalidate the target data before receiving the target data. At this time, a read request conflict occurs at CA1. Summary of the invention

[0004] The present application provides a data reading method, device and multi-core processor, which are used to provide a read request conflict processing mechanism.

[0005] In a first aspect, an embodiment of the present application provides a data reading method, including: a first cache agent CA sends a first exclusive read request to a local agent HA, where the first exclusive read request is used to instruct HA to update the status of target data to a first CA exclusive status; before receiving a first exclusive read response to the first exclusive read request, if the first CA receives a first listening request sent by HA and determines that the status of the target data is the first CA exclusive status based on the first listening request, the first listening request is suspended; after receiving the first exclusive read response, the first CA updates the read and write permissions to the target data based on the first listening request, and sends the first listening response to HA.

[0006] By adopting the above scheme, when the first listening request received by the first CA conflicts with the first exclusive read request sent by the first CA, the first CA suspends the first listening request and responds to the first listening request after receiving the first exclusive read response of the first exclusive read request, so that the processing of each request can be completed in sequence while ensuring cache consistency, thereby resolving the read request conflict.

[0007] Based on the first aspect, in a possible implementation, the first CA may update the read and write permissions to the target data by the following method, including: if the first listening request is an exclusive listening request, the first CA updates the read and write permissions to the target data to invalid permissions; if the first listening request is a shared listening request, the first CA updates the read and write permissions to the target data to shared permissions; if the first listening request is an invalid listening request, the first CA updates the read and write permissions to the target data to exclusive permissions.

[0008] In a second aspect, an embodiment of the present application provides a data reading method, including: a local agent HA receives a first exclusive read request sent by a first cache agent CA; HA updates the status of the target data to the first CA exclusive status according to the first exclusive request; if HA receives a second read request from the second CA, it sends a first listening request to the first CA according to the status of the target data; the first listening request is used to indicate that if the first CA determines that the status of the target data is the first CA exclusive status according to the first listening request, it suspends the first listening request, and, after receiving the first exclusive read response, updates the read and write permissions to the target data according to the first listening request; HA receives the first listening response returned by the first CA according to the first listening request, and updates the status of the target data; HA sends a second read response to the second CA.

[0009] Based on the second aspect, in a possible implementation method, HA updates the status of the target data, including: if the second read request is an exclusive read request, HA updates the status of the target data to a second CA exclusive status; if the second read request is a shared read request, HA updates the status of the target data to a first CA and second CA shared status; if the second read request is an invalid read request, HA updates the status of the target data to a first CA exclusive status.

[0010] In a third aspect, an embodiment of the present application provides a data reading method, including: a second cache agent CA sends a second read request to a local agent HA; the second read request is used to instruct HA to update the status of target data according to the second read request; the second CA receives a second read response to the second read request sent by HA, and updates the read and write permissions for the target data.

[0011] Based on the third aspect, in one possible implementation, if the second read request is an exclusive read request, the second CA may update the read and write permissions for the target data to exclusive permissions; the method also includes: if the second CA changes the read and write permissions for the target data from exclusive permissions to invalid permissions, it sends permission change information to the HA; the permission change information is used to instruct the HA to change the status of the target data to an invalid status.

[0012] In a fourth aspect, an embodiment of the present application provides a data reading method, including: a first cache agent CA sends a first shared read request to a local agent HA, the first shared read request being used to instruct HA to update the status of target data to a first CA shared status; before receiving a first shared read response to the first shared read request, if the first CA receives a third exclusive listening request sent by HA, the first CA updates the read and write permissions for the target data to invalid permissions, and sends a third exclusive listening response to HA; after receiving the first shared read response, the first CA sends a second shared read request to HA, the second shared read request being used to instruct HA to update the status of the target data to the first CA shared status.

[0013] By adopting the above scheme, when the third exclusive snooping request received by the first CA conflicts with the first shared read request sent by the first CA, the first CA sends a third exclusive snooping response to the HA, and after receiving the first shared read response, sends a second shared read request to the HA, thereby ensuring that the target data obtained by the first CA is the latest target data, and resolving the read request conflict while ensuring cache consistency.

[0014] In a fifth aspect, an embodiment of the present application provides a data reading method, including: a local agent HA receives a first shared read request sent by a first cache agent CA; HA updates the state of the target data to a first CA shared state according to the first shared read request, and sends a first shared read response to the first CA; HA receives a third exclusive read request sent by the second CA, and sends a third exclusive listening request to the first CA according to the state of the target data; the third exclusive listening request is used to instruct the first CA to update the read and write permissions of the target data to invalid permissions; after receiving the third exclusive listening response to the third exclusive listening request sent by the first CA, HA sends a third exclusive read response to the second CA, and updates the state of the target data to the second CA exclusive state; after receiving the second shared read request sent by the first CA, HA sends a second shared listening request to the second CA; after receiving the second shared listening response to the second shared listening request sent by the second CA, HA updates the state of the target data to a first CA and second CA shared state, and sends a second shared read response to the second shared read request to the first CA.

[0015] Based on the fifth aspect, in a possible implementation manner, the third exclusive read response is used to instruct the second CA to return a confirmation response of the third exclusive read response to the HA; before the HA sends the second shared listening request to the second CA, it also includes: the HA receives a confirmation response of the third exclusive read response sent by the second CA.

[0016] In the event that a read request conflict has occurred at the first CA, the HA uses the third exclusive read response to instruct the second CA to return an acknowledgment of the third exclusive read response to the HA, and after receiving the acknowledgment of the third exclusive read response sent by the second CA, the HA sends a second shared listening request to the second CA to prevent the third exclusive read request sent by the second CA from conflicting with the second shared listening request received by the second CA.

[0017] In a sixth aspect, an embodiment of the present application provides a data reading method, including: a second cache agent CA sends a third exclusive read request to a local agent HA; the third exclusive read request is used to instruct HA to update the status of the target data to a second CA exclusive status; the second CA receives the third exclusive read response sent by HA, and updates the read and write permissions of the target data to exclusive permissions; the second CA receives a second shared listening request sent by HA, and updates the exclusive permission to the target data to shared permissions according to the second shared listening request; the second CA sends a second shared listening response to HA.

[0018] Based on the sixth aspect, in a possible implementation manner, after the second CA receives the third exclusive read response sent by the HA, the method further includes: the second CA sends a receipt response of the third exclusive read response to the HA.

[0019] In the seventh aspect, an embodiment of the present application provides a device, comprising: a request module and a permission module; wherein the request module is used to send a first exclusive read request to a local agent HA, the first exclusive read request being used to instruct HA to update the status of target data to a device exclusive status; the permission module is used to suspend the first listening request if a first listening request sent by HA is received before a first exclusive read response to the first exclusive read request is received, and the status of the target data is determined to be a device exclusive status based on the first listening request; after receiving the first exclusive read response, the read and write permissions for the target data are updated based on the first listening request, and the first listening response is sent to HA.

[0020] Based on the seventh aspect, in a possible implementation method, the permission module is specifically used to: if the first listening request is an exclusive listening request, the read and write permissions for the target data are updated to invalid permissions; if the first listening request is a shared listening request, the read and write permissions for the target data are updated to shared permissions; if the first listening request is an invalid listening request, the read and write permissions for the target data are updated to exclusive permissions.

[0021] In an eighth aspect, an embodiment of the present application provides a device, comprising: a request module and a status module; wherein the request module is used to receive a first exclusive read request sent by a first cache agent CA; the status module is used to update the status of the target data to the first CA exclusive status according to the first exclusive request; the request module is also used to send a first listening request to the first CA according to the status of the target data if a second read request from the second CA is received; the first listening request is used to instruct the first CA to suspend the first listening request if it is determined that the status of the target data is the first CA exclusive status according to the first listening request, and, after receiving the first exclusive read response, update the read and write permissions to the target data according to the first listening request; the status module is also used to receive the first listening response returned by the first CA according to the first listening request, and update the status of the target data; and send a second read response to the second CA.

[0022] Based on the eighth aspect, in a possible implementation method, the status module is specifically used to: if the second read request is an exclusive read request, update the status of the target data to the second CA exclusive status; if the second read request is a shared read request, update the status of the target data to the first CA and the second CA shared status; if the second read request is an invalid read request, update the status of the target data to the first CA exclusive status.

[0023] In the ninth aspect, an embodiment of the present application provides a device, comprising: a request module and a permission module; wherein the request module is used to send a second read request to the local agent HA; the second read request is used to instruct HA to update the status of the target data according to the second read request; the permission module is used to receive a second read response to the second read request sent by HA, and update the read and write permissions for the target data.

[0024] Based on the ninth aspect, in a possible implementation method, the permission module is specifically used to: if the second read request is an exclusive read request, then the read and write permissions for the target data are updated to exclusive permissions; the permission module is also used to: if the read and write permissions for the target data are changed from exclusive permissions to invalid permissions, then permission change information is sent to HA through the request module; wherein the permission change information is used to instruct HA to change the status of the target data to an invalid status.

[0025] In the tenth aspect, an embodiment of the present application provides a device, comprising: a request module and a permission module; wherein the request module is used to send a first shared read request to a local agent HA, and the first shared read request is used to instruct HA to update the status of the target data to a device shared status; the permission module is used to update the read and write permissions of the target data to invalid permissions and send a third exclusive listening response to HA if a third exclusive listening request sent by HA is received before receiving a first shared read response to the first shared read request; after receiving the first shared read response, send a second shared read request to HA, and the second shared read request is used to instruct HA to update the status of the target data to the device shared status shown.

[0026] In the eleventh aspect, an embodiment of the present application provides a device, including: a request module and a status module; wherein the request module is used to receive a first shared read request sent by a first cache agent CA; the status module is used to update the status of the target data to a first CA shared status according to the first shared read request, and send a first shared read response to the first CA; the request module is also used to receive a third exclusive read request sent by a second CA, and send a third exclusive listening request to the first CA according to the status of the target data; the third exclusive listening request is used to instruct the first CA to update the read and write permissions of the target data to invalid permissions; after receiving the third exclusive listening response to the third exclusive listening request sent by the first CA, send a third exclusive read response to the second CA, and update the status of the target data to the second CA exclusive status; after receiving the second shared read request sent by the first CA, send a second shared listening request to the second CA; the status module is also used to update the status of the target data to a first CA and second CA shared status after receiving the second shared listening response to the second shared listening request sent by the second CA, and send a second shared read response to the second shared read request to the first CA.

[0027] Based on the eleventh aspect, in a possible implementation method, the third exclusive read response is used to instruct the second CA to return a confirmation response of the third exclusive read response to the device; before the request module sends a second shared listening request to the second CA, it is also used to: receive a confirmation response of the third exclusive read response sent by the second CA.

[0028] In the twelfth aspect, an embodiment of the present application provides a device, comprising: a request module and a permission module; wherein the request module is used to send a third exclusive read request to the local agent HA; the third exclusive read request is used to instruct HA to update the status of the target data to the exclusive status of this device; the permission module is used to receive the third exclusive read response sent by HA, and update the read and write permissions to the target data to exclusive permissions; receive the second shared listening request sent by HA, and update the read and write permissions to the target data to shared permissions according to the second shared listening request; send a second shared listening response to HA.

[0029] Based on the twelfth aspect, in a possible implementation manner, after receiving the third exclusive read response sent by the HA, the permission module is further used to: send an acknowledgement of the third exclusive read response to the HA.

[0030] In the thirteenth aspect, an embodiment of the present application provides a readable storage medium, which stores executable instructions, and the executable instructions are used to enable a computer to execute the method provided by the first aspect, or a possible implementation of the first aspect, or the second aspect, or a possible implementation of the second aspect, or the third aspect, or a possible implementation of the third aspect, or the fourth aspect, or the fifth aspect, or a possible implementation of the fifth aspect, or the sixth aspect, or a possible implementation of the sixth aspect.

[0031] In a fourteenth aspect, an embodiment of the present application provides a program product, which, when running on a controller, can enable a computer to execute a method provided by the first aspect, or a possible implementation of the first aspect, or the second aspect, or a possible implementation of the second aspect, or the third aspect, or a possible implementation of the third aspect, or the fourth aspect, or the fifth aspect, or a possible implementation of the fifth aspect, or the sixth aspect, or a possible implementation of the sixth aspect.

[0032] In the fifteenth aspect, an embodiment of the present application provides a multi-core processor, which includes multiple processor cores, multiple cache proxies CA and at least one local agent HA; wherein the multiple processor cores correspond one-to-one to the multiple CAs respectively; the processor core is used to read and write data cached in the CA corresponding to the processor core; the CA is used to execute the first aspect mentioned above, or a possible implementation of the first aspect, or the third aspect, or a possible implementation of the third aspect; the HA is used to execute the second aspect mentioned above, or a possible implementation of the second aspect; or, the CA is used to execute the method provided by the fourth aspect, or the sixth aspect, or a possible implementation of the sixth aspect; the HA is used to execute the method provided by the fifth aspect, or a possible implementation of the fifth aspect. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A schematic diagram of a cache system architecture;

[0034] Figure 2 This is one of the schematic diagrams of a data reading process;

[0035] Figure 3 This is a second schematic diagram of a data reading process;

[0036] Figure 4 A schematic diagram of a data write-back process;

[0037] Figure 5 A schematic diagram of a read request and a write-back request conflict process;

[0038] Figure 6 A schematic diagram of a data reading method provided in an embodiment of the present application;

[0039] Figure 7 A schematic diagram of a read request conflict;

[0040] Figure 8 A schematic diagram of a data reading method provided in an embodiment of the present application;

[0041] Fig. 9 A schematic diagram of a data reading method provided in an embodiment of the present application;

[0042] Fig.10 A schematic diagram of a device structure provided in an embodiment of the present application;

[0043] Fig.11 A schematic diagram of a device structure provided in an embodiment of the present application. DETAILED DESCRIPTION

[0044] The present invention will be described in further detail below in conjunction with the accompanying drawings.

[0045] Figure 1 is a schematic diagram of a cache system architecture, the system includes a memory 101 and a multi-core processor 102, wherein the multi-core processor 102 is a coherence multi-processor (CMP). Figure 1 As shown, the multi-core processor 102 includes multiple processor cores (core0 to coreN, N is greater than 0), and multiple cache agents (CA) (CA0 to CAN), wherein the multiple processor cores correspond to the multiple CAs one by one. For example, core0 corresponds to CA0, and core0 can read and write cache data through CA0. For another example, core1 corresponds to CA1, and core1 can read and write cache data through CA1.

[0046] In addition, the multi-core processor 102 also includes at least one local proxy HA (such as HA0 to HAM, M is greater than or equal to 0). The memory 101 is used to store data, and each HA in the at least one HA can be connected to the memory 101 and manage the data stored in the memory 101. The number of HAs is related to the amount of data in the memory 101. For example, when the amount of data stored in the memory 101 is large, multiple HAs may be required to manage part of the data stored in the memory 101 respectively. In other words, the larger the amount of data in the memory 101, the more HAs there are. Figure 1 In the embodiment, multiple HAs and multiple CAs are interconnected through an interconnect network (ICN), and any CA can transmit messages with any HA through the ICN, or with other CAs through the ICN. For ease of description, the embodiment of the present application is only for the HA used to manage the target data, and the following is the same and will not be repeated.

[0047] Figure 1 The memory 101 shown in the figure can be an internal memory or a last level cache (LLC) in a three-level cache system. For ease of understanding, the embodiment of the present application is described by taking the internal memory 101 as an example.

[0048] exist Figure 1 In the multi-core processor 102 shown, any CA at least includes a storage unit and a control unit, the storage unit is used to store the data cached by CA, and the control unit is used to manage CA's read and write permissions to the data. In an embodiment of the present application, CA's read and write permissions to the data include exclusive permissions, shared permissions, and invalid permissions. For example, if CA0's read and write permissions to data A are exclusive permissions, then CA0 can cache data A, and core0 corresponding to CA0 can read and write data A. If CA0's read and write permissions to data A are shared permissions, then CA0 caches data A, and core0 can read data A, but cannot write to data A. If CA0's read and write permissions to data A are invalid permissions, then CA0 cannot cache data A, or the data A cached by CA0 is invalid.

[0049] Correspondingly, the data state of data A in CA0 can be shown in Table 1 below:

[0050] Table 1

[0051]

[0052] It should be understood that the data state of data in the embodiments of the present application is not the same as the state of data. The data state of data indicates the state of data in a CA, while the state of data indicates the distribution of read and write permissions of data in multiple CAs. Specifically, if CA0 has exclusive read and write permissions for data A, data A can be in either a modified state m or an exclusive state e in CA0; if CA0 has shared read and write permissions for data A, data A can be in a shared state s in CA0; if CA0 has invalid read and write permissions for data A, data A in CA0 is in an invalid state, that is, data A is not cached in CA0 or data A cached in CA0 is not readable or writable.

[0053] exist Figure 1 In the multi-core processor 102 shown, any HA also includes at least a storage unit and a control unit, the control unit is used to manage the state of the data, and the storage unit is used to store the state of each data. Usually, the storage unit in the HA will store the state of the data in the form of a directory, including the CA that currently caches the data and the read and write permissions of the CA that caches the data to the data. The memory in the HA stores the directory corresponding to each data, and the control unit completes the update of the data state by updating the directory stored in the storage unit.

[0054] In the embodiment of the present application, three states as shown in Table 2 may be defined for the data managed by the HA:

[0055] Table 2

[0056]

[0057] Taking data A as an example, based on the states of the three types of data shown in Table 2, the corresponding relationship between the state of data A and the read and write permissions of CA0 to data A from CAN can be specifically as follows: If the state of data A is the CA0 exclusive state, then at this time, the read and write permissions of CA0 to data A are exclusive permissions, and the read and write permissions of CA1 to data A from CAN are invalid permissions. If the state of data A is the CA0 and CA1 shared state, then at this time, the read and write permissions of CA0 and CA1 to data A are shared permissions, and the read and write permissions of CA2 to data A from CAN are invalid permissions. If the state of data A is an invalid state, then at this time, the read and write permissions of CA0 to CAN to data A are all invalid permissions. It should be understood that in the embodiment of the present application, the state of data A is the CA0 shared state, which includes the situation where only CA0 caches data A, and the situation where CA0 and one or more other CAs cache data A together.

[0058] Based on the above read and write permissions and data status, CA can change the read and write permissions of any data by sending different types of read and write requests to HA. For example, the read request can be as shown in Table 3 below:

[0059] Read Request Request Definition R Get target data without requesting permission R Obtain target data and allow sharing of target data with other CAs R Get the target data and exclusive rights to the target data RxF Get exclusive rights to the target data, do not get the target data InvX All CAs have invalid read and write permissions for the target data and do not read the data.

[0060] Specifically, RdI is an invalid read request. CA can send RdI to HA to obtain the target data, but CA will not cache the target data, that is, the read and write permissions to the target data are still invalid. RdS is a shared read request. CA can send RdS to HA to obtain the target data and shared permissions to the target data. RdE is one of the exclusive read requests. CA can send RdE to HA to obtain the target data and exclusive permissions to the target data. RdX is the second exclusive read request. CA can send RdX to HA to obtain exclusive permissions to the target data, but will not obtain the target data. In addition, CA can also send InvX to HA to request HA to invalidate the target data cached in all CAs, that is, all CAs have invalid permissions to the target data.

[0061] It can be seen from the above definition of read and write permissions that when CA has exclusive read and write permissions for the target data, the processor core corresponding to CA can modify the target data cached in CA. Based on this, CA with exclusive permissions can send a write-back request to HA to request HA to update the target data in the internal memory according to the target data cached in CA, that is, write back the target data. The write-back request can be shown in Table 4 below:

[0062] Table 4

[0063]

[0064] Specifically, WbI is an invalid write-back request. CA can send WbI to HA to request HA to write the target data cached in CA into the internal memory. At the same time, CA's read and write permissions for the target data become invalid permissions, that is, CA invalidates its cached target data; WbS is a shared write-back request. CA can send WbS to HA to request HA to write the target data cached in CA into the internal memory. At the same time, CA's read and write permissions for the target data become shared permissions; WbE is an exclusive write-back request. CA can send WbE to HA to request HA to write the target data cached in CA into the internal memory. At the same time, CA's read and write permissions for the target data remain exclusive permissions.

[0065] It can be understood that HA's management of the state of the target data involves changes in the read and write permissions of multiple CAs to the target data. For example, when CA3 sends an exclusive read request to HA, if the target data is currently cached in CA4, HA needs to modify CA4's read and write permissions to the target data to invalid permissions before CA3 can obtain exclusive permissions to the target data. Based on this, the embodiment of the present application also provides a listening request as shown in Table 5, and HA sends a listening request to CA4 so that CA4 updates the read and write permissions to the target data according to the listening request.

[0066] Listening for requests definition SnP Listen to obtain target data without modifying read and write permissions S Listen to obtain the target data and instruct to modify the read and write permissions to share permissions S E Listen to obtain the target data and instruct to modify the read and write permissions to invalid permissions XOt Indicates to modify the read and write permissions to invalid permissions

[0067] Among them, SnpI is an invalid listening request, SnpS is a shared listening request, SnpE is one of the exclusive listening requests, SnpE is used to obtain the target data from CA4 and instruct CA4 to modify the read and write permissions to invalid permissions. SnpX is the second exclusive listening request, and the difference from SnpE is that SnpX is only used to instruct CA4 to modify the read and write permissions to invalid permissions, and will not be used to obtain target data from CA4. The specific sending rules of each listening request in Table 5 can be seen in Table 9 of the subsequent embodiments of this application.

[0068] For the various requests shown in Tables 3 to 5 above, this application also provides the request responses shown in Table 6 below:

[0069] Table 6

[0070]

[0071]

[0072] Among them, CA3 is the CA that sends a read request to HA, and CA4 is the CA that receives the intercept request, that is, the intercepted CA. In Table VI, the read response is the response sent by HA to CA3 for the read request. The read response includes the target data and / or permission response. For example, RspDataE is a data response, indicating an exclusive copy of the target data. CA3 receives and caches RspDataE to obtain the target data. Comp is a permission response. CA3 receives Comp and can update the read and write permissions of the target data to exclusive permissions.

[0073] In Table 6, the listening response is the response sent by CA4 to HA for the listening request, Rsp_Comp in the no-data response is the response sent by HA to CA3, used to indicate the end of the reading process, and Rsp_Ack is the response sent by CA to HA, used to notify HA that the CA has received a message sent by HA.

[0074] In order to more specifically illustrate the relationship between the read request, the write-back request and the read and write permissions of CA3 to the target data, the embodiment of the present application also provides a CA state transition rule table as shown in Table 7 below:

[0075] ask Read and write permissions allowed Request content Read and write permissions after receiving the response R invalid Data+Comp invalid R invalid Data+Comp shared R Invalid / Shared Data+Comp exclusive RxF Invalid / Shared Comp exclusive InvX Invalid / Shared / Exclusive Comp invalid Wlq exclusive Comp invalid Wlq exclusive Comp shared Wlq exclusive Comp exclusive Evct Shared / Exclusive Comp invalid

[0076] Among them, Data represents the request for target data, and Comp represents the request for read and write permissions to the target data. As shown in Table 7, when CA3's read and write permissions to the target data are invalid permissions or shared permissions, CA3 can send an RdE read request to HA to obtain the target data and exclusive permissions to the target data. After receiving HA's response to the RdE request, CA3 updates the read and write permissions to the target data to exclusive permissions. Other requests are similar, and the embodiments of this application will not be repeated.

[0077] It can be understood that after receiving the interception request, CA4 also needs to update the read and write permissions of the target data according to the interception request. For example, the update can be performed according to the rules shown in Table 8:

[0078] Table 8

[0079]

[0080] For example, after CA4 receives the invalid listening request SnpI, if the data state of the target data in CA4 is the modified state m, and the corresponding read and write permission is the exclusive permission, CA4 maintains the exclusive permission to the target data and sends a listening response to HA. At the same time, the data state of the target data can be updated to the exclusive state e or maintained in the modified state m. Specifically, if CA4 updates the data state of the cached target data to the exclusive state e, it can send an exclusive listening response SnpRspEWb to HA. SnpRspEWb includes the latest copy of the target data in CA4. After receiving SnpRspEWb, HA can write the latest copy of the target data into the internal memory, that is, write back the target data. And, HA can also further forward the latest copy of the target data to CA3. As shown in Table VIII, CA4 can also send SnpRspFwdEWb to HA to instruct HA to complete the write back of the target data. In addition, CA4 will also send RspDataI, that is, the invalid state i copy of the target data, to CA3 to complete the response to CA3's invalid read request RdI.

[0081] It can be understood that after receiving different types of read requests sent by CA3, HA also needs to complete the response to CA3 by reading the internal memory or sending a listening request to CA4 according to the type of read request and the current state of the target data. The specific rules can be shown in the following Table 9:

[0082] Table 9

[0083]

[0084] As shown in Table 9, after receiving the read request sent by CA3, HA will read the target data from the internal memory according to the read request and send it to CA3 or send a listening request to CA4 to instruct CA4 to update the read and write permissions for the target data and / or provide the target data to CA3.

[0085] For example, in Table 9, after HA receives the RdI read request sent by CA3, if the current state of the target data is invalid or shared, HA can directly read the target data from the internal memory and send it to CA3. If the current state of the target data is exclusive, HA can send an invalid listening request, i.e., SnpI, to CA4 that exclusively owns the target data, thereby instructing CA4 to provide the target data to CA3. Similarly, after HA receives the RdS read request or RdE read request sent by CA3, it will also read the target data from the internal memory and send it to CA3, or obtain the target data from CA4 through a shared listening request SnpS or an exclusive listening request SnpE, and provide it to CA3.

[0086] It can be understood that after receiving the intercept response returned by CA4, HA also needs to update the status of the target data accordingly, as shown in Table 10:

[0087] Table 10

[0088]

[0089]

[0090] Among them, the read request is the read request received by HA from CA3, the read response is the read response sent by HA to CA3, and the snoop response is the snoop response received from CA4 after HA sends a snoop request to CA4 according to the received read request. For example, if HA receives an exclusive read request RdE sent by CA3, HA determines that the target data is in the CA4 exclusive state, then it sends an exclusive snoop request SnpE to CA4. After receiving the exclusive snoop response SnpRspI returned by CA4, HA updates the state of the target data to the CA3 exclusive state E, and sends an exclusive read response RspDataE_Comp to CA3.

[0091] As shown in Table 10, when the snoop response includes a write-back request wb, the HA will also write back the target data. In the embodiment of the present application, the HA can also modify the state of the target data according to the type of the write-back request, as shown in Table 11:

[0092] Table 11

[0093]

[0094] As shown in Table 11, if the write-back request received by HA is an invalid write-back request WbI, the target data is written to the internal memory and the status of the target data is updated to an invalid state; if the write-back request received by HA is a shared write-back request WbS, the target data is written to the internal memory and the status of the target data is updated to a shared state; if the write-back request received by HA is an exclusive write-back request WbE, the target data is written to the internal memory, and the status of the target data after the update remains exclusive.

[0095] Next, the embodiments of the present application further illustrate the definitions and rules shown in Tables 1 to 11 by taking a specific reading process and a writing-back process as an example.

[0096] Reading process example 1

[0097] like Figure 2 As shown, this is one of the data reading process diagrams. Figure 2 The main steps include:

[0098] S201: Assuming that CA2's current read and write permissions for the target data are invalid permissions, according to the rules shown in Table 7, CA2 can send an exclusive read request RdE to HA.

[0099] S202: HA sets the state of the target data to the CA2 exclusive state according to RdE. Specifically, assuming that the state of the target data is invalid, according to the rules shown in Table 9, HA reads the target data from the internal memory, changes the state of the target data to the CA2 exclusive state, and executes S203.

[0100] S203: HA sends an exclusive read response to CA2. According to the definition shown in Table 6, the exclusive read response may be RspDataE_Comp.

[0101] S204: After receiving RspDataE_Comp, CA2 updates the read and write permissions of the target data to exclusive permissions according to the rules shown in Table 7.

[0102] S205: Assuming that CA1's current read and write permissions for the target data are invalid permissions, according to the rules shown in Table 7, CA1 can send an exclusive read request RdE to HA.

[0103] S206: After receiving the RdE sent by CA1, since the current state of the target data is the CA2 exclusive state, the HA sends an exclusive snoop request SnpE to CA2 according to the rules shown in Table 9.

[0104] S207: After receiving the exclusive listening request sent by HA, CA2 modifies the read and write permissions of the target data to invalid permissions according to the rules shown in Table 8, and the cached target data becomes invalid.

[0105] S208: CA2 sends an exclusive snoop response to HA. As shown in Table 8, the exclusive snoop response can be any one of SnpRspISnpRspFwdI, SnpRspIWb, SnpRspFwdI and SnpRspFwdIWb. Assume that CA2 sends SnpRspIWb to HA in S208.

[0106] S209: HA obtains the target data from SnpRspIWb, and since the exclusive snoop response includes a write-back request, HA writes the target data obtained from SnpRspIWb into the internal memory, and sets the state of the target data to the CA1 exclusive state.

[0107] S210: HA sends an exclusive read response RspDataE_Comp to CA1.

[0108] S211: After receiving RspDataE_Comp, CA1 updates the read and write permissions of the target data to exclusive permissions according to the rules shown in Table 7.

[0109] pass Figure 2 The process shown realizes the transfer of exclusive rights between CA1 and CA2.

[0110] Reading process example 2

[0111] like Figure 3 As shown, this is a second schematic diagram of a data reading process. Figure 3 The main steps include:

[0112] S301: CA1 sends a shared read request RdS to HA.

[0113] S302: After receiving the shared read request RdS, if the HA determines that the state of the target data is the CA2 exclusive state, S303 is executed according to the rules shown in Table 9.

[0114] S303: HA sends a shared listening request SnpS to CA2.

[0115] S304: After receiving the shared snooping request SnpS, CA2 updates the read and write permissions of the target data to shared permissions according to the rules shown in Table 8, changes the cached target data into a shared state, and executes S305.

[0116] S305: CA2 sends a shared snooping response to HA. As shown in Table 8, the shared snooping response can be any one of SnpRspS, SnpRspFwdS, SnpRspSWb and SnpRspFwdSWb. Assume that in S305 CA2 sends SnpRspFwdSWb to HA, and it simultaneously sends the target data RspDataS to CA1.

[0117] S306: After receiving SnpRspFwdSWb, the HA sets the state of the target data to a shared state of CA1 and CA2 according to the rules shown in Table 10.

[0118] S307: HA sends a shared read response to CA1. According to the definition shown in Table 6, since CA2 has sent the target data to CA1, the shared read response sent by HA to CA1 may be a completion response Rsp_Comp.

[0119] S308: After receiving Rsp_Comp and RspDataS, CA1 updates the read and write permissions of the target data to sharing permissions according to the rules shown in Table 7.

[0120] pass Figure 3 In the process shown, CA1 obtains the sharing permission of the target data, and changes the read and write permission of CA2 on the target data from exclusive permission to sharing permission.

[0121] Write-back process example

[0122] Assume that CA1, which exclusively owns the target data, modifies the cached target data. Then the cached target data in CA1 is in the m state. Due to cache overflow and other reasons, CA1 needs to write the cached target data back to the internal memory. For example, Figure 4 The process shown is written back. Figure 4 The following is a schematic diagram of a data write-back process, which mainly includes the following steps:

[0123] S401: CA1 sends an invalid write-back request WbI to HA. The invalid write-back request WbI includes the m-state target data cached by CA1.

[0124] S402: HA receives the invalid write-back request WbI and obtains the m-state target data from the invalid write-back request WbI. HA writes the m-state target data into the internal memory, thereby updating the target data stored in the internal memory. And, according to the rules shown in Table 11, the state of the target data is changed from the CA1 exclusive state to the invalid state.

[0125] S403: HA sends an invalid write-back response to CA1. Usually, the invalid write-back response may be a completion response Rsp_Comp shown in Table 6.

[0126] S404: After receiving the invalid write-back response sent by HA, CA1 can determine that HA has completed the modification of the state of the target data, and then can update the read and write permissions of the target data to invalid permissions.

[0127] Through the above process, the target data cached in CA1 that exclusively owns the target data can be written into the internal memory, that is, the target data can be written back, thereby releasing the cache space of CA1, and even CA1's read and write permissions on the target data can be modified from exclusive permissions to other permissions.

[0128] Example of a read request conflicting with a write request

[0129] The above reading process examples and write-back process examples are all ideal processes. In actual applications, request conflicts often occur. For example, if CA2 exclusively occupies the target data, the write-back request sent by CA2 to HA may conflict with the read request of other CAs. Figure 5 For example, Figure 5 A flowchart of a read request and a write-back request conflict is shown below. Figure 5 The main steps include:

[0130] S501: CA1 sends a shared read request RdS to HA.

[0131] S502: Since the current state of the target data is the CA2 exclusive state, the HA sends a shared listening request SnpS to CA1.

[0132] S503: Before receiving the shared snooping request SnpS sent by HA, CA2 sends an invalid write-back request WbI to HA.

[0133] S504: HA receives the invalid read request WbI sent by CA2, writes the target data into the internal memory according to the invalid read request WbI, and updates the state of the target data to an invalid state.

[0134] S505: HA sends an invalid write-back response Rsp_Comp to CA2.

[0135] S506: Since CA2 sent an invalid write-back request WbI to HA before receiving the shared listening request SnpS sent by HA, after receiving the shared listening request SnpS, CA2 suspends the shared listening request SnpS until receiving the invalid write-back response Rsp_Comp, and then updates the read and write permissions of the target data to invalid permissions and sends a shared listening response to HA. Since the data cached in CA2 is in the i state at this time, the shared listening response can be SnpRspI.

[0136] S507: After receiving the shared snoop response SnpRspI sent by CA2, HA reads the target data from the internal memory and sends a shared read response RspDataS_Comp to CA1.

[0137] S508: CA1 receives the shared read response RspDataS_Comp, caches the s-state target data according to the shared read response RspDataS_Comp, and updates the read and write permissions of the target data to shared permissions.

[0138] In the above process, a conflict occurs between the shared read request RdS of CA1 and the invalid write-back request WbI of CA2. CA2 ensures that the write-back process can be completed normally by suspending the shared snoop request SnpS corresponding to the shared read request RdS.

[0139] It is understandable that conflicts may also occur between read requests. Figure 2 In the reading process shown, if CA2 receives the exclusive listening request sent by HA in S206 before receiving the exclusive reading response sent by HA in S203, a conflict occurs at CA2 between the exclusive reading request and the exclusive listening request, and a read request conflict occurs for the system to which CA1, CA2 and HA belong.

[0140] Based on this, the embodiment of the present application provides a data reading method to provide a processing mechanism for conflicting read requests. Table 12 is the processing rules of CA1 after receiving a listening request in the embodiment of the present application: Table 12

[0141]

[0142]

[0143] The listening request is the listening request received by CA1 from HA. The listening request includes the state of the target data. After receiving the listening request, CA1 can obtain the state of the target data from the listening request.

[0144] In addition, the embodiment of the present application also provides a processing rule for CA1 after receiving a read response, as shown in Table 13:

[0145] Table 13

[0146]

[0147]

[0148] Generally, read request conflicts related to exclusive permissions will affect the cache consistency of the CMP system. Therefore, the embodiments of the present application mainly illustrate the data reading method provided by the embodiments of the present application and the rules shown in Tables 12 and 13 through the following two specific embodiments of read request conflicts related to exclusive permissions.

[0149] Embodiment 1: Mechanism for handling conflicts between exclusive read request and listen request

[0150] Figure 6 A data reading method flow chart provided in an embodiment of the present application is as follows: Figure 6 As shown, it mainly includes the following steps:

[0151] S601: CA1 sends a first exclusive read request to HA to obtain exclusive rights to target data.

[0152] S602: HA receives the first exclusive read request sent by CA1, and updates the state of the target data to the CA1 exclusive state according to the first exclusive read request.

[0153] In a possible implementation of S602, before HA receives the first exclusive read request sent by CA1, if the target data is in an invalid state, after HA receives the first exclusive read request sent by CA1, it can obtain the target data from the internal memory and send the target data to CA1.

[0154] In another possible implementation of S602, if the state of the target data is the CA3 shared state, then after receiving the first exclusive read request sent by CA1, HA can send an exclusive listening request to CA3 to instruct CA3 to change the read and write permissions of the target data to invalid permissions, and obtain the target data from the internal memory and send the target data to CA1.

[0155] In another possible implementation of S602, if the state of the target data is the CA3 exclusive state, then after receiving the first exclusive read request sent by CA1, HA may send an exclusive listening request to CA3 to instruct CA3 to change the read and write permissions of the target data to invalid permissions, and to instruct CA3 to provide the latest copy of the target data. For the specific implementation process, please refer to Figure 2 , the embodiments of this application will not be described in detail.

[0156] S603: HA sends a first exclusive read response to CA1.

[0157] S604: HA receives the second read request sent by CA2. In the embodiment of the present application, HA receives the second read request after receiving the first exclusive read request, so HA generally processes the first exclusive read request first. If HA receives the second read request when executing S602 and S603, HA can suspend the second read request until S603 is completed.

[0158] S605: HA sends a first listening request to CA1 according to the second reading request.

[0159] Among them, there is the following corresponding relationship between the request types of the first listening request and the second read request: if the second read request is an exclusive read request, the first listening request is an exclusive listening request; if the second read request is a shared read request, the first listening request is a shared listening request; if the second read request is an invalid read request, the first listening request is an invalid listening request. For details, please refer to the rules shown in Table 9, and the embodiments of the present application will not be repeated here.

[0160] S606: Due to message disorder in ICN, CA1 received the first listening request before receiving the first exclusive read response. Based on the rules shown in Table 12, after receiving the first listening request, if CA1 determines that the state of the target data is the CA1 exclusive state according to the first listening request, the first listening request is suspended. This is because, if the state of the target data is determined to be the CA1 exclusive state according to the first listening request, it means that HA has received and processed the first exclusive read request sent by CA1, so CA1 will inevitably receive the first exclusive read response sent by HA later. Based on this, CA1 can suspend the first listening request to wait for the arrival of the first exclusive read response.

[0161] S607: After receiving the first exclusive read response, CA1 updates the read and write permissions of the target data according to the first intercept request according to the rules shown in Table 13.

[0162] In one possible implementation, the first exclusive read response includes the target data, and CA1 can obtain the target data from the first exclusive read response. In another possible implementation, when CA1 receives the first exclusive read response, it also receives the target data sent by other CAs (such as CA3).

[0163] After receiving the first exclusive read response, CA1 can start processing the first listening request and update the read and write permissions of the target data according to the first listening request. Taking the rules shown in Table 8 as an example, if the first listening request is an exclusive listening request, CA1 updates the read and write permissions of the target data to invalid permissions; if the first listening request is a shared listening request, CA1 updates the read and write permissions of the target data to shared permissions; if the first listening request is an invalid listening request, CA1 updates the read and write permissions of the target data to exclusive permissions.

[0164] S608: CA1 sends a first intercept response to HA. The specific type of the first intercept response can refer to the rules shown in Table 8, which will not be described in detail.

[0165] S609: After receiving the first intercept response, the HA updates the state of the target data.

[0166] Taking the rules shown in Table 8 as an example, if the second read request is an exclusive read request, HA updates the state of the target data to the second CA exclusive state; if the second read request is a shared read request, HA updates the state of the target data to a CA1 and CA2 shared state; if the second read request is an invalid read request, HA updates the state of the target data to a CA1 exclusive state.

[0167] In a possible implementation manner, the HA may also obtain target data according to the first intercept response, and update the target data in the internal memory according to the obtained target data.

[0168] S610: HA sends a second read response to CA2. The specific type of the second read response can refer to the rules shown in Table 8, which will not be described in detail.

[0169] S611: After receiving the second read response, CA2 may update the read and write permissions for the target data.

[0170] Taking the rules shown in Table 7 as an example, if the second read request is an exclusive read request RdE, CA2 will update the read and write permissions of the target data to exclusive permissions; if the second read request is a shared read request RdS, CA2 will update the read and write permissions of the target data to shared permissions; if the second read request is an invalid read request RdI, CA2 will update the read and write permissions of the target data to invalid permissions.

[0171] In order to improve the accuracy of data exclusive permission management, in a possible implementation of an embodiment of the present application, after CA2 updates the read and write permissions of the target data to exclusive permissions, if the exclusive permissions of the target data are modified to invalid permissions in the subsequent processing, CA2 needs to send permission change information to HA to instruct HA to change the status of the target data to an invalid state. In a possible implementation, CA2 can send an invalid write-back request to HA, and the invalid write-back request includes the target data cached in CA2 to instruct HA to write the target data in the invalid write-back request to the internal memory after receiving the invalid write-back request. Similarly, if CA2 modifies the exclusive permissions of the target data to shared permissions, it can also send a shared write-back request to HA to instruct HA to change the status of the target data to the CA2 shared status.

[0172] By accurately managing exclusive permissions, some read conflicts can be avoided. For example, CA1's original read and write permissions for the target data are exclusive permissions. Accordingly, the state of the target data recorded in HA is CA1's exclusive state. If CA1 modifies the read and write permissions for the target data to invalid permissions during subsequent processing, but does not send permission change information to HA, it may send Figure 7 The read request conflicts shown are Figure 7 As shown, it mainly includes the following steps:

[0173] S701: CA2 sends an exclusive read request a to HA to request exclusive permission for target data.

[0174] S702: HA sends an exclusive listening request a to CA1 according to the state of the target data.

[0175] S703: CA1 sends an exclusive read request b before receiving the exclusive listen request a, and receives the exclusive listen request a before receiving the exclusive read response corresponding to the exclusive read request b. At this time, a read request conflict occurs at CA1.

[0176] It can be seen that if CA1 changes the read and write permissions of the target data from exclusive permissions to invalid permissions, it sends permission modification information to HA, so that HA can change the state of the target data to invalid state. Then, when HA receives the exclusive read request a sent by CA2 later, it will no longer send the exclusive listening request a to CA1, thus avoiding Figure 7 The occurrence of a read request conflict is shown.

[0177] Embodiment 2: Mechanism for handling conflicts between shared read requests and exclusive listen requests

[0178] Figure 8A data reading method flow chart provided in an embodiment of the present application is as follows: Figure 8 As shown, it mainly includes the following steps:

[0179] S801: CA1 sends a first shared read request to HA to obtain sharing rights for target data.

[0180] Although HA can often record the CA that shares the data when recording any data as being in a shared state. However, since a piece of data in a CMP system can often be shared by multiple CAs, if each CA sends permission modification information to HA after invalidating the cached data, it will consume too many resources in the system. Therefore, CA can usually invalidate data with sharing permissions on its own without notifying HA. Assuming that CA1 has obtained the target data and the sharing permissions to the target data during the processing before S801, and deleted the target data during the processing, then in S801, CA1's read and write permissions to the target data are invalid permissions, and the state of the target data recorded by HA is still in a shared state.

[0181] S802: After receiving the first shared read request, the HA updates the state of the target data to the CA1 shared state according to the first shared read request.

[0182] Taking the rules shown in Table 9 as an example, if the state of the target data is the CA3 exclusive state, HA sends a shared listening request to CA3 to instruct CA3 to change the exclusive permission to the target data to the shared permission, and sends the target data to HA or CA1, and HA changes the state of the target data to the CA1 and CA3 shared state; if the state of the target data is an invalid state, HA obtains the target data from the internal memory, provides the target data to CA1 and updates the state of the target data to the CA1 shared state; if the state of the target data is the CA3 shared state, HA obtains the target data from the internal memory, provides the target data to CA1 and updates the state of the target data to the CA1 shared state.

[0183] S803: HA sends a first shared read response to the first shared read request to CA1.

[0184] S804: CA2 sends a third exclusive read request to HA.

[0185] S805: After receiving the first shared read request sent by CA1, HA receives the third exclusive read request sent by CA2. HA suspends the third exclusive read request until the first shared read response is sent to CA1. After that, HA sends a third exclusive snoop request to CA1 according to the current state of the target data.

[0186] S806: Due to message disorder and other situations in the ICN, CA1 received the third exclusive listening request before receiving the first shared read response to the first shared read request, resulting in a read request conflict. Although the third exclusive listening request may also include the status information of the target data, CA1 can determine that the status of the target data is the CA1 shared status based on the third exclusive listening request. However, since the status of the target data recorded before HA receives the first shared read request may be the CA1 shared status, CA1 cannot determine whether HA has processed the first shared read request sent by it based on the third exclusive listening request. Based on this, according to the rules shown in Table 12, CA1 updates the read and write permissions of the target data to invalid permissions, and sends a third exclusive listening response to HA. In a possible implementation, the third exclusive listening response may include conflict information, such as SnpRespCnflt in Table 12, so that HA can determine that a read request conflict occurs at CA1 based on the conflict information.

[0187] S807: HA receives the third exclusive snooping response sent by CA1, and updates the state of the target data to the second CA exclusive state.

[0188] S808: HA sends a third exclusive read response to CA2. After receiving the third exclusive read response, CA2 can modify the read and write permissions of the target data to exclusive permissions.

[0189] S809: CA1 receives the first shared read response after receiving the third exclusive listening request. Since it is impossible to determine the order in which the first shared read request and the third exclusive read request arrive at the HA, it is impossible to determine whether the target data it obtains is the latest copy. Figure 8 As shown, when CA1 receives the first shared read response, the state of the target data is the CA2 exclusive state. If CA2 modifies the target data, the target data obtained by CA1 through the first shared read request is not the latest copy of the target data. Therefore, according to the rules shown in Table 13, CA1 can invalidate the target data obtained through the first shared read response and send a second shared read request to HA again to re-request the sharing permission of the target data from HA.

[0190] In a possible implementation, after receiving the third exclusive read response, CA2 may also return an acknowledgement of the third exclusive read response to HA. After receiving the second shared read request, if HA has not received an acknowledgement of the third exclusive read response, HA suspends the second shared read request until it receives an acknowledgement of the third exclusive read response, and then executes S810 to prevent a read request conflict from occurring at CA2.

[0191] S810: HA sends a second shared listening request to CA2 according to the state of the target data.

[0192] S811: CA2 updates the read and write permissions of the target data to the sharing permissions according to the second sharing listening request.

[0193] S812: CA2 sends a second shared listening response to HA.

[0194] S813: After receiving the second shared snooping response sent by CA2, HA updates the state of the target data to a state shared by CA1 and CA2.

[0195] S814: HA sends a second shared read response to CA1.

[0196] In one possible implementation, the second shared read request also includes response indication information. After receiving the second shared read request, HA starts the confirmation response mechanism, that is, after sending any message, HA will only send the next message after receiving the response to the message, so as to prevent CA1's second shared read request from also causing a read request conflict.

[0197] By adopting the above process, CA1 can ensure that it can still obtain the latest copy of the target data and the sharing permission in the event of a shared read request conflict. Figure 8 In the process shown, HA first receives the first shared read request and then receives the third exclusive read request. However, in the scenario where HA first receives the third exclusive read request and then receives the first shared read request, CA1 may also receive the third exclusive read request and then receive the first shared read request. Figure 8 The process can be processed as follows: Fig. 9 As shown, the steps performed by CA1 and CA2 are the same as Figure 8 Similar, except that some of the steps performed by HA ( Fig. 9 As shown by the dashed line in the figure. Fig. 9 As shown, it mainly includes the following steps:

[0198] S901: HA receives the third exclusive read request sent by CA2.

[0199] S902: HA sends a third exclusive listening request to CA1 according to the state of the target data.

[0200] S903: CA1 returns a third exclusive snooping response to HA.

[0201] and Figure 8The execution steps of CA1 in are similar, and CA1 receives the third exclusive listening request before receiving the first shared read response. Therefore, according to the rules shown in Table 12, CA1 still sends the third exclusive listening response to HA. In a possible implementation, the third exclusive listening response may include conflict indication information, such as SnpRespCnflt in Table 12, so that HA can determine that a read request conflict occurs at CA1 according to the conflict indication information.

[0202] S904: HA updates the state of the target data to the CA2 exclusive state.

[0203] S905: HA sends a third exclusive read response to CA2. After receiving the third exclusive read response, CA2 can update the read and write permissions of the target data to exclusive permissions.

[0204] S906: After receiving the third exclusive listening request, HA receives the first shared read request. Since HA has started processing the third exclusive read request, HA can suspend the first shared read request until S905 is executed (or an acknowledgment of the third exclusive read response sent by CA2 is received).

[0205] S907: HA sends a second shared listening request to CA2 according to the state of the target data.

[0206] S908: After receiving the second shared listening request, CA2 updates the read and write permissions of the target data to shared permissions.

[0207] S909: CA2 sends a second shared listening response to HA.

[0208] S910: After receiving the second shared snooping response sent by CA2, HA updates the state of the target data to a state shared by CA1 and CA2.

[0209] S911: HA sends a first shared read response to CA1.

[0210] S912: After receiving the first shared read response, CA1 invalidates the target data obtained through the first shared read response according to the rules shown in Table 13, and sends a second shared read request to HA.

[0211] S913: Since the HA has updated the state of the target data to the CA1 and CA2 shared state in S910, the HA can directly obtain the target data from the internal memory after receiving the second shared read request.

[0212] S914: HA sends the target data to CA1 through a second shared read response.

[0213] Through the above process, it can be seen that although Fig. 9 In the process shown, the target data included in the first shared read response sent by HA to CA1 is the latest copy of the target data. However, CA1 cannot distinguish Figure 8 and Fig. 9 The two different read requests conflict. Therefore, in an embodiment of the present application, if CA1 receives the third exclusive listening request before receiving the first shared read response, CA1 will invalidate the acquired target data after receiving the first shared read response and initiate a second shared read request to HA again to ensure that the target data finally acquired is the latest copy of the target data.

[0214] The above mainly introduces the method provided by the present application from the perspective of the interaction between CA and HA. It can be understood that in order to achieve the above functions, CA or HA may include hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present invention can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present invention.

[0215] Fig.10 FIG. 1 shows one possible exemplary block diagram of the device involved in the embodiment of the present application. The device 1000 can be run in the CA in the form of software. Fig.10 As shown, the device 1000 may include: a request module 1001 and a permission module 1002. When the device 1000 is running as shown in Figure 6 In the example shown, when CA1 is:

[0216] The request module 1001 is used to send a first exclusive read request to the local agent HA, and the first exclusive read request is used to instruct HA to update the status of the target data to the device exclusive status; the permission module 1002 is used to suspend the first listening request if a first listening request sent by HA is received before a first exclusive read response to the first exclusive read request, and determine that the status of the target data is the device 1000 exclusive status according to the first listening request; after receiving the first exclusive read response, update the read and write permissions of the target data according to the first listening request, and send the first listening response to HA.

[0217] In one possible implementation, the permission module 1002 is specifically used to: if the first listening request is an exclusive listening request, the read and write permissions for the target data are updated to invalid permissions; if the first listening request is a shared listening request, the read and write permissions for the target data are updated to shared permissions; if the first listening request is an invalid listening request, the read and write permissions for the target data are updated to exclusive permissions.

[0218] When the device 1000 is operated as Figure 6 In the example shown, for CA2:

[0219] The request module 1001 is used to send a second read request to the local agent HA; the second read request is used to instruct HA to update the status of the target data according to the second read request; the permission module 1102 is used to receive a second read response to the second read request sent by HA and update the read and write permissions for the target data.

[0220] In one possible implementation, the permission module 1002 is specifically used to: if the second read request is an exclusive read request, then update the read and write permissions for the target data to exclusive permissions; the permission module 1003 is also used to: if the read and write permissions for the target data are changed from exclusive permissions to invalid permissions, then send permission change information to HA through the request module 1001; wherein the permission change information is used to instruct HA to change the status of the target data to an invalid status.

[0221] When the device 1000 is operated as Figure 8 and / or Fig. 9 In the example shown, when CA1 is:

[0222] The request module 1001 is used to send a first shared read request to the local agent HA, and the first shared read request is used to instruct HA to update the status of the target data to the shared status of the device 1000; the permission module 1002 is used to update the read and write permissions of the target data to invalid permissions and send a third exclusive listening response to the HA if a third exclusive listening request sent by the HA is received before the first shared read response to the first shared read request is received; after receiving the first shared read response, the second shared read request is sent to the HA, and the second shared read request is used to instruct HA to update the status of the target data to the shared status of the device 1000.

[0223] When the device 1000 is operated as Figure 8 and / or Fig. 9 In the example shown, for CA2:

[0224] The request module 1001 is used to send a third exclusive read request to the local agent HA; the third exclusive read request is used to instruct HA to update the status of the target data to the exclusive status of this device; the permission module 1002 is used to receive the third exclusive read response sent by HA, and update the read and write permissions of the target data to exclusive permissions; receive the second shared listening request sent by HA, and update the read and write permissions of the target data to shared permissions according to the second shared listening request; send a second shared listening response to HA.

[0225] In a possible implementation, after receiving the third exclusive read response sent by the HA, the permission module 1002 is further configured to: send a receipt response of the third exclusive read response to the HA.

[0226] Based on the same technical concept, Fig.11 FIG. 2 shows a possible exemplary block diagram of the device involved in the embodiment of the present application. The device 1100 can be run in the HA in the form of software. The device 1100 can include: a request module 1101 and a status module 1102. When the device 1100 runs in the HA Figure 6 When HA in the embodiment shown is:

[0227] The request module 1101 is used to receive a first exclusive read request sent by a first cache agent CA; the status module 1102 is used to update the status of the target data to the first CA exclusive status according to the first exclusive request; the request module 1101 is also used to send a first listening request to the first CA according to the status of the target data if a second read request from a second CA is received; the first listening request is used to instruct the first CA to suspend the first listening request if it is determined that the status of the target data is the first CA exclusive status according to the first listening request, and to update the read and write permissions of the target data according to the first listening request after receiving the first exclusive read response; the status module 1102 is also used to receive a first listening response returned by the first CA according to the first listening request, and update the status of the target data; and send a second read response to the second CA.

[0228] In one possible implementation, the status module 1102 is specifically used to: if the second read request is an exclusive read request, update the status of the target data to the second CA exclusive status; if the second read request is a shared read request, update the status of the target data to the first CA and the second CA shared status; if the second read request is an invalid read request, update the status of the target data to the first CA exclusive status.

[0229] When the device 1100 operates as Figure 7 When HA in the embodiment shown is:

[0230] The request module 1101 is used to receive a first shared read request sent by a first cache agent CA; the state module 1102 is used to update the state of the target data to a first CA shared state according to the first shared read request, and send a first shared read response to the first CA; the request module 1101 is also used to receive a third exclusive read request sent by a second CA, and send a third exclusive listening request to the first CA according to the state of the target data; the third exclusive listening request is used to instruct the first CA to update the read and write permissions of the target data to invalid permissions; after receiving the third exclusive listening response to the third exclusive listening request sent by the first CA, send a third exclusive read response to the second CA, and update the state of the target data to a second CA exclusive state; after receiving the second shared read request sent by the first CA, send a second shared listening request to the second CA; the state module 1102 is also used to update the state of the target data to a first CA and second CA shared state after receiving the second shared listening response to the second shared listening request sent by the second CA, and send a second shared read response to the second shared read request to the first CA.

[0231] In one possible implementation, the third exclusive read response is used to instruct the second CA to return a confirmation response of the third exclusive read response to the device; before the request module 1101 sends the second shared listening request to the second CA, it is also used to: receive a confirmation response of the third exclusive read response sent by the second CA.

[0232] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)), etc.

[0233] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed invention, those skilled in the art may understand and implement other variations of the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in a claim. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0234] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, devices (equipment), readable storage media or program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware, which are collectively referred to as "modules" or "systems" herein.

[0235] The present application is described with reference to the flowcharts and / or block diagrams of the methods, apparatuses (devices) and program products of the present application. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of the processes and / or blocks in the flowchart and / or block diagram, can be implemented by program instructions. These program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0236] These program instructions may also be stored in a readable memory capable of directing a programmable data processing device to operate in a specific manner, so that the instructions stored in the readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0237] These program instructions may also be loaded onto other programmable data processing devices so that a series of operating steps are executed on the other programmable devices to produce a computer-implemented process, thereby providing instructions for executing on the other programmable devices to implement the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0238] Although the present invention has been described in conjunction with specific features and embodiments thereof, it is apparent that various modifications and combinations may be made thereto without departing from the spirit and scope of the present invention. Accordingly, this specification and the accompanying drawings are merely exemplary illustrations of the present invention as defined by the appended claims and are deemed to cover any and all modifications, variations, combinations or equivalents within the scope of the present invention. Obviously, those skilled in the art may make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, the present invention is intended to include such modifications and variations if they fall within the scope of the claims of the present invention and their equivalents.

Claims

1. A data reading method, characterized in that: include: The first cache agent CA sends a first exclusive read request to the local agent HA, where the first exclusive read request is used to instruct the HA to update the state of the target data to the first CA exclusive state; Before receiving the first exclusive read response of the first exclusive read request, if the first CA receives the first listening request sent by the HA and determines according to the first listening request that the state of the target data is the first CA exclusive state, then suspending the first listening request; After receiving the first exclusive read response, the first CA updates the read and write permissions for the target data according to the first intercept request, and sends a first intercept response to the HA; The first CA updates the read and write permissions of the target data according to the first interception request, including: The first CA updates the read and write permissions on the target data according to a request type of the first listening request, where the request type includes any one of the following: an exclusive listening request, a shared listening request, and an invalid listening request.

2. The method according to claim 1, characterized in that The first CA updates the read and write permissions on the target data according to the request type of the first intercept request, including: If the first listening request is the exclusive listening request, the first CA updates the read and write permissions of the target data to invalid permissions; If the first interception request is the shared interception request, the first CA updates the read and write permissions of the target data to shared permissions; If the first listening request is the invalid listening request, the first CA updates the read and write permissions for the target data to exclusive permissions.

3. A data reading method, characterized in that: include: The local agent HA receives a first exclusive read request sent by the first cache agent CA; The HA updates the state of the target data to the first CA exclusive state according to the first exclusive request; If the HA receives a second read request from the second CA, the HA sends a first listening request to the first CA according to the state of the target data; The first listening request is used to instruct the first CA to suspend the first listening request if it is determined according to the first listening request that the state of the target data is the first CA exclusive state, and to update the read and write permissions of the target data according to the first listening request after receiving the first exclusive read response; The HA receives a first intercept response returned by the first CA according to the first intercept request, and updates the state of the target data; The HA sends a second read response to the second CA; The HA receives the first intercept response returned by the first CA according to the first intercept request, and updates the state of the target data, including: The state of the target data is updated according to a request type of the second read request, where the request type includes any one of the following: an exclusive listening request, a shared listening request, and an invalid listening request.

4. The method according to claim 3, characterized in that The updating the state of the target data according to the request type of the second read request includes: If the second read request is the exclusive read request, the HA updates the state of the target data to the second CA exclusive state; If the second read request is the shared read request, the HA updates the state of the target data to a shared state between the first CA and the second CA; If the second read request is the invalid read request, the HA updates the state of the target data to the first CA exclusive state.

5. A data reading method, characterized in that: include: The first cache agent CA sends a first shared read request to the local agent HA, where the first shared read request is used to instruct the HA to update the state of the target data to the first CA shared state; If the first CA receives a third exclusive listening request sent by the HA before receiving the first shared read response to the first shared read request, the first CA updates the read and write permissions of the target data to invalid permissions and sends a third exclusive listening response to the HA; After receiving the first shared read response, the first CA sends a second shared read request to the HA, where the second shared read request is used to instruct the HA to update the state of the target data to the first CA shared state.

6. A data reading method, characterized in that: include: The local agent HA receives a first shared read request sent by the first cache agent CA; The HA updates the state of the target data to the first CA shared state according to the first shared read request, and sends a first shared read response to the first CA; The HA receives the third exclusive read request sent by the second CA, and sends a third exclusive listening request to the first CA according to the state of the target data; The third exclusive intercept request is used to instruct the first CA to update the read and write permissions of the target data to invalid permissions; After receiving the third exclusive listening response of the third exclusive listening request sent by the first CA, the HA sends a third exclusive reading response to the second CA and updates the state of the target data to the second CA exclusive state; After receiving the second shared read request sent by the first CA, the HA sends a second shared listening request to the second CA; after receiving the second shared listening response to the second shared listening request sent by the second CA, the HA updates the state of the target data to a shared state of the first CA and the second CA, and sends a second shared read response to the second shared read request to the first CA.

7. The method according to claim 6, characterized in that The third exclusive read response is used to instruct the second CA to return a confirmation response of the third exclusive read response to the HA; Before the HA sends the second shared listening request to the second CA, the method further includes: The HA receives an acknowledgment of the third exclusive read response sent by the second CA.

8. A device, characterized in that: include: Request module, suspension module and permission module; The request module is used to send a first exclusive read request to the local agent HA, wherein the first exclusive read request is used to instruct the HA to update the state of the target data to the device exclusive state; The permission module is configured to suspend the first listening request if a first listening request sent by the HA is received before a first exclusive read response to the first exclusive read request is received, and determine that the state of the target data is the device exclusive state according to the first listening request; after receiving the first exclusive read response, update the read and write permissions of the target data according to the first listening request, and send the first listening response to the HA; The permission module is specifically used to update the read and write permissions of the target data according to the request type of the first listening request, and the request type includes any one of the following: an exclusive listening request, a shared listening request, and an invalid listening request.

9. The device according to claim 8, characterized in that The permission module is specifically used to: if the first listening request is the exclusive listening request, update the read and write permissions for the target data to invalid permissions; if the first listening request is the shared listening request, update the read and write permissions for the target data to shared permissions; if the first listening request is the invalid listening request, update the read and write permissions for the target data to exclusive permissions.

10. A device, characterized in that: include: Request module and status module; The request module is used to receive a first exclusive read request sent by a first cache agent CA; The state module is configured to update the state of the target data to the first CA exclusive state according to the first exclusive request; The request module is further configured to send a first listening request to the first CA according to the state of the target data if a second read request from the second CA is received; the first listening request is configured to instruct the first CA to suspend the first listening request if the state of the target data is determined to be the first CA exclusive state according to the first listening request, and to update the read and write permissions for the target data according to the first listening request after receiving a first exclusive read response; The state module is further configured to receive a first intercept response returned by the first CA according to the first intercept request, and update the state of the target data; and send a second read response to the second CA; The status module is specifically used to update the status of the target data according to the request type of the second read request, where the request type includes any one of the following: an exclusive listening request, a shared listening request, and an invalid listening request.

11. The device according to claim 10, characterized in that The state module is specifically configured to: if the second read request is the exclusive read request, update the state of the target data to the second CA exclusive state; if the second read request is the shared read request, update the state of the target data to the first CA and the second CA shared state; If the second read request is the invalid read request, the state of the target data is updated to the first CA exclusive state.

12. A device, characterized in that: include: Request module and permission module; The request module is used to send a first shared read request to the local agent HA, where the first shared read request is used to instruct the HA to update the state of the target data to the device shared state; The permission module is used to update the read and write permissions of the target data to invalid permissions and send a third exclusive listening response to the HA if it receives a third exclusive listening request sent by the HA before receiving a first shared read response to the first shared read request; after receiving the first shared read response, send a second shared read request to the HA, and the second shared read request is used to instruct the HA to update the status of the target data to the device sharing status.

13. A device, characterized in that: include: Request module and status module; The request module is used to receive a first shared read request sent by a first cache agent CA; the state module is configured to update the state of the target data to the first CA shared state according to the first shared read request, and send a first shared read response to the first CA; The request module is further configured to receive a third exclusive read request sent by the second CA, and send a third exclusive listening request to the first CA according to the state of the target data; the third exclusive listening request is used to instruct the first CA to update the read and write permissions of the target data to invalid permissions; after receiving a third exclusive listening response to the third exclusive listening request sent by the first CA, send a third exclusive read response to the second CA, and update the state of the target data to the second CA exclusive state; after receiving a second shared read request sent by the first CA, send a second shared listening request to the second CA; The state module is further configured to update the state of the target data to a shared state of the first CA and the second CA after receiving a second shared listening response to the second shared listening request sent by the second CA, and send a second shared read response to the second shared read request to the first CA.

14. The device according to claim 13, characterized in that The third exclusive read response is used to instruct the second CA to return a confirmation response of the third exclusive read response to the device; Before the request module sends the second shared listening request to the second CA, the request module is further configured to: An acknowledgement of the third exclusive read response sent by the second CA is received.

15. A readable storage medium, characterized in that: The readable storage medium stores executable instructions, and the executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 7.

16. A multi-core processor, characterized in that: The multi-core processor includes multiple processor cores, multiple cache agents CA and at least one local agent HA; wherein the multiple processor cores correspond to the multiple CAs one by one respectively; The processor core is used to read and write data cached in the CA corresponding to the processor core; The CA is used to execute the method according to claim 1 or 2; the HA is used to execute the method according to claim 3 or 4; Alternatively, the CA is used to execute the method as claimed in claim 5; and the HA is used to execute the method as claimed in claim 6 or 7.

Citation Information

Patent Citations

  • High-efficiency consistency detection and filtration device for multiple symmetric cores

    CN102866923A

  • Consistency processing method and device based on multi-core processor

    CN104252423A