Cache status recording method, data access method and related devices and equipment

By using the peripheral shared identifier in the host cache record table to update the cache data status, the problem of peripheral device cache data status recording in the CXL protocol is solved, reducing hardware costs and improving system performance.

CN116107771BActive Publication Date: 2024-09-20CHENGDU HAIGUANG INTEGRATED CIRCUIT DESIGN CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202211593112.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2024-09-20
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

In the CXL protocol, how to effectively record cached data status in peripheral devices to ensure data consistency? The existing technology has problems such as excessive or too small increase in storage space, resulting in high hardware costs and performance degradation.

Method used

By introducing the peripheral sharing identifier into the host cache record table, the identifier is updated to indicate whether the cached data is shared by the peripheral device, and when the processor core is exclusive, the identifier is updated to record the status of the cached data and avoid additional settings of the peripheral device. Device cache record table.

Benefits of technology

The method of recording the cache data status of peripheral devices in the host cache record table is implemented, which reduces hardware costs, avoids the negative impact of increased storage space on system performance, and ensures the correctness and efficiency of the data access process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116107771B
    Figure CN116107771B
Patent Text Reader

Abstract

An embodiment of the present invention provides a cache status recording method, a data access method and related devices and equipment. The method is applied to a listening filter, wherein a host cache record table is configured in the listening filter, wherein the host cache record table is used to record the status of the host's cache data in the host cache, and a peripheral sharing identifier corresponding to the cache data, wherein the peripheral sharing identifier is used to indicate whether the cache data is shared by a peripheral device. The method comprises: when a peripheral device shares cache data in the host cache, updating the peripheral sharing identifier so that the peripheral sharing identifier indicates that the corresponding cache data is shared by the peripheral device; when a processor core exclusively occupies cache data, updating the peripheral sharing identifier so that the peripheral sharing identifier indicates that the corresponding cache data is not shared by the peripheral device. The method can realize the recording of cache data status in the peripheral device.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a cache status recording method, a data access method, and related devices and equipment. Background Art

[0002] The Compute Express Link (CXL) interconnect protocol is a protocol for achieving cache consistency between a host and a device, and is used to make the data in the host cache and the data in the device cache consistent, thereby avoiding data conflicts in the computing device.

[0003] The CXL protocol supports the cache consistency protocol, which is a protocol used to achieve data consistency in the caches of multiple processor cores in a host in a multi-core processor scenario. The cache consistency protocol divides the cache data in each cache into multiple different states to indicate the degree to which the corresponding cache data is shared by multiple processor cores, and performs different operations based on the corresponding states. In the CXL protocol, the cache data in the cache of the peripheral device is divided into corresponding states, and corresponding operations are performed based on the corresponding states.

[0004] Accordingly, when accessing corresponding cache data based on the CXL protocol, it is necessary to record the state of the cache data in the peripheral device, so as to perform corresponding operations based on the corresponding state. How to record the state of cache data in the peripheral device is a technical problem that needs to be solved urgently by those skilled in the art. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a cache status recording method, a data access method and related devices and equipment, which can realize the recording of cache data status in a peripheral device.

[0006] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0007] An embodiment of the present invention provides a cache status recording method, which is applied to a listening filter, wherein a host cache record table is configured in the listening filter, wherein the host cache record table is used to record the status of cache data of the host in the host cache, and a peripheral device sharing identifier corresponding to the cache data, wherein the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device, and the method comprises:

[0008] When the peripheral device shares the cached data in the host cache, updating the peripheral sharing identifier so that the peripheral sharing identifier indicates that the corresponding cached data is shared by the peripheral device;

[0009] When the processor core exclusively occupies the cache data, the peripheral device sharing flag is updated so that the peripheral device sharing flag indicates that the corresponding cache data is not shared by the peripheral device.

[0010] Optionally, when the peripheral device exclusively caches data, it also includes:

[0011] A device cache information update request is sent to update the device cache information in the memory, so that the device cache information indicates a state in which corresponding memory data is exclusively occupied by the peripheral device cache.

[0012] Optionally, when the peripheral device exclusively caches data, it also includes:

[0013] Delete the status entry corresponding to the cache data in the host cache record table.

[0014] Optionally, when the processor core exclusively caches the data, it also includes:

[0015] The host cache record table is updated to correspond to the state of the cache data in the host cache, so that the state of the cache data in the host cache record table indicates that the cache data is exclusively occupied by the processor core.

[0016] Optionally, when the processor core exclusively caches the data and the host cache record table does not contain the cache status of the data to be accessed, the method further includes:

[0017] A device cache information update request is sent to the memory controller to update the device cache information in the memory, so that the device cache information indicates that the corresponding memory data is cached by the peripheral device as invalid.

[0018] The embodiment of the present invention further provides a data access method, which is applied to a listening filter, comprising:

[0019] Obtaining an access request, wherein the access request is used to enable the request initiator to access the data to be accessed, and the access request includes permission information that the request initiator needs to obtain;

[0020] Querying whether there is a cache status of the to-be-accessed data in a host cache record table, wherein the host cache record table is used to record the status of the cache data of the host in the host cache, and a peripheral device sharing identifier corresponding to the cache data, wherein the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device;

[0021] Based on the authority required to obtain the access request and the information in the host cache record table, processing is performed on the data to be accessed.

[0022] Optionally, in the access request, the request initiator is a peripheral device, and the device cache of the peripheral device requests to obtain sharing authority for the data to be accessed;

[0023] When the cache status of the data to be accessed exists in the host cache record table, the processing of the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table includes:

[0024] Sending a data acquisition request to a processor core that caches the data to be accessed, wherein the data acquisition request is used to acquire the data to be accessed cached by the processor core;

[0025] After the processor core sends the data to be accessed, acquiring the data to be accessed sent by the processor core;

[0026] Sending the data to be accessed to the peripheral device;

[0027] The updating process of the host cache record table is executed, so that the peripheral device sharing identifier corresponding to the to-be-accessed data in the host cache record table indicates that the corresponding cache data is shared by the peripheral device.

[0028] Optionally, in the access request, the request initiator is a processor core among multiple processor cores, and the processor core requests to obtain exclusive authority for the data to be accessed;

[0029] When the cache status of the data to be accessed exists in the host cache record table and the data to be accessed is shared by the device cache, the processing of the data to be accessed based on the permission required for the access request and the information in the host cache record table includes:

[0030] Sending a data processing request to a processor core that caches the data to be accessed, and sending a data clearing request to a peripheral device, wherein the data processing request is used to obtain the data to be accessed and clear cached data of the corresponding cache, and the data clearing request is used to clear cached data of the corresponding cache;

[0031] After the processor core that caches the data to be accessed responds to the data processing request, sends the data to be accessed to the listening filter, and clears the cached data corresponding to the data to be accessed, the data to be accessed is acquired;

[0032] After the peripheral device responds to the data clearing request, clears the cache data corresponding to the data to be accessed, and sends a response message to the listening filter, the data to be accessed is sent to the processor core that initiates the access request;

[0033] The updating process of the host cache record table is executed, so that the host cache record table records the exclusive state corresponding to the data to be accessed, and the peripheral sharing mark corresponding to the data to be accessed indicates that the corresponding cache data is not shared by the peripheral device.

[0034] Optionally, when the cache status of the data to be accessed does not exist in the host cache record table, performing processing on the data to be accessed based on the permission required for the access request and the information in the host cache record table includes:

[0035] Sending a data read request to a memory controller, wherein the data read request is used to read the data to be accessed and device cache information corresponding to the data to be accessed;

[0036] After the memory controller responds to the data read request and sends the to-be-accessed data and the device cache information corresponding to the to-be-accessed data to the listening filter, the to-be-accessed data is acquired;

[0037] Query the device cache information to determine whether there is another state in which the peripheral device caches the data to be accessed;

