Data processing method, server, product and medium for multi-core processor
By adopting data processing methods in the master node of multi-core processors and selecting processing strategies based on message request types and cache status, the problem of low performance and efficiency of multi-core processors is solved, and efficient data processing and system performance improvement are achieved.
Patent Information
- Application Number
- CN202411329398.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-24
- Publication Date
- 2025-01-21
- Estimated Expiration
- 2044-09-24
AI Technical Summary
The performance and efficiency of multi-core processors are inefficient and cannot meet the computing needs of high performance and complex parallel processing.
Provides a data processing method for multi-core processors, which obtains message requests, determines the hit status of directory one and directory two, and uses different processing strategies to respond to requests according to the message request type and cache status.
It improves data processing efficiency and system performance, enables targeted processing of different types of message requests, and reduces dependence on off-chip memory.
Smart Images

Figure CN118838863B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of multi-core processors, and in particular to a data processing method, server, product and medium for a multi-core processor. Background Art
[0002] As the performance improvement of single-core processors gradually slows down, multi-core processors have become an important way to improve computer performance, especially showing great potential in improving computer system performance, energy efficiency and parallel processing. The home node (HN) plays an important role in coordination and management in multi-core on-chip networks. Research focuses include improving the efficiency of cache consistency management, memory access control, and scheduling key tasks. By optimizing the design of HN nodes, highly scalable and high-performance multi-core systems can be built.
[0003] However, in traditional HN node design, research focuses on managing and optimizing data flows through direct data processing, but these approaches may not meet current computing needs in environments that require high performance and complex parallel processing.
[0004] It can be seen that how to improve the performance and efficiency of multi-core processors is a technical problem that people in this field need to solve urgently. Summary of the invention
[0005] The purpose of the present invention is to provide a data processing method, server, product and medium for a multi-core processor to solve the technical problems of low performance and efficiency of the multi-core processor.
[0006] In order to solve the above technical problems, the present invention provides a data processing method of a multi-core processor, which is applied to a master node, and the method comprises:
[0007] Obtaining a message request sent by the current requesting node; wherein the message request includes at least message request content and a message request type, and the message request type includes at least one of a read request type, a no data request type, and a write request type; the master node and the requesting node both have a cache;
[0008] Determine the hit status of directory one and directory two in the master node according to the message request; wherein the directory one records the data address stored in the master node and the cache status of the master node, and the directory two records the data address stored in each of the requesting nodes and the cache status of each of the requesting nodes;
[0009] Different processing strategies are adopted to respond to the message request sent by the current request node according to the hit status of the directory one, the hit status of the directory two, the message request type, the cache status of the master node and / or the cache status of the request node; wherein the processing strategy at least includes sending the data in the master node cache to the current request node, or receiving the data sent by other request nodes and sending the data sent by the other request nodes to the current request node; the other request nodes are the request nodes among all request nodes except the current request node.
[0010] On the one hand, before determining the hit status of the directory 1 and the hit status of the directory 2 in the master node according to the message request, the method further includes:
[0011] Obtaining the address corresponding to the message request;
[0012] Determine whether the address corresponding to the message request is in an occupied state;
[0013] If not, proceed to the step of determining a hit status of the directory 1 and a hit status of the directory 2 in the master node according to the message request;
[0014] If so, the message request is stored in the cache, and the process returns to the step of determining whether the address corresponding to the message request is in an occupied state.
[0015] On the other hand, the input channels supported by the master node include a request channel, a response channel and a data channel; the input cache corresponding to the master node includes at least three first-in-first-out queues, and the request channel, the response channel and the data channel correspond to at least one first-in-first-out queue respectively.
[0016] On the other hand, the method of using different processing strategies to respond to the message request sent by the current requesting node according to the hit status of the directory one, the hit status of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes:
[0017] Determine the hit request node according to the hit condition of the directory 2;
[0018] In the case where it is detected that the message request type is a read request type, the directory one hits, the directory two hits, the cache state of the master node is shared or exclusive, and the hit request node does not contain dirty data, or, in the case where it is detected that the message request type is a read request type, the directory one hits, the directory two does not hit, and the cache state of the master node is exclusive, data is read from the cache of the master node and returned to the current request node;
[0019] In the case where it is detected that the message request type is a read request type, the directory one misses and the directory two hits, if it is detected that the target request node cache contains dirty data, then the data sent by the target request node containing the dirty data is received, and the data sent by the target request node is returned to the current request node; if it is detected that there is data in the target request node cache and the data is clean, then the data sent by any request node is received, and the received data sent by any request node is returned to the current request node; wherein the target request node is a node among the hit request nodes;
[0020] When it is detected that the message request type is a read request type, the directory one misses and the directory two misses, a listening request is sent to all request nodes. If it is detected that there is dirty data in the request node cache, the data sent by the request node containing the dirty data is received and the data is returned to the current request node. If it is detected that there is data in the cache of all request nodes and the data is clean, the data sent by any request node is received, and the data received from any request node is returned to the current request node.
[0021] On the other hand, the method of using different processing strategies to respond to the message request sent by the current requesting node according to the hit status of the directory one, the hit status of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes:
[0022] When it is detected that the message request type is a read request type, directory one misses and directory two hits, if it is detected that the directory request node cache does not contain data, or it is detected that all request node caches do not contain data, then the data sent by the memory is received, and the received data sent by the memory is returned to the current request node.
[0023] On the other hand, the method of using different processing strategies to respond to the message request sent by the current requesting node according to the hit status of the directory one, the hit status of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes:
[0024] When it is detected that the message request type is a read request type, the directory one hits, the directory two hits, the cache state of the master node is a shared state, and the hit request node contains dirty data, the data sent by the hit request node is received, and the received data sent by the hit request node is returned to the current request node.
[0025] On the other hand, the method of using different processing strategies to respond to the message request sent by the current requesting node according to the hit status of the directory one, the hit status of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes:
[0026] Determine the hit request node according to the hit condition of the directory 2;
[0027] In the case where it is detected that the message request type is a no-data request type, the directory one hits, and the directory two hits, or, in the case where it is detected that the message request type is a no-data request type, the directory one misses, and the directory two hits, the current cache status of each hit request node is obtained; according to the specific no-data transaction type, the message request sent by the current request node is responded to, and the cache status of the master node and the request node is updated according to the received response message and data message;
[0028] When it is detected that the message request type is a no-data request type, the directory one hits and the directory two misses, or when it is detected that the message request type is a no-data request type, the directory one misses and the directory two misses, a listening request is sent to all requesting nodes, the current cache status of all requesting nodes is obtained, and the cache status of the master node and the requesting node is updated according to the received response message and data message.
[0029] On the other hand, in the case where it is detected that the message request type is a no-data request type, the directory one hits, and the directory two hits, after responding to the message request sent by the current requesting node according to the specific no-data transaction type, or, in the case where it is detected that the message request type is a no-data request type, the directory one hits, and the directory two misses, after sending the listening request to all requesting nodes, it further includes:
[0030] Update the content of the directory one and the content of the directory two;
[0031] In the case where it is detected that the message request type is a no-data request type, the directory one misses, and the directory two hits, after responding to the message request sent by the current requesting node according to the specific no-data transaction type, or, in the case where it is detected that the message request type is a no-data request type, the directory one misses, and the directory two misses, after sending the listening request to all requesting nodes, the method further includes:
[0032] Update the content of the directory 2.
[0033] On the other hand, the method of using different processing strategies to respond to the message request sent by the current requesting node according to the hit status of the directory one, the hit status of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes:
[0034] Determine the hit request node according to the hit condition of the directory 2;
[0035] When it is detected that the message request type is a write request type, the directory one hits, and the directory two hits, respond to the message request sent by the current requesting node according to the specific write transaction type and the directory two record information; after receiving the response message and data message sent by the requesting node, update the master node local cache, directory one, and directory two cache status;
[0036] When it is detected that the message request type is a write request type, the directory one hits and the directory two misses, a listening request is sent to all requesting nodes according to the specific write transaction type, and after receiving the response message and data message sent by the requesting node, the master node local cache, directory one and directory two cache states are updated;
[0037] When it is detected that the message request type is a write request type, the directory one misses, and the directory two hits, respond to the request message sent by the current requesting node according to the specific write transaction; after receiving the response message and data message sent by the requesting node, update the master node local cache, directory one, and directory two cache status;
[0038] When it is detected that the message request type is a write request type, the directory one misses and the directory two misses, a listening request is sent to all requesting nodes according to the specific transaction. After receiving the response message and data message sent by the requesting node, the local cache of the master node, the cache status of directory one and directory two are updated.
[0039] On the other hand, after adopting different processing strategies to respond to the message request sent by the current requesting node according to the hit situation of the directory one, the hit situation of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node, the method further includes:
[0040] Starting from responding to the message request sent by the current requesting node, determining whether data sent by the current requesting node for indicating that data corresponding to the message request is received is received within a preset time length;
[0041] If so, then end;
[0042] If not, information representing the message request to resend the message is sent to the current requesting node, and the process returns to the step of obtaining the message request sent by the current requesting node.
[0043] On the other hand, the master node includes an input buffer module, an instruction fetch module, an address status module, a directory control module, a message processing module and an output buffer module connected in sequence;
[0044] The instruction fetch module is used to schedule the messages cached in the input cache;
[0045] The address status module is used to query the occupancy status of the address;
[0046] The directory control module includes the directory one, the directory two and a cache;
[0047] The instruction fetch module, address status module, directory control module and message processing module correspond to different clock cycles respectively; different message requests are in different clock cycles.
[0048] On the other hand, the instruction fetch module is used to process the data channel message after detecting that the response channel message processing is completed; process the cache conflict address message after detecting that the data channel message processing is completed; and process the request channel message after detecting that the cache conflict address message processing is completed.
[0049] On the other hand, after receiving the data message sent by the requesting node, it also includes:
[0050] When receiving the data message sent by the current requesting node, the data message is cached in the cache of the master node and the data in the memory is kept unchanged.
[0051] In order to solve the above technical problem, the present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the data processing method of the multi-core processor when executed by a processor.
[0052] In order to solve the above technical problem, the present invention further provides a server, comprising:
[0053] Memory for storing computer programs;
[0054] The processor is used to implement the steps of the data processing method of the multi-core processor when executing the computer program.
[0055] In order to solve the above technical problem, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the data processing method of the multi-core processor are implemented.
[0056] The data processing method of the multi-core processor applied to the master node provided by the present invention first obtains the message request sent by the current request node, and then determines the hit status of directory one and the hit status of directory two in the master node according to the message request; finally, different processing strategies are adopted to respond to the message request sent by the current request node according to the hit status of directory one, the hit status of directory two, the message request type, the cache status of the master node and / or the cache status of the request node.
[0057] The beneficial effects of the present invention are as follows: firstly, the master node in the data processing method of the multi-core processor has a cache, and since the directory one contained in the master node records the data address stored in the master node and the cache status of the master node, and the directory two records the data address stored in each request node and the cache status of each request node, when the read message request hits the directory one and / or hits the directory two of the master node, the master node can directly use the data in its cache or use the data sent by other request nodes received by it to respond to the message request, without using the off-chip memory to respond to the message request, thereby improving the efficiency of data processing and improving the performance of the system; secondly, in the data processing method, when responding to the request message, the hit situation of the directory one, the hit situation of the directory two, the message request type, the cache status of the master node and / or the cache status of the request node are considered, so that the processing strategy can be accurately and reasonably determined, thereby realizing the use of a reasonable processing strategy to respond to the message request; and, different types of message requests (read request type, no data request type and write request type) are responded to in different ways, realizing targeted processing of various types of message requests.
[0058] In addition, before determining the hit status of directory one and directory two in the main node based on the message request, if the address corresponding to the message request is occupied, it is first stored in the cache, and the message is processed after the address is released, avoiding blocking of the message request.
[0059] Taking into account that the message lengths of different channels may be different, in this method, corresponding first-in-first-out queues are set for the input channels of the master node, and unified storage of messages of each channel is achieved through each first-in-first-out queue.
[0060] Under various message request types (read request message type, no data request message type and write request message type), different response methods are adopted for different hit situations (such as the situation where both directory one and directory two are hit, the situation where directory one misses and directory two hits, the situation where directory one misses and directory two misses, and the situation where directory one misses and directory two hits), so that the adopted response method is more in line with the actual situation.
[0061] After responding to the message request sent by the current requesting node, it is judged whether the data sent by the current requesting node for indicating that the data corresponding to the message request is received is received within a preset time period, thereby ensuring the integrity of the request processing.
[0062] In the master node, the instruction fetch module, address status module, directory control module, and message processing module correspond to different clock cycles respectively, and different message requests are in different clock cycles, that is, the master node processes different message requests in a pipeline manner, which improves the message throughput and reduces the message processing delay; the instruction fetch module is used to detect that there is data in the input cache, and reads the message in the first-in-first-out queue according to the priority, and the priority is that the response channel takes precedence over the data channel takes precedence over the address conflict cache takes precedence over the request channel. Only when the first-in-first-out queue corresponding to the response channel, data channel, and address conflict cache is read empty, will the message in the first-in-first-out queue corresponding to the request channel be read, because the transaction end mark is the response message, and this priority sorting ensures the transaction processing efficiency in the master node.
[0063] When data is written back to the memory, it is first cached in the local cache of the master node and is not written back to the memory immediately, ensuring that the master node cache will be hit when the read request is made again. While improving processing efficiency, the overall system performance is further improved because the frequency of interaction with the memory is reduced due to writing back data.
[0064] In addition, the present invention also provides a computer program product, a server and a computer-readable storage medium, which have the same or corresponding technical features as the data processing method of the multi-core processor mentioned above, and have the same effects as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0065] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0066] Figure 1 A flowchart of a data processing method for a multi-core processor provided by an embodiment of the present invention;
[0067] Figure 2 A schematic diagram of a multi-core network-on-chip architecture provided by an embodiment of the present invention;
[0068] Figure 3 A schematic diagram of a channel supported by a master node provided in an embodiment of the present invention;
[0069] Figure 4 A schematic diagram of a master node architecture provided by an embodiment of the present invention;
[0070] Figure 5 A flowchart of a read request transaction processing method provided by an embodiment of the present invention;
[0071] Figure 6 A schematic diagram of a comparison of the ReadOnce transaction process in Example 1 provided in an embodiment of the present invention;
[0072] Figure 7 A schematic diagram of a comparison of the ReadOnce transaction process in Embodiment 2 provided in an embodiment of the present invention;
[0073] Figure 8 A schematic diagram of a comparison of the ReadOnce transaction process in Embodiment 3 provided in an embodiment of the present invention;
[0074] Fig. 9 A data-free request transaction flow chart provided by an embodiment of the present invention;
[0075] Fig.10 A write request transaction flow chart provided by an embodiment of the present invention;
[0076] Fig.11 A structural diagram of a server provided in another embodiment of the present invention. DETAILED DESCRIPTION
[0077] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0078] The core of the present invention is to provide a data processing method, server, product and medium for a multi-core processor to solve the technical problems of low performance and efficiency of the multi-core processor.
[0079] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 1 A flowchart of a data processing method for a multi-core processor provided by an embodiment of the present invention, the method is applied to a master node, comprising:
[0080] S10: Obtain the message request sent by the current requesting node;
[0081] S11: determining a hit status of directory 1 and a hit status of directory 2 in the master node according to the message request;
[0082] The directory 1 records the data address stored in the master node and the cache status of the master node, and the directory 2 records the data address stored in each request node and the cache status of each request node;
[0083] S12: Using different processing strategies to respond to the message request sent by the current requesting node according to the hit status of directory one, the hit status of directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node.
[0084] First, the application scenario of the present invention, that is, a multi-core on-chip network architecture, is described. Specifically, a multi-core on-chip network architecture including three request nodes (RN) and one home node (HN) is used as an example for description. Figure 2 A schematic diagram of a multi-core network-on-chip architecture provided by an embodiment of the present invention is shown in FIG. Figure 2 As shown in the figure, it consists of three request nodes (request node 0, request node 1 and request node 2), a master node, a subordinate node (SN), a crossbar and memory. Each request node and master node has a cache, the slave node is responsible for communicating with the memory, and the crossbar is responsible for overall task scheduling. The request node is responsible for sending messages, which are sent to the master node after being scheduled by the crossbar. Each request node can also obtain data from the memory through the crossbar and the system node.
[0085] The master node has two levels of directories. Directory 1 records the cache status of the master node, and directory 2 records the cache status of each request node.
[0086] The master node receives the request message and queries directory 1 and directory 2. If directory 1 hits and there is no dirty data in other request nodes, the data can be directly read from the master node cache for reply. If directory 2 hits, a listen request needs to be sent to the request node that hits. If both directory 1 and directory 2 do not hit, a listen request needs to be sent to other request nodes. If there is no data in the cache of the request node and the cache of the master node, the data needs to be read from the off-chip memory, which seriously affects the system processing efficiency.
[0087] Messages can be divided into four categories according to channel classification, namely request channel (REQ), response channel (RSP), data channel (DAT), and snoop channel (SNP).
[0088] Figure 3 A schematic diagram of a channel supported by a master node provided in an embodiment of the present invention, such as Figure 3As shown, the master node supports input request channel, response channel and data channel; supports output request channel, listening channel, response channel and data channel.
[0089] Figure 4 A schematic diagram of a master node architecture provided by an embodiment of the present invention is shown as follows: Figure 4 As shown, the master node includes an input cache module, an instruction fetch module, an address status module, a directory control module, a message processing module and an output cache module which are connected in sequence.
[0090] The input cache module is responsible for caching the messages scheduled by the cross switch. The input cache corresponding to the master node contains at least three first-in-first-out queues, and the request channel, response channel and data channel correspond to at least one first-in-first-out queue respectively. For example, the input cache module is composed of three input caches according to the input message request type.
[0091] The instruction fetch module is used to schedule cached messages in the input cache. To ensure processing efficiency, the instruction fetch module is used to detect when there is data in the input cache and read the messages in the first-in-first-out queue according to priority. The response channel message is loaded first. If the response channel input cache is empty, the data channel message is loaded, followed by the cache conflict address message, and finally the request channel message.
[0092] The address status module is used to query the address occupation status; if the address is occupied, the message is stored in the cache and processed after the address is released. If the address is not occupied, the message is input into the lower-level pipeline directory control module.
[0093] The directory control module contains directory 1, directory 2 and cache; directory 1 records the cache status, and the mapping relationship is full mapping. Directory 2 records the cache status of other request nodes. The message is loaded into the directory control module, and directory 1 and directory 2 are queried at the same time. If directory 1 hits, the cache data is loaded into the message processing module. If directory 1 does not hit and directory 2 hits, the directory 2 information is loaded into the message processing module. If both directory 1 and directory 2 do not hit, a hit_miss signal is sent to the message processing module.
[0094] The message processing module is responsible for replying to received messages, maintaining cache consistency and releasing addresses.
[0095] The output buffer module is responsible for buffering the output messages and sending them to the destination node through the crossbar switch.
[0096] In practice, in order to improve the message throughput and reduce the message processing delay, the master node is designed as a four-stage pipeline. The message passes through the instruction fetch module, address status module, directory control module, and message processing module in sequence; one message requires 4 clock cycles to process. In the same clock cycle, if the first message is in the message processing module, the second message is in the directory control module, the third message is in the address control module, and the fourth message is in the instruction fetch module. Figure 4 As shown, the instruction fetch module corresponds to clock cycle one, the address status module corresponds to clock cycle two, the directory control module corresponds to clock cycle three, and the message processing module corresponds to clock cycle four.
[0097] When using the above-mentioned multi-core on-chip network architecture for data processing, first obtain the message request sent by the current request node. There is no limitation on the current request node, and any request node that issues a message request can be called the current request node. The message request includes at least the message request content and the message request type, and the message request type includes at least one of the read request type, the no data request type, and the write request type; the master node and the request node both have caches. When the master node processes the message, it is divided into read request, no data request, and write request according to the message type. A read request refers to a request that a node needs to obtain the latest data. A no data request refers to a request that a node needs to change the cache status. A write request means that a node needs to update data and eventually write the dirty data back to the memory.
[0098] Before determining the hit status of the directory 1 and the hit status of the directory 2 in the primary node according to the message request, the method further includes:
[0099] Get the address corresponding to the message request;
[0100] Determine whether the address corresponding to the message request is in an occupied state;
[0101] If not, then proceed to determine the hit status of directory 1 and directory 2 in the master node according to the message request;
[0102] If so, the message request is stored in the cache, and the process returns to the step of determining whether the address corresponding to the message request is in an occupied state.
[0103] After obtaining the message request sent by the current requesting node, the memory address corresponding to the message request is compared with the memory address in directory one and the memory address in directory two. If they are the same, it is a hit; otherwise, it is a miss.
[0104] Finally, different processing strategies are adopted to respond to the message request sent by the current request node according to the hit situation of directory one, the hit situation of directory two, the message request type, the cache status of the master node and / or the cache status of the request node. Among them, the processing strategy at least includes sending the data in the cache of the master node to the current request node, or receiving the data sent by other request nodes and sending the data sent by other request nodes to the current request node; other request nodes are request nodes other than the current request node among all request nodes. It is worth noting that the cache state in the embodiment of the present invention adopts the five states defined in the Coherent Hub Interface (CHI) protocol to describe the cache line state. The I state (Invalid State) is an invalid state. The SC state (Shared Clean State) is a shared state, the cache line data is clean, and there may be cache line copies in other cores. The SD state (Shared Dirty State) is a shared state, the cache line data is dirty, and there may be cache line copies in other cores. The UC state (Unique Clean State) is an exclusive state, the cache line data is clean, and there is no cache line copy in other cores. The UD state (Unique Dirty State) is an exclusive state, the cache line data is dirty, and there is no cache line copy in other cores.
[0105] In the method provided in this embodiment, firstly, the master node and the request node in the data processing method of the multi-core processor are both provided with caches, and since the directory 1 contained in the master node records the data address stored in the master node and the cache status of the master node, and the directory 2 records the data address stored in each request node and the cache status of each request node, when the message request hits the directory 1 of the master node and / or hits the directory 2, the master node can directly use the data in its cache or use the data sent by other request nodes received by it to respond to the message request, without using the on-chip monitoring request and the off-chip memory to respond to the message request, thereby improving the efficiency of data processing and the consistency maintenance process and improving the performance of the system; secondly, when responding to the request message, the hit situation of the directory 1, the hit situation of the directory 2, the message request type, the cache status of the master node and / or the cache status of the request node are considered, so that the processing strategy can be accurately and reasonably determined, thereby realizing the use of a reasonable processing strategy to respond to the message request; and, different types of message requests (read request type, no data request type and write request type) are responded to in different ways, realizing targeted processing of various types of message requests.
[0106] When the message request type is a read request type, different processing strategies are adopted to respond to the message request sent by the current requesting node according to the hit status of directory one, the hit status of directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node, including:
[0107] Determine the hit request node according to the hit situation of directory 2;
[0108] When it is detected that the message request type is a read request type, directory one hits, directory two hits, the cache state of the master node is shared or exclusive, and the hit request node does not contain dirty data, or, when it is detected that the message request type is a read request type, directory one hits, directory two misses, and the cache state of the master node is exclusive, data is read from the cache of the master node and returned to the current request node;
[0109] When it is detected that the message request type is a read request type, directory one misses, and directory two hits, if it is detected that the target request node cache contains dirty data, then the data sent by the target request node containing the dirty data is received, and the data sent by the target request node is returned to the current request node; if it is detected that there is data in the target request node cache and the data is clean, then the data sent by any request node is received, and the data received from any request node is returned to the current request node; wherein the target request node is a node among the hit request nodes;
[0110] When it is detected that the message request type is a read request type, directory one misses, and directory two misses, a listening request is sent to all request nodes. If it is detected that there is dirty data in the request node cache, the data sent by the request node containing the dirty data is received, and the data is returned to the current request node; if it is detected that all request nodes have data in their caches and the data is clean, the data sent by any request node is received, and the data received from any request node is returned to the current request node.
[0111] When it is detected that the message request type is a read request type, directory one misses and directory two hits, if it is detected that the directory request node cache does not contain data, or it is detected that all request node caches do not contain data, the data sent by the memory is received and the received data sent by the memory is returned to the current request node.
[0112] In the case where it is detected that the message request type is a read request type, the directory hits one, the directory hits two, the cache state of the master node is a shared state, and the hit request node contains dirty data, the data sent by the hit request node is received, and the received data sent by the hit request node is returned to the current request node. In the case where it is detected that the message request type is a read request type, the directory hits one, the directory hits two, the cache state of the master node is a shared state, and the hit request node contains dirty data, after returning the received data sent by the hit request node to the current request node, it also includes:
[0113] Update the contents of directory 1, directory 2, and the cache of the primary node.
[0114] In the case where it is detected that the message request type is a read request type, directory one misses, and directory two hits, if it is detected that the target request node cache contains dirty data, then receiving data sent by the target request node containing the dirty data, and after returning the data sent by the target request node to the current request node, further comprising:
[0115] Update the contents of directory 1, directory 2, and the cache of the master node;
[0116] In the case where it is detected that the message request type is a read request type, directory one misses, and directory two misses, after returning the received data sent by any requesting node to the current requesting node, the method further includes:
[0117] Update the contents of directory 1, directory 2, and the cache of the primary node.
[0118] By updating the contents of directory one, directory two and the cache of the master node, the cache status of the master node recorded in directory one, the cache status of each request node recorded in directory two, and the cache status and cache data of the master node are updated.
[0119] Figure 5 A flowchart of a read request transaction processing method provided by an embodiment of the present invention, such as Figure 5 As shown, the method includes:
[0120] S13: receiving a read request;
[0121] S14: Determine whether the address is occupied; if so, proceed to step S15; if not, proceed to step S16;
[0122] S15: Waiting for address release;
[0123] S16: Obtain the hit status of directory 1 and directory 2;
[0124] S17: Directory 1 hit, Directory 2 hit;
[0125] S18: Determine whether the hit node has dirty data; if so, proceed to step S19; if not, proceed to step S20;
[0126] S19: Initiate monitoring to the hit node, and the hit node replies with data, and updates directory 1, directory 2 and local cache at the same time according to the needs;
[0127] S20: Read data from the master node cache and send it to the requesting node;
[0128] S21: Directory 1 hits, directory 2 misses;
[0129] S22: Read data from the master node cache and send it to the requesting node;
[0130] S23: Directory 1 misses, directory 2 hits;
[0131] S24: Initiate monitoring to the hit node according to the specific transaction;
[0132] S25: Directory 1 misses, Directory 2 misses;
[0133] S26: initiate monitoring to all requesting nodes;
[0134] S27: Determine whether there is data in the monitored node cache; if so, proceed to step S28; if not, proceed to step S29;
[0135] S28: The monitored node replies with data and updates directory 1, directory 2 and local cache at the same time;
[0136] S29: Read data from the memory and update directory 1, directory 2 and local cache at the same time.
[0137] like Figure 5As shown in the figure, when a request node initiates a read request transaction, the address status module queries whether the address is occupied. If the address is occupied, it needs to wait for the address to be released. If the address is not occupied, it checks whether directory 1 and directory 2 are hit in the directory control module. Directory 1 records the cache status, and directory 2 records the cache status of other request nodes. The query directory result is input into the message processing module. If both directory 1 and directory 2 are hit, the data is read from the local cache and then replied in the form of a data packet. Then it is determined whether the hit node has dirty data. If there is dirty data, a listening request is initiated to the hit node. If there is no dirty data, the data is read from the main node cache for reply. If directory 1 hits and directory 2 does not hit, the data is also read from the local cache and replied in the form of a data packet. If directory 1 does not hit and directory 2 hits, a listening request is initiated to the hit node. If there is valid data in the cache of other request nodes, the other request nodes will reply, otherwise it will be read from the memory. If neither directory 1 nor directory 2 hits, a listening request is initiated to all nodes in the form of broadcast. If there is valid data in the cache of other requesting nodes, the other requesting nodes will reply. Otherwise, it will be read from the memory.
[0138] In order to enable persons skilled in the art to better understand the flow of the read request processing of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods. Figure 6 The schematic diagram of the comparison of the ReadOnce transaction process in the first embodiment of the present invention provides that both directory 1 and directory 2 are hit, and the RN node has no dirty data. The cache status of the request node 0 to the request node 2 when directory 2 is hit is ISCI. Figure 6 The figure above is a schematic diagram of the unoptimized ReadOnce transaction process. Request node 0 sends a ReadOnce read request to the master node (read request, and does not change the node state). After the master node queries the directory, it finds that the directory hits. The cache state of request node 1 is SC state, and the cache state of request node 2 is I state. Therefore, a snoop request is initiated to request node 1. Request node 1 replies with a snoop response (SnpRespData_SC) with data, and the cache state is SC state. After processing, the master node sends a data message (CompData_I) to request node 0, and the cache state is I state. Request node 0 replies with a transaction completion response (CompAck) to the master node to indicate the end of the transaction. Figure 6 The following figure is a schematic diagram of the ReadOnce transaction flow after using the method provided by the present invention. Figure 6As can be seen in the figure below, both directory 1 and directory 2 are hit. After receiving the transaction request, the master node queries directory 1 and finds that the cache state is SC, and there is no dirty data in the requesting node. Therefore, the data is read directly from the local cache and sent directly to the requesting node 0 that initiated the request in the form of a data packet (CompData_I). The requesting node 0 replies with a transaction completion response (CompAck) to the master node to indicate the end of the transaction. Figure 6 From the above and below figures, we can see that the transaction process can be greatly reduced after optimization.
[0139] Figure 7 A schematic diagram of the comparison of the ReadOnce transaction process in the second embodiment provided by the present invention. Directory 1 is hit, and directory 2 is not hit. Figure 7 The figure above is a schematic diagram of the unoptimized transaction process. Request node 0 sends a ReadOnce read request to the master node. After the master node queries the directory, it finds that the directory is not hit. The master node initiates a listen request to other request nodes. After other request nodes reply with a listen response, it finds that there is no data in the cache of other request nodes. Therefore, it needs to read data from the memory, and sends a read request to the memory (ReadNoSnp) to the system node. After reading the data from the memory, it forwards it to the request node 0 that initiated the request. Request node 0 replies with a transaction completion response (CompAck) to the master node to indicate the end of the transaction.
[0140] Figure 7 The following figure is a schematic diagram of the ReadOnce transaction flow after using the method provided by the present invention. Figure 7 As can be seen in the figure below, directory 1 hits, but directory 2 misses. After receiving the transaction request, the master node queries directory 1 and finds that the cache state is SD. Although directory 2 misses, it can be determined based on cache consistency that there is no dirty data in other requesting nodes. Therefore, the master node directly reads the data from the local cache and sends it to the requesting node 0 that initiated the request in the form of a data packet (CompData_I). Requesting node 0 replies with a transaction completion response (CompAck) to the master node to indicate the end of the transaction. Figure 7 From the above and below figures, we can see that the transaction process can be greatly reduced after optimization.
[0141] Figure 8 Schematic diagram of the comparison of the ReadOnce transaction process in the third embodiment of the present invention. Directory 1 and Directory 2 are both hit, and the RN node has dirty data. Directory 2 hits the cache status of the RN0 to RN2 nodes is ISDI, such as Figure 8 shown. Figure 8The figure above is a schematic diagram of the unoptimized ReadOnce transaction process. Request node 0 sends a ReadOnce read request to the master node. After the master node queries the directory, it finds that the directory hits. The cache state of request node 1 is SD, so a listening request is initiated to request node 1. Request node 1 replies with a data message (SnpRespData_SC_PD) that needs to be written back to the memory. After processing, the master node sends a data message (CompData_I) to request node 0. Request node 0 replies with a transaction completion response (CompAck) to the master node to indicate the end of the transaction.
[0142] Figure 8 The figure below is a schematic diagram of the ReadOnce transaction flow after using the method provided by the present invention. Directory 1 and Directory 2 are both hit. After receiving the transaction request, the master node finds that there is dirty data in other request nodes, so it initiates monitoring to the hit node. After receiving the data, the master node sends it to the request node 0 that initiated the request in the form of a data packet of data message (CompData_I). Request node 0 replies with a transaction completion response (CompAck) to the master node to indicate the end of the transaction. However, at this time, the master node does not write the dirty data back to the memory immediately, but updates the data in the master node cache and changes the cache state from SC state to SD state, and writes the dirty data back to the memory when the cache is replaced. The reason why the cache state is changed to SD state is to ensure that the cached data can eventually be written back to the memory, and there will be no inconsistency between the cache and the memory data. Comparison Figure 8 From the above and below figures, we can see that the number of heap memory accesses can be greatly reduced after optimization.
[0143] The processing process of the read request transaction is described above. This embodiment illustrates the process of processing a message request of a non-data request type. According to the hit situation of directory one, the hit situation of directory two, the message request type, the cache status of the master node and / or the cache status of the request node, different processing strategies are used to respond to the message request sent by the current request node, including:
[0144] Determine the hit request node according to the hit situation of directory 2;
[0145] When it is detected that the message request type is a no data request type, a directory one hit, a directory two hit, or when it is detected that the message request type is a no data request type, a directory one miss, and a directory two hit, obtain the current cache status of each hit request node; according to the specific no data transaction type, respond to the message request sent by the current request node, and update the cache status of the master node and the request node according to the received response message and data message.
[0146] When it is detected that the message request type is a no data request type, directory one hits, and directory two misses, or when it is detected that the message request type is a no data request type, directory one misses, and directory two misses, a listening request is sent to all requesting nodes to obtain the current cache status of all requesting nodes, and the cache status of the master node and the requesting node is updated according to the received response message and data message.
[0147] In the case where it is detected that the message request type is a no-data request type, a directory hit, or a directory hit, after responding to the message request sent by the current requesting node according to the specific no-data transaction type, or, in the case where it is detected that the message request type is a no-data request type, a directory hit, or a directory miss, after sending a listening request to all requesting nodes, it also includes:
[0148] Update the contents of Directory 1 and Directory 2;
[0149] In the case where it is detected that the message request type is a no-data request type, a directory one miss, and a directory two hit, after responding to the message request sent by the current requesting node according to the specific no-data transaction type, or, in the case where it is detected that the message request type is a no-data request type, a directory one miss, and a directory two miss, after sending a listening request to all requesting nodes, it also includes:
[0150] Update the contents of directory 2.
[0151] Fig. 9 A data-free request transaction flow chart provided by an embodiment of the present invention. Fig. 9 As shown, the method includes:
[0152] S30: receiving a no-data request;
[0153] S31: Determine whether the address is occupied; if so, proceed to step S32; if not, proceed to step S33;
[0154] S32: Waiting for address release;
[0155] S33: Obtain the hit status of directory 1 and directory 2;
[0156] S34: Directory 1 hits, Directory 2 hits;
[0157] S35: Initiate monitoring to the hit node according to the specific transaction, and update directory 1, directory 2 and local cache status at the same time;
[0158] S36: Directory 1 hits, directory 2 misses;
[0159] S37: Initiate monitoring to all request nodes and update directory 1, directory 2 and local cache status at the same time;
[0160] S38: Directory 1 misses, directory 2 hits;
[0161] S39: Initiate monitoring to the hit node according to the specific transaction and update directory 2 at the same time;
[0162] S40: Directory 1 misses, directory 2 misses;
[0163] S41: Initiate monitoring to all requesting nodes and update directory 2 at the same time.
[0164] When an RN node initiates a no-data request transaction, the address status module queries whether the address is occupied. If the address is occupied, it is necessary to wait for the address to be released. If the address is not occupied, the directory control module checks whether directory one and directory two are hit. If both directory one and directory two are hit, a listen is initiated to the hit node according to the specific transaction, and directory one, directory two and the local cache status are updated at the same time. If directory one is hit and directory two is not hit, a listen is initiated to other request nodes in the form of a broadcast, and directory one, directory two and the local cache status are updated at the same time. If directory one is not hit and directory two is hit, a listen is initiated to the hit node according to the specific transaction, and directory two is updated at the same time, and directory one and the local cache are not operated. If both directory one and directory two are not hit, a listen request is initiated to other request nodes, and directory two is updated at the same time, and directory one and the local cache are not operated.
[0165] The above embodiment describes the transaction flow of no data request, and this embodiment describes the process of processing the write request type. According to the hit situation of directory one, the hit situation of directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node, different processing strategies are adopted to respond to the message request sent by the current requesting node, including:
[0166] Determine the hit request node according to the hit situation of directory 2;
[0167] When it is detected that the message request type is a write request type, directory one hits, and directory two hits, respond to the message request sent by the current requesting node according to the specific write transaction type and directory two record information; after receiving the response message and data message sent by the requesting node, update the master node local cache, directory one, and directory two cache status;
[0168] When it is detected that the message request type is a write request type, directory one hits, and directory two misses, a listening request is sent to all requesting nodes according to the specific write transaction type; after receiving the response message and data message sent by the requesting node, the master node local cache, directory one, and directory two cache status are updated.
[0169] When it is detected that the message request type is a write request type, directory one misses and directory two hits, respond to the request message sent by the current requesting node according to the specific write transaction; after receiving the response message and data message sent by the requesting node, update the local cache of the master node, and the cache status of directory one and directory two.
[0170] When it is detected that the message request type is a write request type, directory one misses, and directory two misses, a listening request is sent to all requesting nodes according to the specific transaction; after receiving the response message and data message sent by the requesting node, the local cache of the master node, the cache status of directory one, and directory two are updated. Fig.10 A write request transaction flow chart provided by an embodiment of the present invention. Fig.10 As shown, the method includes:
[0171] S42: receiving a write request;
[0172] S43: Determine whether the address is occupied; if so, proceed to step S44; if not, proceed to step S45;
[0173] S44: Waiting for address release;
[0174] S45: Obtaining the hit status of the directory 1 and the directory 2;
[0175] S46: Directory 1 hits, Directory 2 hits;
[0176] S47: Initiate monitoring to the hit node according to the specific transaction, and update directory 1, directory 2 and local cache at the same time;
[0177] S48: Directory 1 hits, directory 2 misses;
[0178] S49: Initiate monitoring to the requesting node and update directory 1, directory 2 and local cache at the same time;
[0179] S50: Directory 1 misses, directory 2 hits;
[0180] S51: Initiate monitoring to the hit node according to the specific transaction, update directory 1 and directory 2 at the same time, and replace the local cache;
[0181] S52: Directory 1 misses, directory 2 misses;
[0182] S53: Initiate monitoring to all requesting nodes, update directory 1 and directory 2 at the same time, and replace the local cache.
[0183] When a RN node initiates a write request transaction, the address status module queries whether the address is occupied. If the address is occupied, it needs to wait for the address to be released. If the address is not occupied, the directory control module checks whether directory one and directory two hit.
[0184] If both directory one and directory two hit, a listener is initiated to the hit node according to the specific transaction, and directory one and directory two are updated at the same time, and then the local cache data and status are updated. If directory one hits and directory two misses, a listener is initiated to other request nodes, and directory one and directory two and local cache data and status are updated at the same time. If directory one misses and directory two hits, a listener is initiated to the hit node according to the specific transaction, and directory one and directory two are updated at the same time, and the local cache is replaced. If both directory one and directory two miss, a listener is initiated to other request nodes, and directory one and directory two are updated at the same time, and the local cache is replaced.
[0185] After using different processing strategies to respond to the message request sent by the current requesting node according to the hit situation of the directory one, the hit situation of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node, the method further includes:
[0186] Starting from responding to the message request sent by the current requesting node, determining whether data sent by the current requesting node for indicating that data corresponding to the message request has been received is received within a preset time length;
[0187] If so, then end;
[0188] If not, information representing the message resending request is sent to the current requesting node, and the process returns to the step of obtaining the message request sent by the current requesting node.
[0189] There is no limit on the preset duration, which will be determined based on actual conditions.
[0190] In the method provided in this embodiment, after responding to the message request sent by the current requesting node, it is judged whether the data sent by the current requesting node for indicating that the data corresponding to the message request is received is received within a preset time period, thereby ensuring the integrity of the request processing.
[0191] In the method provided by the present invention, the master node is designed with a cache, and some transactions passing through the master node can be directly replied by the master node, thereby realizing efficient sharing among multiple cores, reducing the frequency of access to the memory, and greatly reducing the process of the master node processing transactions.
[0192] After receiving the data message sent by the requesting node, it also includes:
[0193] When receiving the data message sent by the current requesting node, the data message is cached in the cache of the master node and the data in the memory is kept unchanged.
[0194] That is, when the master node receives the data message sent by the request node, it does not write it back to the memory immediately, but caches it in the master node cache; at the same time, the cache state is a dirty data exclusive state, so that the cached data can eventually be written back to the memory.
[0195] In the above embodiments, the data processing method of the multi-core processor is described in detail, and the present invention also provides embodiments of the data processing device and server of the multi-core processor. It should be noted that the present invention describes the embodiments of the device part from two perspectives, one is based on the perspective of the functional module, and the other is based on the perspective of the hardware.
[0196] An embodiment of the present invention provides a data processing device for a multi-core processor. This embodiment, based on the perspective of functional modules, includes:
[0197] A first acquisition module is used to acquire a message request sent by the current requesting node; wherein the message request at least includes message request content and message request type, and the message request type includes at least one of a read request type, a no data request type, and a write request type; the master node and the requesting node both have a cache;
[0198] A determination module, used to determine the hit status of directory one and directory two in the master node according to the message request; wherein directory one records the data address stored in the master node and the cache status of the master node, and directory two records the data address stored in each request node and the cache status of each request node;
[0199] A response module is used to respond to the message request sent by the current request node using different processing strategies according to the hit status of directory one, the hit status of directory two, the message request type, the cache status of the master node and / or the cache status of the request node; wherein the processing strategy at least includes sending data in the master node cache to the current request node, or receiving data sent by other request nodes and sending the data sent by other request nodes to the current request node; other request nodes are request nodes among all request nodes except the current request node.
[0200] In some embodiments, the data processing device of the multi-core processor further includes:
[0201] A second acquisition module is used to obtain the address corresponding to the message request;
[0202] The first judgment module is used to judge whether the address corresponding to the message request is in an occupied state; if not, the determination module is triggered; if so, the cache module is triggered;
[0203] The cache module is used to store the message request in the cache.
[0204] In some embodiments, the data processing device of the multi-core processor further includes:
[0205] The second judgment module is used to judge whether the data sent by the current requesting node for indicating that the data corresponding to the message request is received is received within a preset time length starting from responding to the message request sent by the current requesting node; if not, trigger the sending module; if yes, end;
[0206] The sending module is used to send information representing a request to resend a message to the current requesting node.
[0207] Since the embodiments of the device part correspond to the embodiments of the method part, please refer to the description of the embodiments of the method part for the embodiments of the device part, and they will not be repeated here. The effects are the same as above.
[0208] Fig.11 This is a structural diagram of a server provided by another embodiment of the present invention. This embodiment is based on the hardware perspective, such as Fig.11 As shown, the server includes:
[0209] A memory 20, for storing computer programs;
[0210] The processor 21 is used to implement the steps of the data processing method of the multi-core processor mentioned in the above embodiment when executing the computer program.
[0211] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 can be implemented in at least one hardware form of a digital signal processor (DSP), a field-programmable gate array (FPGA), and a programmable logic array (PLA). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 21 may be integrated with a graphics processing unit (GPU), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 21 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0212] The memory 20 may include one or more computer-readable storage media, which may be non-transitory. The memory 20 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 20 is at least used to store the following computer program 201, wherein, after the computer program is loaded and executed by the processor 21, it can implement the relevant steps of the data processing method of the multi-core processor disclosed in any of the aforementioned embodiments. In addition, the resources stored in the memory 20 may also include an operating system 202 and data 203, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 202 may include Windows, Unix, Linux, etc. Data 203 may include but is not limited to the data involved in the data processing method of the multi-core processor mentioned above.
[0213] In some embodiments, the server may further include a display screen 22 , an input / output interface 23 , a communication interface 24 , a power supply 25 , and a communication bus 26 .
[0214] Those skilled in the art will understand that Fig.11 The structure shown in the figure does not constitute a limitation on the server, and may include more or fewer components than shown in the figure.
[0215] The server provided by the embodiment of the present invention includes a memory and a processor. When the processor executes the program stored in the memory, it can implement the following method: a data processing method of a multi-core processor, and the effect is the same as above.
[0216] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the data processing method of the multi-core processor when executed by a processor.
[0217] Finally, the present invention also provides an embodiment corresponding to a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps recorded in the above method embodiment are implemented.
[0218] It is understandable that if the method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium to execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc. Various media that can store program codes.
[0219] The computer-readable storage medium provided by the present invention includes the data processing method of the multi-core processor mentioned above, and the effect is the same as above.
[0220] The above is a detailed introduction to a data processing method, server, product and medium for a multi-core processor provided by the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the embodiments can be referenced to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principle of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the present invention.
[0221] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A data processing method for a multi-core processor, characterized in that: Applied to the master node, the method comprises: Obtaining a message request sent by the current requesting node; wherein the message request includes at least message request content and a message request type, and the message request type includes at least one of a read request type, a no data request type, and a write request type; the master node and the requesting node both have a cache; Determine the hit status of directory one and directory two in the master node according to the message request; wherein the directory one records the data address stored in the master node and the cache status of the master node, and the directory two records the data address stored in each of the requesting nodes and the cache status of each of the requesting nodes; Different processing strategies are adopted to respond to the message request sent by the current request node according to the hit status of the directory one, the hit status of the directory two, the message request type, the cache status of the master node and / or the cache status of the request node; wherein the processing strategy at least includes sending the data in the master node cache to the current request node, or receiving the data sent by other request nodes and sending the data sent by the other request nodes to the current request node; the other request nodes are the request nodes among all request nodes except the current request node.
2. The data processing method of a multi-core processor according to claim 1, characterized in that: Before determining the hit status of the directory 1 and the hit status of the directory 2 in the master node according to the message request, the method further includes: Obtaining the address corresponding to the message request; Determine whether the address corresponding to the message request is in an occupied state; If not, proceed to the step of determining a hit status of the directory 1 and a hit status of the directory 2 in the master node according to the message request; If so, the message request is stored in the cache, and the process returns to the step of determining whether the address corresponding to the message request is in an occupied state.
3. The data processing method of a multi-core processor according to claim 1, characterized in that: The input channels supported by the master node include a request channel, a response channel and a data channel; the input cache corresponding to the master node includes at least three first-in-first-out queues, and the request channel, the response channel and the data channel correspond to at least one first-in-first-out queue respectively.
4. The data processing method of a multi-core processor according to claim 1, characterized in that: The adopting different processing strategies to respond to the message request sent by the current requesting node according to the hit condition of the directory one, the hit condition of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes: Determine the hit request node according to the hit condition of the directory 2; In the case where it is detected that the message request type is a read request type, the directory one hits, the directory two hits, the cache state of the master node is shared or exclusive, and the hit request node does not contain dirty data, or, in the case where it is detected that the message request type is a read request type, the directory one hits, the directory two does not hit, and the cache state of the master node is exclusive, data is read from the cache of the master node and returned to the current request node; In the case where it is detected that the message request type is a read request type, the directory one misses and the directory two hits, if it is detected that the target request node cache contains dirty data, then the data sent by the target request node containing the dirty data is received, and the data sent by the target request node is returned to the current request node; if it is detected that there is data in the target request node cache and the data is clean, then the data sent by any request node is received, and the received data sent by any request node is returned to the current request node; wherein the target request node is a node among the hit request nodes; When it is detected that the message request type is a read request type, the directory one misses and the directory two misses, a listening request is sent to all request nodes. If it is detected that there is dirty data in the request node cache, the data sent by the request node containing the dirty data is received and the data is returned to the current request node. If it is detected that there is data in the cache of all request nodes and the data is clean, the data sent by any request node is received, and the data received from any request node is returned to the current request node.
5. The data processing method of a multi-core processor according to claim 1, characterized in that: The adopting different processing strategies to respond to the message request sent by the current requesting node according to the hit condition of the directory one, the hit condition of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes: When it is detected that the message request type is a read request type, directory one misses and directory two hits, if it is detected that the directory request node cache does not contain data, or it is detected that all request node caches do not contain data, then the data sent by the memory is received, and the received data sent by the memory is returned to the current request node.
6. The data processing method of a multi-core processor according to claim 4, characterized in that: The adopting different processing strategies to respond to the message request sent by the current requesting node according to the hit condition of the directory one, the hit condition of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes: When it is detected that the message request type is a read request type, the directory one hits, the directory two hits, the cache state of the master node is a shared state, and the hit request node contains dirty data, the data sent by the hit request node is received, and the received data sent by the hit request node is returned to the current request node.
7. The data processing method of a multi-core processor according to claim 1, characterized in that: The adopting different processing strategies to respond to the message request sent by the current requesting node according to the hit condition of the directory one, the hit condition of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes: Determine the hit request node according to the hit condition of the directory 2; In the case where it is detected that the message request type is a no-data request type, the directory one hits, and the directory two hits, or, in the case where it is detected that the message request type is a no-data request type, the directory one misses, and the directory two hits, the current cache status of each hit request node is obtained; according to the specific no-data transaction type, the message request sent by the current request node is responded to, and the cache status of the master node and the request node is updated according to the received response message and data message; When it is detected that the message request type is a no-data request type, the directory one hits and the directory two misses, or when it is detected that the message request type is a no-data request type, the directory one misses and the directory two misses, a listening request is sent to all requesting nodes, the current cache status of all requesting nodes is obtained, and the cache status of the master node and the requesting node is updated according to the received response message and data message.
8. The data processing method of a multi-core processor according to claim 7, characterized in that: In the case where it is detected that the message request type is a no-data request type, the directory one hits, and the directory two hits, after responding to the message request sent by the current requesting node according to the specific no-data transaction type, or, in the case where it is detected that the message request type is a no-data request type, the directory one hits, and the directory two misses, after sending the listening request to all requesting nodes, it further includes: Update the content of the directory one and the content of the directory two; In the case where it is detected that the message request type is a no-data request type, the directory one misses, and the directory two hits, after responding to the message request sent by the current requesting node according to the specific no-data transaction type, or, in the case where it is detected that the message request type is a no-data request type, the directory one misses, and the directory two misses, after sending the listening request to all requesting nodes, the method further includes: Update the content of the directory 2.
9. The data processing method of a multi-core processor according to claim 1, characterized in that: The adopting different processing strategies to respond to the message request sent by the current requesting node according to the hit condition of the directory one, the hit condition of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node includes: Determine the hit request node according to the hit condition of the directory 2; When it is detected that the message request type is a write request type, the directory one hits, and the directory two hits, respond to the message request sent by the current requesting node according to the specific write transaction type and the directory two record information; after receiving the response message and data message sent by the requesting node, update the master node local cache, directory one, and directory two cache status; When it is detected that the message request type is a write request type, the directory one hits and the directory two misses, a listening request is sent to all requesting nodes according to the specific write transaction type, and after receiving the response message and data message sent by the requesting node, the master node local cache, directory one and directory two cache states are updated; When it is detected that the message request type is a write request type, the directory one misses, and the directory two hits, respond to the request message sent by the current requesting node according to the specific write transaction; after receiving the response message and data message sent by the requesting node, update the master node local cache, directory one, and directory two cache status; When it is detected that the message request type is a write request type, the directory one misses and the directory two misses, a listening request is sent to all requesting nodes according to the specific transaction. After receiving the response message and data message sent by the requesting node, the local cache of the master node, the cache status of directory one and directory two are updated.
10. The data processing method of a multi-core processor according to any one of claims 1 to 9, characterized in that: After adopting different processing strategies to respond to the message request sent by the current requesting node according to the hit situation of the directory one, the hit situation of the directory two, the message request type, the cache status of the master node and / or the cache status of the requesting node, the method further includes: Starting from responding to the message request sent by the current requesting node, determining whether data sent by the current requesting node for indicating that data corresponding to the message request is received is received within a preset time length; If so, then end; If not, information representing the message request to resend the message is sent to the current requesting node, and the process returns to the step of obtaining the message request sent by the current requesting node.
11. The data processing method of a multi-core processor according to claim 10, characterized in that: The master node includes an input cache module, an instruction fetch module, an address status module, a directory control module, a message processing module and an output cache module which are connected in sequence; The instruction fetch module is used to schedule the messages cached in the input cache; The address status module is used to query the occupancy status of the address; The directory control module includes the directory one, the directory two and a cache; The instruction fetch module, address status module, directory control module and message processing module correspond to different clock cycles respectively; different message requests are in different clock cycles.
12. The data processing method of a multi-core processor according to claim 11, characterized in that: The instruction fetch module is used to process the data channel message after detecting that the response channel message processing is completed; process the cache conflict address message after detecting that the data channel message processing is completed; and process the request channel message after detecting that the cache conflict address message processing is completed.
13. The data processing method of a multi-core processor according to any one of claims 4 to 7, characterized in that: After receiving the data message sent by the requesting node, it also includes: When receiving the data message sent by the current requesting node, the data message is cached in the cache of the master node and the data in the memory is kept unchanged.
14. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the data processing method for a multi-core processor according to any one of claims 1 to 13 are implemented.
15. A server, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the data processing method for a multi-core processor as claimed in any one of claims 1 to 13 when executing the computer program.
16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps of the data processing method for the multi-core processor according to any one of claims 1 to 13 are implemented.
Citation Information
Patent Citations
On-chip network system supporting cache coherence and data request method
CN101958834A
Distributed system part changing method and distributed system
CN110661637A