[0038] If yes, send a data clearing request, the data clearing request is used to request the peripheral device to clear the cache data corresponding to the data to be accessed; after the peripheral device responds to the data processing request, clears the cache data corresponding to the data to be accessed, and sends a response message to the listening filter, the data to be accessed is sent to the processor core;

[0039] And, executing the updating process of the host cache record table, so that the exclusive state corresponding to the to-be-accessed data is recorded in the host cache record table, and the peripheral sharing identifier corresponding to the to-be-accessed data indicates that the corresponding cache data is not shared by the peripheral device; and executing the device cache information updating process, so that the device cache information indicates that the corresponding memory data is cached by the peripheral device as invalid;

[0040] If not, sending the data to be accessed to the processor core that initiated the access request;

[0041] And, executing the updating process of the host cache record table, so that the host cache record table records the exclusive status corresponding to the to-be-accessed data, and the peripheral sharing identifier corresponding to the to-be-accessed data indicates that the corresponding cache data is not shared by the peripheral device.

[0042] Optionally, in the access request, the request initiator is a peripheral device, and the peripheral device requests exclusive permission for the data to be accessed;

[0043] When the cache status of the data to be accessed exists in the host cache record table, the processing of the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table includes:

[0044] Sending a data processing request to a processor core that caches the data to be accessed, wherein the data processing request is used to obtain the data to be accessed and clear cache data corresponding to the processor core;

[0045] After the processor core responds to the data processing request, sends the data to be accessed to the listening filter, and clears the cache data corresponding to the data to be accessed, the data to be accessed is acquired;

[0046] Sending the data to be accessed to the peripheral device;

[0047] A device cache information update process is executed so that the device cache information indicates that the corresponding memory data is exclusively occupied by the peripheral device cache.

[0048] An embodiment of the present invention further provides a computer device, including a host and a peripheral device;

[0049] Among them, the listening filter is configured with a host cache record table, which is used to record the status of the host's cache data in the host cache, and a peripheral sharing identifier corresponding to the cache data, and the peripheral sharing identifier is used to indicate whether the cache data is shared by a peripheral device.

[0050] Optionally, the host cache record table includes status entries corresponding to cache data in the host one by one, and the status entries include address tags, cache status, data owners, data distribution, and the peripheral sharing identifier;

[0051] The peripheral device sharing identifier is configured in a redundant bit of the status entry; or the peripheral device sharing identifier is configured in an independent storage bit of the status entry.

[0052] Optionally, the peripheral sharing identifier occupies 1 bit of storage space of the status entry.

[0053] Optionally, the host further includes a memory, and device cache information of the cache data of the peripheral device is stored in the memory, and the device cache information is used to record status information of the cache data of the peripheral device.

[0054] Optionally, the device cache information is stored in a redundant space of a memory page where memory data corresponding to the cache data is located.

[0055] Optionally, the device cache information includes a peripheral sharing identifier, a device cache status and a device cache data owner, wherein the peripheral sharing identifier is used to mark whether the corresponding memory data is cached in the peripheral device, the device cache status is used to mark the status of the corresponding memory data in the device cache, and the device cache data owner is used to record the device identifier of the peripheral device that caches the memory data.

[0056] Optionally, the memory also includes an error checking and correction verification code, and the error checking and correction verification code is calculated based on the device cache information and the corresponding memory data.

[0057] The embodiment of the present invention further provides a cache status recording device, which is applied to a listening filter, wherein the listening filter is configured with a host cache record table, the host cache record table is used to record the status of the host's cache data in the host cache, and a peripheral device sharing identifier corresponding to the cache data, the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device, including:

[0058] An identification update module is used to update the peripheral sharing identification when the peripheral device shares the cache data in the host cache, so that the peripheral sharing identification indicates that the corresponding cache data is shared by the peripheral device; when the processor core exclusively owns the cache data, update the peripheral sharing identification so that the peripheral sharing identification indicates that the corresponding cache data is not shared by the peripheral device.

[0059] The embodiment of the present invention further provides a data access device, comprising:

[0060] A request acquisition module, used to acquire an access request, wherein the access request is used to enable the request initiator to access the data to be accessed, and the access request includes permission information that the request initiator needs to obtain;

[0061] a status query module, used to query whether there is a cache status of the to-be-accessed data in the host cache record table, the host cache record table is used to record the status of the host's cache data in the host cache, and a peripheral device sharing identifier corresponding to the cache data, the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device;

[0062] The access processing module is used to process the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table.

[0063] An embodiment of the present invention further provides a storage medium, which stores one or more executable instructions, and the one or more executable instructions are used to execute the cache status recording method provided by the embodiment of the present invention, or execute the data access method provided by the embodiment of the present invention.

[0064] An embodiment of the present invention provides a cache status recording method, a data access method and related devices and equipment. The method is applied to a listening filter, wherein the listening filter is configured with a host cache record table, wherein the host cache record table is used to record the status of the host's cache data in the host cache, and a peripheral sharing identifier corresponding to the cache data, wherein the peripheral sharing identifier is used to indicate whether the cache data is shared by a peripheral device. The method comprises: when a peripheral device shares cache data in the host cache, updating the peripheral sharing identifier so that the peripheral sharing identifier indicates that the corresponding cache data is shared by the peripheral device; and when a processor core exclusively occupies cache data, updating the peripheral sharing identifier so that the peripheral sharing identifier indicates that the corresponding cache data is not shared by the peripheral device.

[0065] It can be seen that the cache status recording scheme and data access scheme provided by the embodiments of the present invention can record the peripheral sharing identifier based on the host cache record table, determine the main status affecting the data processing flow, and thus realize the recording of the cache data status in the peripheral device, and then execute the corresponding access process based on the information in the host cache record table. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0067] Figure 1 An optional architectural diagram for a computer device;

[0068] Figure 2 A structural diagram for an optional status entry;

[0069] Figure 3 An optional structural diagram of a host cache record table provided in an embodiment of the present invention;

[0070] Figure 4 An optional device cache information structure diagram provided for an embodiment of the present invention;

[0071] Figure 5 An optional flow chart of a data access method provided by an embodiment of the present invention;

[0072] Figure 6 An optional flow diagram of data processing provided by an embodiment of the present invention;

[0073] Figure 7 Another optional flow chart of data processing provided by an embodiment of the present invention;

[0074] Figure 8 A schematic diagram of another optional flow chart of data processing provided by an embodiment of the present invention;

[0075] Fig. 9 A schematic diagram of another optional flow chart of data processing provided by an embodiment of the present invention;

[0076] Fig.10 An optional block diagram of a cache status recording device provided by an embodiment of the present invention;

[0077] Fig.11 An optional block diagram of a data access device provided by an embodiment of the present invention. DETAILED DESCRIPTION

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

[0079] As described in the background technology, when executing the corresponding cache data access based on the CXL protocol, it is necessary to record the status of the cache data in the peripheral device, so as to perform the corresponding operation based on the corresponding status. How to record the status of the cache data in the peripheral device is a technical problem that needs to be solved by those skilled in the art. Below, a detailed description is given in conjunction with the data access process of the computer device.

[0080] refer to Figure 1 An optional architecture diagram of a computer device is shown, the computer device includes a host and a peripheral device (also referred to as a device). The host includes multiple processor cores (also referred to as computing cores, with processor core 0 and processor core 1 being used as examples in the figure), a memory controller, a peripheral controller, and a snoop filter.

[0081] Among them, each processor core is configured with a corresponding host cache, and data access is implemented based on the corresponding host cache. The memory controller is used to read data in the memory and send it to the host cache, or write data in the host cache to the memory. The corresponding interactions with the memory are all performed based on the memory controller. The peripheral controller is used to control the data access process based on the peripheral device, and the corresponding interactions with the peripheral device are all performed based on the peripheral controller. The listening filter is used to record the status of the cache data of each processor core in the host cache based on the access request of the bus, and make each access request perform different processing processes based on the status of the cache data recorded by it. Among them, in the example of the present invention, the peripheral controller performs control of the peripheral based on the CXL protocol.

[0082] The state of cached data in the cache may include four states: M (Modified), E (Exclusive), S (Shared), and I (Invalid). Among them, M indicates that the cached data is in a modified state, E indicates that the cached data is in an exclusive state, S indicates that the cached data is in a shared state, and I indicates that the cached data is in an invalid state.

[0083] In the listening filter, for the host cache, the state of the cache data of the host cache can be recorded through the host cache record table, wherein the host cache record table can be set with a corresponding number of state entries based on the spatial position of the cache to record the state of the cache data of the corresponding cache space. An optional structure of the state entry is as follows: Figure 2 As shown, it includes address tag, cache status, data owner and data distribution, where the address tag is used to identify the system address of the corresponding cache data, the cache status record corresponds to the status in the cache, which can be M, E or S, etc. The data owner records the processor core with owner authority for the current record address, and the data distribution records the cache status of the current record address in the processor core.

[0084] In an optional solution, in order to maintain the cache consistency of the peripheral device, a device cache record table is further set in the snoop filter, so as to maintain the consistency of the cache data in the peripheral device and the host based on the device cache record table.

[0085] Specifically, in the cache of the peripheral device (also called the device cache), the status of the cached data in the cache can also include four states: M (Modified), E (Exclusive), S (Share), and I (Invalid). Among them, when the cache state of the cached data is M, the latest data is only stored in the device cache, and there is no copy anywhere else, and the data must be obtained from the device cache. When the cache state of the cached data is E, the latest data is stored in both the device cache and the host memory, and the latest data can be obtained through the host memory or the device cache. When the cache state of the cached data is S, the latest data exists in the host cache, the host memory, and the device cache at the same time, and the latest data can be obtained from any of the above. When the cache state of the cached data is I, the latest data must not be in the device cache, and may exist in the host cache or the host memory. Among them, after obtaining the permission of the E state, the peripheral device can silently rewrite the E state to the M state locally, so the E state and the M state can be considered together.

[0086] Correspondingly, the device cache record table includes status entries corresponding to the device cache space positions one by one, and based on the corresponding status entries, cache consistency maintenance of the device cache can be achieved based on the device cache record table.

[0087] It can be seen that in order to record the cache data of the device cache, it is necessary to increase the storage space in the snoop filter to store the corresponding state entries. However, the number of peripheral devices and their corresponding cache space sizes are variable. If the increased storage space is too large, the corresponding hardware cost is too high. If the increased storage space is too small, the system performance will be degraded due to hardware mismatch. Obviously, this cache recording method for peripheral devices has too many defects.

[0088] After studying the status of cached data and the access process of the corresponding cached data, the inventor believes that for the cached data in the device cache, whether it is cached by the host and whether it is shared by peripheral devices and processor cores are the main factors affecting its access process. Among them, by determining whether it is cached by the host, it can be determined whether data can be transferred based on the cached data in the host cache, and by determining whether it is shared by peripheral devices and processor cores, when it is necessary to obtain exclusive rights to the cached data, it can be determined whether there is a device with shared cached data, and then the cached data in the corresponding device can be cleared.

[0089] In view of this, the inventor believes that whether the data is cached by the host can be confirmed based on the host cache record table. At the same time, the cache data shared by the peripheral devices and the processor core will inevitably be recorded in the host cache. Therefore, a small adjustment can be made to the host cache record table to mark whether the corresponding cache data is shared by the peripheral devices and the processor core, thereby determining the processing flow of the corresponding cache data.

[0090] In view of this, an embodiment of the present invention provides a cache status recording scheme and a data access scheme, which records the sharing status of cache data by adding a peripheral sharing identifier to a host cache record table to indicate whether the cache data is shared by a peripheral device, and then when the peripheral device shares the cache data in the host cache, the peripheral sharing identifier is updated so that the peripheral sharing identifier indicates that the corresponding cache data is shared by the peripheral device; at the same time, when the processor core monopolizes the cache data shared by the peripheral device, the peripheral sharing identifier is updated so that the peripheral sharing identifier indicates that the corresponding cache data is not shared by the peripheral device.

[0091] It can be seen that the cache status recording method provided in the embodiment of the present invention records the peripheral sharing identifier based on the host cache record table, determines the main status affecting the data processing flow, and thus can realize the recording of the cache data status in the peripheral device, and then can execute the corresponding access process based on the information in the host cache record table.

[0092] Furthermore, the cache status recording method provided by the embodiment of the present invention does not require additionally setting up a device cache record table corresponding to the peripheral device, thereby eliminating the need to increase storage space to store corresponding data. At the same time, there is no need to consider the impact of the number of peripheral devices and the size of their cache space on the system, thereby avoiding the defects caused by increasing the device cache record table.

[0093] The cache status recording method provided by an embodiment of the present invention is described in detail below.

[0094] The cache status recording method can be applied to Figure 1 In the computer device shown, the difference between the aforementioned host cache record table and the host cache record table is that, in addition to recording the status of the host's cache data in the host cache, the host cache record table further records the peripheral device sharing identifier corresponding to the cache data, and the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device.

[0095] refer to Figure 3 An optional structural diagram of a host cache record table provided by an embodiment of the present invention is shown, in which status entries corresponding one-to-one to the spatial location of the host cache, that is, corresponding one-to-one to the cache data in the host are provided, and the status entries may include address tags, cache status, data owners and data distribution to indicate the status of the host's cache data in the host cache, and at the same time, the status entries may further include a peripheral sharing identifier, and the peripheral sharing identifier is used to indicate whether the corresponding cache data is shared by a peripheral device, wherein the sharing by a peripheral device refers to the sharing of the cache of the peripheral device.

[0096] In a specific example, when there are redundant bits in the status entry, the redundant bits of the status entry can be configured as the peripheral sharing identifier; when there are no redundant bits in the status entry, storage space corresponding to the peripheral sharing identifier can be added as an independent storage bit to record the peripheral sharing identifier.

[0097] It should be noted that, since the peripheral sharing identifier is only used to mark whether it is a peripheral device sharing, it only requires a small amount of space to implement. For example, it can be recorded with 1 bit of storage space, so that the "0" or "1" recorded in the bit indicates whether the corresponding cache data is shared by the peripheral device. Compared with setting up an additional device cache record table corresponding to the peripheral device, the embodiment of the present invention obviously requires less storage space, and thus the corresponding hardware cost is also lower.

[0098] It is understandable that in Figure 3 In the status entry shown, the address identifier is used to identify the system address of the corresponding cache data, the cache status record corresponds to the status in the host cache, which can be M, E or S, etc. The data owner records the processor core with owner authority for the current record address, and the data distribution records the cache status of the current record address in the processor core. For example, the corresponding cache data cache is shared in processor core 1 and processor core 2, then the data distribution record here can record the identifiers of the corresponding processor core 1 and processor core 2 to indicate that the cache data is shared in processor core 1 and processor core 2.

[0099] It is understandable that the host cache record table only records the information of the cache data in the corresponding host cache. Correspondingly, the cache data in the device cache that is not shared by the host cache cannot be reflected in the host cache record table. In order to avoid possible data conflicts, in the optional example of the present invention, the state information of the cache data of the device cache (also referred to as device cache information) can be further stored in the memory, for example, the exclusive state information, modification state information, etc. of the cache data of the device cache. In a specific example, the corresponding device cache information can be stored in the redundant space of the memory to store the state of the cache data of the peripheral device. Among them, the original data of the cache data, that is, the memory data, is stored in the memory. It is understandable that during the data access process, the memory data can be read into the cache as the cache data. Correspondingly, the corresponding device cache information can be configured for the memory data cached in the peripheral cache. In a specific example, the device cache information is stored in the redundant space of the memory page where the memory data is located.

[0100] The device cache information may correspond to the memory data corresponding to the cache data, wherein a memory address (a memory page may correspond to a memory address) may correspond to a device cache information. Figure 4Taking an optional device cache information structure diagram as an example, the device cache information may include a peripheral sharing identifier, a device cache status, a device cache data owner, etc., wherein the peripheral sharing identifier is used to mark whether the corresponding memory data is cached in the peripheral device, the device cache status is used to mark the status of the corresponding memory data in the device cache, and the device cache data owner is used to record the device identifier of the peripheral device that caches the memory data.

[0101] It should be noted that the peripheral sharing identifier in the host cache record table records the sharing status corresponding to the cache data shared by the host cache and the device cache, and the device cache information can only store other status of the corresponding cache data to reduce the complexity of the device cache information.

[0102] It is understandable that when it is necessary to confirm the status of data that is not shared by the host cache in the device cache, the confirmation can be performed based on the device cache information stored in the memory.

[0103] In a further optional example, there is also an ECC (Error Correcting Code) verification code in the memory, and the device cache information can be subjected to ECC calculation simultaneously with the memory data to obtain the ECC verification code, so that integrity protection can be performed together with the memory data based on the ECC verification code.

[0104] Next, the cache data status recording process is further described in conjunction with the data access process, wherein the cache data status recording process can be implemented based on the listening filter of the above-mentioned computer device and the host cache record table configured in the listening filter. Specifically, the reference Figure 5 An optional process of data access is shown, the process comprising:

[0105] Step S100: obtaining an access request;

[0106] The access request is used to enable the request initiator to access the data to be accessed. The request initiator can be a peripheral device or a processor core in the host. The request initiator initiates the access process to execute the assigned task.

[0107] It should be noted that in an architecture with multiple processor cores, in order to maintain data consistency, the access request also includes permission information that the request initiator needs to obtain. The permission information can be, for example, sharing permissions, exclusive permissions, modification permissions, etc. Different permission information corresponds to the status of cached data. For example, when cached data needs to be shared, the permission information corresponding to the access request is sharing permissions. After the corresponding cached data is obtained, the status of the cached data is recorded as a shared status, that is, it is in a shared state. The same is true for other permissions, which will not be elaborated in the present invention.

[0108] It can be understood that the access request also includes address information of the data to be accessed, and the address information may be a system address of the data to be accessed, so that the specific data to be accessed can be determined based on the address information.

[0109] Step S110: querying the host cache record table to see whether there is a cache status of the data to be accessed;

[0110] The host cache record table is used to record the state of the host's cache data in the host cache, and the peripheral device sharing identifier corresponding to the cache data, and the peripheral device sharing identifier is used to indicate whether the cache data is shared by the device cache.

[0111] It is understandable that the access request includes address information of the data to be accessed, and the host cache record table can be queried based on the address information.

[0112] In an optional example, the host cache record is provided with status entries corresponding one to one with the spatial location of the host cache, and the status entries may include the address tag, cache status, data owner, data distribution and peripheral sharing identifier of the cache data cached in the corresponding spatial location to indicate the status of the host's cache data in the host cache, and whether the corresponding cache data is shared by the peripheral device.

[0113] It is understandable that in Figure 3 In the status entry shown, the address identifier is used to identify the system address of the corresponding cache data, the cache status record corresponds to the status in the host cache, which can be M, E or S, etc. The data owner records the processor core with owner authority for the current record address, and the data distribution records the cache status of the current record address in the processor core. For example, the corresponding cache data cache is shared in processor core 1 and processor core 2, then the data distribution record here can record the identifiers of the corresponding processor core 1 and processor core 2 to indicate that the cache data is shared in processor core 1 and processor core 2.

[0114] The peripheral sharing flag is used to indicate whether the cached data is shared by the peripheral device. It can be understood that whether the cached data is shared by the peripheral device is the main factor affecting the data access process. Therefore, by only recording whether the cached data is shared by the peripheral device, it is possible to occupy as little storage space as possible while determining the specific data access process, thereby reducing hardware costs as much as possible.

[0115] Step S120: Based on the authority required for the access request and the information in the host cache record table, processing the data to be accessed is performed;

[0116] Based on the information in the host cache record table, it can be determined whether there is a cache status of the to-be-accessed data in the host cache record table. If yes, it can also be determined whether the corresponding to-be-accessed data is shared by the device cache.

[0117] It can be understood that by determining whether the data to be accessed is cached by the host, it can be determined whether the data to be accessed can be transferred based on the cached data in the host cache, and by determining whether it is shared by the peripheral device and the processor core, when it is necessary to obtain exclusive rights to the cached data, it can be determined whether there is a device whose cached data is shared, and then the cached data in the corresponding device can be cleared, so that the corresponding data processing flow can be executed based on the information in the host cache record table.

[0118] Correspondingly, after executing the corresponding data processing, the cache data status can be recorded based on the result of the data processing. Specifically, when the peripheral device shares the cache data in the host cache, step S130 is executed.

[0119] Step S130: updating the peripheral device sharing identifier so that the peripheral device sharing identifier indicates that the corresponding cache data is shared by the peripheral device.

[0120] It should be noted that the cached data in the host cache shared by the peripheral device means that, when the request initiator of the access request is the peripheral device, the corresponding access request is used to request the permission to obtain the data to be accessed as a shared permission, and, based on the corresponding data processing flow, when the peripheral device obtains the data to be accessed, step S130 is executed to update the peripheral sharing identifier.

[0121] Correspondingly, when the processor core exclusively caches the data, step S140 is executed.

[0122] Step S140: updating the peripheral device sharing identifier so that the peripheral device sharing identifier indicates that the corresponding cache data is not shared by the peripheral device.

[0123] Among them, the processor core exclusively caches the data, which means that when the access request is initiated by the processor core, the corresponding access request is used to request the exclusive permission for obtaining the data to be accessed, and based on the corresponding data processing flow, the processor core obtains the data to be accessed, and after other processor cores or peripheral devices clear the data to be accessed, step S140 is executed to update the peripheral sharing identifier.

[0124] It is understandable that when the processor core exclusively caches data, it is necessary to determine whether the data to be accessed is shared by the peripheral device based on the information recorded in the host cache record table, so as to determine whether the peripheral device needs to perform a data clearing process.

[0125] In a further example, information about the device cache being in other states may be recorded in the memory. Specifically, when the peripheral device exclusively caches data, step S150 is executed.

[0126] Step S150: Send a device cache information update request to update the device cache information in the memory, so that the device cache information indicates that the corresponding memory data is exclusively occupied by the peripheral device cache.

[0127] It should be noted that the peripheral device exclusively caches the data, which means that when the access request is initiated by the peripheral device, the corresponding access request is used to request the exclusive permission for the data to be accessed, and based on the corresponding data processing flow, the peripheral device obtains the data to be accessed, and after the processor core clears the data to be accessed, step S150 is executed to send a device cache information update request to the memory controller to update the device cache information.

[0128] Correspondingly, the memory controller executes step S160 based on the device cache information update request to update the device cache information corresponding to the to-be-accessed data in the memory.

[0129] It can be seen that the cache status recording method provided in the embodiment of the present invention can record the peripheral sharing identifier based on the host cache record table, determine the main status affecting the data processing flow, and thus realize the recording of the cache data status in the peripheral device, and then execute the corresponding access process based on the information in the host cache record table.

[0130] It is understandable that, based on the different permissions of the data requested by different request initiators, the corresponding data access process and cache data recording method are also different. Below, the data access method and cache data recording method in the embodiment of the present invention are further explained in combination with different data initiators and the permissions of the requested data.

[0131] Specifically, take the device cache request of the peripheral device to obtain the sharing permission of the data to be accessed as an example. Figure 6 The optional flow chart of data processing shown in the figure, the data access method and the cache data recording method may include:

[0132] Step S200: the listening filter obtains the access request of the peripheral device;

[0133] Among them, in the permission information of the access request, the access request may request to obtain the sharing permission of the data to be accessed. It should be noted that, in the host, the interaction information of the peripheral device is performed based on the peripheral controller, and the corresponding access request can be issued based on the peripheral controller.

[0134] It can be understood that step S200 is a specific implementation of step S100, and detailed description can refer to the introduction of step S100.

[0135] Step S210: the listening filter queries the host cache record table to see whether there is a cache status of the data to be accessed;

[0136] It is understandable that, based on the access request of the peripheral device, it can be queried whether the data to be accessed exists in the host cache, and whether the data to be accessed is shared by the device cache.

[0137] It can be understood that step S210 is a specific implementation of step S110, and detailed description can refer to the introduction of step S110.

[0138] Step S220: the listening filter processes the data to be accessed based on the authority required for the access request and the information in the host cache record table;

[0139] In the embodiment of the present invention, the access request is a request by a peripheral device to obtain sharing authority for the data to be accessed. It is understandable that when the cache status of the data to be accessed exists in the host cache record table, the processing of the data to be accessed may specifically include:

[0140] Step S221: the listening filter sends a data acquisition request to the processor core that caches the data to be accessed, where the data acquisition request is used to acquire the data to be accessed cached by the processor core.

[0141] The processor core is a processor core corresponding to the cache of the data to be accessed recorded in the host cache record table, and the figure takes processor core 1 as an example for explanation. It can be understood that the cache status of the data to be accessed in the host cache record table indicates that the host cache has the data to be accessed, and at the same time, the processor core 1 that has the data to be accessed cached can be determined based on the host cache record table, so that a data acquisition request can be sent to the processor core 1 that has the data to be accessed cached to obtain the corresponding data to be accessed.

[0142] Step S222: Processor core 1 responds to the data acquisition request and sends the to-be-accessed data to the listening filter.

[0143] Step S223: the monitoring filter obtains the to-be-accessed data sent by the processor core 1 .

[0144] It can be understood that after the processor core 1 sends the data to be accessed, the intercept filter can obtain the corresponding data to be accessed.

[0145] Step S224: the intercept filter sends the data to be accessed to the peripheral device.

[0146] After acquiring the data to be accessed, the interception filter may send the data to be accessed to the peripheral device, so that the peripheral device acquires the data to be accessed.

[0147] It can be understood that the above-mentioned data access process is used to enable peripheral devices to share cached data in the host cache. Accordingly, after executing step S224, the update process of the host cache record table can also be executed to make the peripheral sharing identifier corresponding to the data to be accessed in the host cache record table indicate that the corresponding cache data is shared by the peripheral device. Specifically, step S130 can be executed to update the peripheral sharing identifier of the cache data corresponding to the data to be accessed in the host cache record table, so that the peripheral sharing identifier indicates that the corresponding cache data is shared by the peripheral device.

[0148] In a further example, taking a processor core among multiple processor cores requesting to obtain exclusive permission for accessing data as an example, refer to Figure 7 Another optional flow chart of data processing is shown, taking the case where processor core 0 requests to obtain exclusive rights to access data as an example, the data access method and cache data recording method may include:

[0149] Step S300: the listening filter obtains the access request of processor core 0;

[0150] Among them, in the permission information of the access request, the access request may request to obtain exclusive permission for the data to be accessed.

[0151] It can be understood that step S300 is a specific implementation of step S100, and detailed description can refer to the introduction of step S100.

[0152] Step S310: the listening filter queries the host cache record table to see whether there is a cache status of the data to be accessed;

[0153] It is understandable that, based on the access request of the processor core, it is possible to query whether the data to be accessed exists in the host cache, and whether the data to be accessed is shared by the device cache. It should be noted that in a computer device with multiple processor cores, a processor core cannot know whether the data it accesses exists in another processor core. Therefore, it is necessary to confirm whether the data to be accessed exists in the host cache and whether the data to be accessed is shared by the device cache based on the records in the host cache record table.

[0154] It can be understood that step S310 is a specific implementation of step S110, and detailed description can refer to the introduction of step S110.

[0155] Step S320: the listening filter processes the data to be accessed based on the authority required for the access request and the information in the host cache record table;

[0156] In the embodiment of the present invention, the access request is for processor core 0 to request exclusive permission for the data to be accessed. It is understandable that when the cache status of the data to be accessed exists in the host cache record table and the data to be accessed is shared by the device cache, the processing of the data to be accessed may specifically include:

[0157] Step S321: The listening filter sends a data processing request to the processor core 1 that caches the data to be accessed, and sends a data clearing request to the peripheral device. The data processing request is used to obtain the data to be accessed and clear the cached data of the corresponding cache. The data clearing request is used to clear the cached data of the corresponding cache.

[0158] It can be understood that the presence of a cache status of the data to be accessed in the host cache record table indicates that the host cache has the data to be accessed, and at the same time, the data to be accessed is shared by the device cache, indicating that the peripheral device cache has the data to be accessed. Accordingly, in order to satisfy the exclusive permission requested by the access request, the processor core 1 that caches the data to be accessed can be determined based on the host cache record table, and a data processing request can be sent to the processor core 1 that caches the data to be accessed and the peripheral device to obtain the data to be accessed, and the cache data corresponding to the processor core 1 and the peripheral device can be cleared.

[0159] Step S322: Processor core 1 responds to the data processing request, sends the data to be accessed to the listening filter, and clears cache data corresponding to the data to be accessed.

[0160] It is understandable that, compared with data transmission between peripheral devices and the processor core, data transmission within the processor core obviously has a smaller delay and a correspondingly higher transmission efficiency. Therefore, the processor core can send the data to be accessed to the listening filter.

[0161] The data to be accessed may be sent to the listening filter as a response message, and the response message is also used to notify the listening filter that the corresponding cached data has been cleared.

[0162] Step S323: the peripheral device responds to the data clearing request, clears the cache data corresponding to the data to be accessed, and sends a response message to the listening filter.

[0163] After the processor core sends the data to be accessed to the listening filter, the peripheral device may no longer send the data to be accessed, and only needs to execute the corresponding data clearing process.

[0164] The response message is used to notify the listening filter that the corresponding cache data has been cleared.

[0165] Step S324: the monitoring filter obtains the to-be-accessed data sent by the processor core.

[0166] It can be understood that after the processor core sends the data to be accessed, the intercept filter can obtain the corresponding data to be accessed.

[0167] It should be noted that when the peripheral device sends a corresponding response message, the listening filter can receive the response message.

[0168] Step S325: The intercept filter sends the data to be accessed to the processor core that initiates the access request.

[0169] After acquiring the data to be accessed, the intercept filter may send the data to be accessed to the processor core, so that the processor core acquires the data to be accessed.

[0170] It should be noted that, after obtaining the data to be accessed, the interception filter should still confirm that it sends out the data to be accessed after receiving a response message from the peripheral device.

[0171] It can be understood that the above data access process is used to make the processor core exclusively occupy the cache data shared by the host cache and the device cache. Accordingly, after executing step S325, the update process of the host cache record table can also be executed to record the exclusive status of the data to be accessed in the host cache record table, and make the peripheral sharing identifier corresponding to the data to be accessed indicate that the corresponding cache data is not shared by the peripheral device. Specifically, step S140 is executed to update the peripheral sharing identifier of the cache data corresponding to the data to be accessed in the host cache record table, so that the peripheral sharing identifier indicates that the corresponding cache data is not shared by the peripheral device. In step S140, the state of the cache data in the host cache can be further updated in the host cache record table, so that the state of the cache data in the host cache record table indicates that the cache data is exclusively occupied by the processor core.

[0172] In a further example, when the host cache record table does not contain the cache status of the data to be accessed, it is necessary to determine whether there is a cache of other states of the data to be accessed by the peripheral device, and further perform corresponding processing. Figure 8 Another optional flow chart of data processing is shown, and the processing of the data to be accessed may specifically include:

[0173] Step S326: the snoop filter sends a data read request to the memory controller, where the data read request is used to read the data to be accessed and the device cache information corresponding to the data to be accessed.

[0174] In an optional example, the device cache information is stored in a redundant space of a memory page where the memory data is located, and the data read request can read the corresponding device cache information while reading the data to be accessed.

[0175] Step S327: the memory controller responds to the data read request and sends the to-be-accessed data and the device cache information corresponding to the to-be-accessed data to the snoop filter.

[0176] Based on the data read request, the memory controller may execute a corresponding memory data read process.

[0177] Step S328: The listening filter queries the device cache information.

[0178] After receiving the device cache information, the listening filter may first query the device cache information to determine whether there is another state in which the peripheral device caches the data to be accessed, and if so, execute step S329; otherwise, execute step S331.

[0179] Step S329: the monitoring filter sends a data clearing request, wherein the data clearing request is used to request the peripheral device to clear the cache data corresponding to the data to be accessed.

[0180] Step S330: the peripheral device responds to the data processing request, clears the cache data corresponding to the data to be accessed, and sends a response message to the listening filter.

[0181] The response message is used to notify the listening filter that the corresponding cache data has been cleared.

[0182] Step S331: the intercept filter sends the to-be-accessed data to the processor core.

[0183] After acquiring the data to be accessed and the response message sent by the peripheral device, the interception filter may send the data to be accessed to the processor core, so that the processor core acquires the data to be accessed.

[0184] It can be understood that the above data access process is used to make the processor core exclusively occupy the corresponding cache data. Accordingly, after executing step S331, the update process of the host cache record table can be further executed to record the exclusive status of the data to be accessed in the host cache record table, and make the peripheral sharing identifier corresponding to the data to be accessed indicate that the corresponding cache data is not shared by the peripheral device. Specifically, step S332 is executed: update the state of the cache data in the host cache in the host cache in the host cache record table, so that the state of the cache data in the host cache record table indicates that the cache data is exclusively occupied by the processor core. It can be understood that the state of the cache data in the host cache record table indicates that the cache data is exclusively occupied by the processor core, and the peripheral sharing identifier of the corresponding data to be accessed is set to indicate that the corresponding cache data is not shared by the peripheral device.

[0185] It can be understood that the above data access process is used to make the processor core exclusively occupy the cache data of the host cache. Accordingly, if there are other states of the data to be accessed in the device cache information, the device cache information update process should be executed after executing step S332, so that the device cache information indicates that the corresponding memory data is cached by the peripheral device as invalid. Specifically, step S150 can be executed to send a device cache information update request to the memory controller to update the device cache information in the memory, so that the device cache information indicates that the corresponding memory data is cached by the peripheral device as invalid. Correspondingly, in step S160, the memory controller updates the device cache information corresponding to the data to be accessed in the memory to an invalid state based on the device cache information update request.

[0186] In a further example, taking the request of a peripheral device to obtain exclusive permission for accessed data as an example, refer to Fig. 9 Another optional flow chart of data processing is shown, wherein the data access method and cache data recording method may include:

[0187] Step S400: the listening filter obtains the access request of the peripheral device;

[0188] Among them, in the permission information of the access request, the access request may request to obtain exclusive permission for the data to be accessed.

[0189] It can be understood that step S400 is a specific implementation of step S100, and detailed description can refer to the introduction of step S100.

[0190] Step S410: the listening filter queries the host cache record table to see whether there is a cache status of the data to be accessed;

[0191] Based on the access request of the peripheral device, it can be queried whether the data to be accessed exists in the host cache.

[0192] It can be understood that step S410 is a specific implementation of step S110, and detailed description can refer to the introduction of step S110.

[0193] Step S420: the listening filter performs processing on the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table;

[0194] In the embodiment of the present invention, the access request is a request by the peripheral device to obtain exclusive permission for the data to be accessed. It is understandable that when the cache status of the data to be accessed exists in the host cache record table, the processing of the data to be accessed may specifically include:

[0195] Step S421: the listening filter sends a data processing request to the processor core that caches the data to be accessed, wherein the data processing request is used to obtain the data to be accessed and clear the cache data corresponding to the processor core.

[0196] It can be understood that the presence of a cache status of the data to be accessed in the host cache record table indicates that the host cache has the data to be accessed. Accordingly, in order to satisfy the exclusive permission requested by the access request, the processor core that caches the data to be accessed can be determined based on the host cache record table, and a data processing request can be sent to the processor core that caches the data to be accessed (in the figure, processor core 1 that caches the data to be accessed is taken as an example) to obtain the data to be accessed, and clear the cache data corresponding to the processor core.

[0197] Step S422: Processor core 1 responds to the data processing request, sends the data to be accessed to the listening filter, and clears cache data corresponding to the data to be accessed.

[0198] The data to be accessed may be sent to the listening filter as a response message, and the response message is also used to notify the listening filter that the corresponding cached data has been cleared.

[0199] Step S423: the monitoring filter obtains the to-be-accessed data sent by the processor core.

[0200] It can be understood that after the processor core sends the data to be accessed, the intercept filter can obtain the corresponding data to be accessed.

[0201] Step S424: the monitoring filter sends the data to be accessed to the peripheral device.

[0202] After acquiring the data to be accessed, the interception filter may send the data to be accessed to the peripheral device, so that the peripheral device acquires the data to be accessed.

[0203] It can be understood that the above data access process is used to make the peripheral device exclusively occupy the cache data of the host cache. Accordingly, after executing step S424, the device cache information update process is executed to make the memory data corresponding to the device cache information indication be exclusively occupied by the peripheral device cache. Specifically, step S150 is executed to send a device cache information update request to the memory controller to update the device cache information in the memory so that the device cache information indicates that the corresponding memory data is exclusively cached by the peripheral device. Correspondingly, in step S160, the memory controller updates the device cache information corresponding to the data to be accessed in the memory to an exclusive state based on the device cache information update request.

[0204] It should be noted that after step S150, step S425 can be further executed to update the status entry corresponding to the cache data in the host cache in the host cache, that is, to delete the status entry corresponding to the cache data in the host cache record table, so that the host cache record indicates that the host cache does not cache the corresponding data to be accessed.

[0205] It can be seen that the data access method provided by the embodiment of the present invention can implement corresponding access based on the information recorded in the host cache record table.

[0206] The cache status recording device and data access device provided in the embodiment of the present invention are introduced below. The cache status recording device and data access device described below can be considered as the functional modules required for the listening filter to implement the cache status recording method and data access method provided in the embodiment of the present invention. The contents of the cache status recording device and data access device described below can be referenced to each other with the contents of the method described above.

[0207] In an optional implementation, Fig.10 FIG. 4 shows an optional block diagram of a cache status recording device provided by an embodiment of the present invention. The cache status recording device can be applied to a listening filter, such as Fig.10 As shown, the cache status recording device may include:

[0208] The identification update module 100 is used to update the peripheral sharing identification when the peripheral device shares the cache data in the host cache, so that the peripheral sharing identification indicates that the corresponding cache data is shared by the peripheral device; when the processor core exclusively occupies the cache data, update the peripheral sharing identification so that the peripheral sharing identification indicates that the corresponding cache data is not shared by the peripheral device.

[0209] Optionally, the cache status recording device may also include: an update request sending module 110, which is used to send a device cache information update request when the peripheral device exclusively caches the data, so as to update the device cache information in the memory, so that the device cache information indicates that the corresponding memory data is exclusively cached by the peripheral device.

[0210] Optionally, the identification updating module 100 is further used to delete the status entry corresponding to the cache data in the host cache record table when the peripheral device exclusively caches the data.

[0211] Optionally, the identification update module 100 is also used to update the host cache record table corresponding to the status of the cache data in the host cache when the processor core exclusively occupies the cache data, so that the status of the cache data in the host cache record table indicates that the cache data is exclusively occupied by the processor core.

[0212] Optionally, the update request sending module 110 is further configured to, when the processor core exclusively caches the data and the host cache record table does not contain the cache status of the data to be accessed, further include:

[0213] A device cache information update request is sent to the memory controller to update the device cache information in the memory, so that the device cache information indicates that the corresponding memory data is cached by the peripheral device as invalid.

[0214] In an optional implementation, Fig.111 shows an optional block diagram of a data access device provided by an embodiment of the present invention, which can be applied to a listening filter, such as Fig.11 As shown, the data access device may include:

[0215] A request acquisition module 200 is used to acquire an access request, wherein the access request is used to enable a request initiator to access the data to be accessed, and the access request includes permission information that the request initiator needs to obtain;

[0216] A status query module 210 is used to query whether there is a cache status of the to-be-accessed data in the host cache record table, the host cache record table is used to record the status of the host's cache data in the host cache, and a peripheral device sharing identifier corresponding to the cache data, the peripheral device sharing identifier is used to indicate whether the cache data is shared by the device cache;

[0217] The access processing module 220 is used to process the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table.

[0218] Optionally, in the access request, the request initiator is a peripheral device, and the device cache of the peripheral device requests to obtain sharing authority for the data to be accessed;

[0219] When the cache status of the data to be accessed exists in the host cache record table, the access processing module 220 is used to perform processing on the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table, including:

[0220] Sending a data acquisition request to a processor core that caches the data to be accessed, wherein the data acquisition request is used to acquire the data to be accessed cached by the processor core;

[0221] After the processor core sends the data to be accessed, acquiring the data to be accessed sent by the processor core;

[0222] Sending the data to be accessed to the peripheral device;

[0223] The updating process of the host cache record table is executed, so that the peripheral device sharing identifier corresponding to the to-be-accessed data in the host cache record table indicates that the corresponding cache data is shared by the peripheral device.

[0224] Optionally, in the access request, the request initiator is a processor core among multiple processor cores, and the processor core requests to obtain exclusive authority for the data to be accessed;

[0225] When the cache status of the data to be accessed exists in the host cache record table and the data to be accessed is shared by the device cache, the access processing module 220 is used to perform processing on the data to be accessed based on the authority required for the access request and the information in the host cache record table, including:

[0226] Sending a data processing request to a processor core that caches the data to be accessed, and sending a data clearing request to a peripheral device, wherein the data processing request is used to obtain the data to be accessed and clear cached data of the corresponding cache, and the data clearing request is used to clear cached data of the corresponding cache;

[0227] After the processor core that caches the data to be accessed responds to the data processing request, sends the data to be accessed to the listening filter, and clears the cached data corresponding to the data to be accessed, the data to be accessed is acquired;

[0228] After the peripheral device responds to the data clearing request, clears the cache data corresponding to the data to be accessed, and sends a response message to the listening filter, the data to be accessed is sent to the processor core that initiates the access request;

[0229] The updating process of the host cache record table is executed, so that the host cache record table records the exclusive state corresponding to the data to be accessed, and the peripheral sharing mark corresponding to the data to be accessed indicates that the corresponding cache data is not shared by the peripheral device.

[0230] Optionally, when the cache status of the data to be accessed does not exist in the host cache record table, the access processing module 220 is used to perform processing on the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table, including:

[0231] Sending a data read request to a memory controller, wherein the data read request is used to read the data to be accessed and device cache information corresponding to the data to be accessed;

[0232] After the memory controller responds to the data read request and sends the to-be-accessed data and the device cache information corresponding to the to-be-accessed data to the listening filter, the to-be-accessed data is acquired;

[0233] Query the device cache information to determine whether there is another state in which the peripheral device caches the data to be accessed;

[0234] If yes, send a data clearing request, the data clearing request is used to request the peripheral device to clear the cache data corresponding to the data to be accessed; after the peripheral device responds to the data processing request, clears the cache data corresponding to the data to be accessed, and sends a response message to the listening filter, the data to be accessed is sent to the processor core;

[0235] And, executing the updating process of the host cache record table, so that the exclusive state corresponding to the to-be-accessed data is recorded in the host cache record table, and the peripheral sharing identifier corresponding to the to-be-accessed data indicates that the corresponding cache data is not shared by the peripheral device; and executing the device cache information updating process, so that the device cache information indicates that the corresponding memory data is cached by the peripheral device as invalid;

[0236] If not, sending the data to be accessed to the processor core that initiated the access request;

[0237] And, executing the updating process of the host cache record table, so that the host cache record table records the exclusive status corresponding to the to-be-accessed data, and the peripheral sharing identifier corresponding to the to-be-accessed data indicates that the corresponding cache data is not shared by the peripheral device.

[0238] Optionally, in the access request, the request initiator is a peripheral device, and the peripheral device requests exclusive permission for the data to be accessed;

[0239] When the cache status of the data to be accessed exists in the host cache record table, the access processing module 220 is used to perform processing on the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table, including:

[0240] Sending a data processing request to a processor core that caches the data to be accessed, wherein the data processing request is used to obtain the data to be accessed and clear cache data corresponding to the processor core;

[0241] After the processor core responds to the data processing request, sends the data to be accessed to the listening filter, and clears the cache data corresponding to the data to be accessed, the data to be accessed is acquired;

[0242] Sending the data to be accessed to the peripheral device;

[0243] A device cache information update process is executed so that the device cache information indicates that the corresponding memory data is exclusively occupied by the peripheral device cache.

[0244] An embodiment of the present invention further provides a storage medium, which stores one or more executable instructions, and the one or more executable instructions are used to execute the cache status recording method provided by the embodiment of the present invention, or execute the data access method provided by the embodiment of the present invention.

[0245] It can be seen that the cache status recording scheme and data access scheme provided by the embodiments of the present invention can record the peripheral sharing identifier based on the host cache record table, determine the main status affecting the data processing flow, and thus realize the recording of the cache data status in the peripheral device, and then execute the corresponding access process based on the information in the host cache record table.

[0246] Although the embodiments of the present invention are disclosed above, the present invention is not limited thereto. Any person skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the scope defined by the claims.

Claims

1. A cache status recording method, characterized in that: Applied to a listening filter, the listening filter is configured with a host cache record table, the host cache record table is used to record the state of the host's cache data in the host cache, and a peripheral device sharing identifier corresponding to the cache data, the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device, the method comprising: When the peripheral device shares the cache data in the host cache, updating the peripheral device sharing identifier so that the peripheral device sharing identifier indicates that the corresponding cache data is shared by the peripheral device; When the processor core exclusively occupies the cache data, the peripheral sharing flag is updated so that the peripheral sharing flag indicates that the corresponding cache data is not shared by the peripheral device.

2. The method according to claim 1, characterized in that When the peripheral device exclusively caches data, it also includes: A device cache information update request is sent to update the device cache information in the memory, so that the device cache information indicates a state in which corresponding memory data is exclusively occupied by the peripheral device cache.

3. The method according to claim 2, characterized in that When the peripheral device exclusively caches data, it also includes: Delete the status entry corresponding to the cache data in the host cache record table.

4. The method according to claim 1, characterized in that: When the processor core exclusively caches data, it also includes: The host cache record table is updated to correspond to the state of the cache data in the host cache, so that the state of the cache data in the host cache record table indicates that the cache data is exclusively occupied by the processor core.

5. The method according to claim 1, characterized in that When the processor core exclusively caches the data and the host cache record table does not contain the cache status of the data to be accessed, the method further includes: A device cache information update request is sent to the memory controller to update the device cache information in the memory, so that the device cache information indicates that the corresponding memory data is cached by the peripheral device as invalid.

6. A data access method, characterized in that: Applies to listen filters, including: Obtaining an access request, wherein the access request is used to enable the request initiator to access the data to be accessed, and the access request includes permission information that the request initiator needs to obtain; Querying whether there is a cache status of the to-be-accessed data in a host cache record table, wherein the host cache record table is used to record the status of the cache data of the host in the host cache, and a peripheral device sharing identifier corresponding to the cache data, wherein the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device; Based on the authority required to obtain the access request and the information in the host cache record table, processing is performed on the data to be accessed.

7. The method according to claim 6, characterized in that In the access request, the request initiator is a peripheral device, and the device cache of the peripheral device requests to obtain sharing authority for the data to be accessed; When the cache status of the data to be accessed exists in the host cache record table, the processing of the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table includes: Sending a data acquisition request to a processor core that caches the data to be accessed, wherein the data acquisition request is used to acquire the data to be accessed cached by the processor core; After the processor core sends the data to be accessed, acquiring the data to be accessed sent by the processor core; Sending the data to be accessed to the peripheral device; An update process of the host cache record table is executed, so that the peripheral device sharing identifier corresponding to the to-be-accessed data in the host cache record table indicates that the corresponding cache data is shared by the peripheral device.

8. The method according to claim 6, characterized in that In the access request, the request initiator is a processor core among multiple processor cores, and the processor core requests to obtain exclusive authority for the data to be accessed; When the cache status of the data to be accessed exists in the host cache record table and the data to be accessed is shared by the device cache, the processing of the data to be accessed based on the permission required for the access request and the information in the host cache record table includes: Sending a data processing request to a processor core that caches the data to be accessed, and sending a data clearing request to a peripheral device, wherein the data processing request is used to obtain the data to be accessed and clear cached data of the corresponding cache, and the data clearing request is used to clear cached data of the corresponding cache; After the processor core that caches the data to be accessed responds to the data processing request, sends the data to be accessed to the listening filter, and clears the cached data corresponding to the data to be accessed, the data to be accessed is acquired; After the peripheral device responds to the data clearing request, clears the cache data corresponding to the data to be accessed, and sends a response message to the listening filter, the data to be accessed is sent to the processor core that initiates the access request; The updating process of the host cache record table is executed, so that the host cache record table records the exclusive state corresponding to the data to be accessed, and the peripheral sharing mark corresponding to the data to be accessed indicates that the corresponding cache data is not shared by the peripheral device.

9. The method according to claim 8, characterized in that When the cache status of the data to be accessed does not exist in the host cache record table, the processing of the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table includes: Sending a data read request to a memory controller, wherein the data read request is used to read the data to be accessed and device cache information corresponding to the data to be accessed; After the memory controller responds to the data read request and sends the to-be-accessed data and the device cache information corresponding to the to-be-accessed data to the listening filter, the to-be-accessed data is acquired; Query the device cache information to determine whether there is another state in which the peripheral device caches the data to be accessed; If yes, send a data clearing request, the data clearing request is used to request the peripheral device to clear the cache data corresponding to the data to be accessed; after the peripheral device responds to the data processing request, clears the cache data corresponding to the data to be accessed, and sends a response message to the listening filter, the data to be accessed is sent to the processor core; And, executing the updating process of the host cache record table, so that the exclusive state corresponding to the to-be-accessed data is recorded in the host cache record table, and the peripheral sharing identifier corresponding to the to-be-accessed data indicates that the corresponding cache data is not shared by the peripheral device; and executing the device cache information updating process, so that the device cache information indicates that the corresponding memory data is cached by the peripheral device as invalid; If not, sending the data to be accessed to the processor core that initiated the access request; And, executing the updating process of the host cache record table, so that the host cache record table records the exclusive status corresponding to the to-be-accessed data, and the peripheral sharing identifier corresponding to the to-be-accessed data indicates that the corresponding cache data is not shared by the peripheral device.

10. The method according to claim 6, characterized in that In the access request, the request initiator is a peripheral device, and the peripheral device requests to obtain exclusive authority for the data to be accessed; When the cache status of the data to be accessed exists in the host cache record table, the processing of the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table includes: Sending a data processing request to a processor core that caches the data to be accessed, wherein the data processing request is used to obtain the data to be accessed and clear cache data corresponding to the processor core; After the processor core responds to the data processing request, sends the data to be accessed to the listening filter, and clears the cache data corresponding to the data to be accessed, the data to be accessed is acquired; Sending the data to be accessed to the peripheral device; A device cache information update process is executed so that the device cache information indicates that the corresponding memory data is exclusively occupied by the peripheral device cache.

11. A computer device, characterized in that: It includes a host and peripheral devices; the host includes multiple processor cores and listening filters, and each processor core is configured with a corresponding host cache; Among them, the listening filter is configured with a host cache record table, the host cache record table is used to record the status of the host's cache data in the host cache, and a peripheral sharing identifier corresponding to the cache data, the peripheral sharing identifier is used to indicate whether the cache data is shared by a peripheral device.

12. The computer device according to claim 11, characterized in that The host cache record table includes status entries corresponding to cache data in the host one by one, and the status entries include address tags, cache status, data owners, data distribution, and the peripheral sharing identifier; The peripheral device sharing identifier is configured in a redundant bit of the status entry; or the peripheral device sharing identifier is configured in an independent storage bit of the status entry.

13. The computer device according to claim 12, characterized in that The peripheral device sharing identifier occupies 1 bit of storage space of the status entry.

14. The computer device according to claim 11, characterized in that The host further includes a memory, in which device cache information of the cache data of the peripheral device is stored, and the device cache information is used to record status information of the cache data of the peripheral device.

15. The computer device according to claim 14, characterized in that The device cache information is stored in a redundant space of a memory page where memory data corresponding to the cache data is located.

16. The computer device according to claim 14, characterized in that The device cache information includes a peripheral sharing identifier, a device cache status and a device cache data owner, wherein the peripheral sharing identifier is used to mark whether the corresponding memory data is cached in the peripheral device, the device cache status is used to mark the status of the corresponding memory data in the device cache, and the device cache data owner is used to record the device identifier of the peripheral device that caches the memory data.

17. The computer device according to claim 15, characterized in that The memory also includes an error checking and correction verification code, which is calculated based on the device cache information and the corresponding memory data.

18. A cache status recording device, characterized in that: Applied to a listening filter, the listening filter is configured with a host cache record table, the host cache record table is used to record the state of the host's cache data in the host cache, and a peripheral device sharing identifier corresponding to the cache data, the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device, including: An identification updating module is used to update the peripheral sharing identification when the peripheral device shares the cache data in the host cache, so that the peripheral sharing identification indicates that the corresponding cache data is shared by the peripheral device; when the processor core exclusively owns the cache data, update the peripheral sharing identification so that the peripheral sharing identification indicates that the corresponding cache data is not shared by the peripheral device.

19. A data access device, characterized in that: include: A request acquisition module, used to acquire an access request, wherein the access request is used to enable the request initiator to access the data to be accessed, and the access request includes permission information that the request initiator needs to obtain; a status query module, used to query whether there is a cache status of the to-be-accessed data in the host cache record table, the host cache record table is used to record the status of the host's cache data in the host cache, and a peripheral device sharing identifier corresponding to the cache data, the peripheral device sharing identifier is used to indicate whether the cache data is shared by a peripheral device; The access processing module is used to process the data to be accessed based on the authority required to obtain the access request and the information in the host cache record table.

20. A storage medium, characterized in that: The storage medium stores one or more executable instructions, and the one or more executable instructions are used to execute the cache status recording method as described in any one of claims 1-5, or to execute the data access method as described in any one of claims 6-10.

Citation Information

Cited By

  • Cache state recording method and apparatus, data access method and apparatus, and device

    WO2024124977A1