Method and device for maintaining cache consistency, filter, electronic equipment and medium
By querying the consistency information directory according to access requests in a multi-core processor system and updating the storage format of cached data, the cache consistency maintenance problem is solved, the area and cost of listening filters are reduced, and the system efficiency is improved.
Patent Information
- Application Number
- CN202411052940.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-15
AI Technical Summary
In multi-core processor systems, cache consistency maintenance is difficult to achieve, resulting in data inconsistency. Previous technologies such as bus sniffing strategies consume a lot of bus traffic, and the increase in listening filter capacity leads to increased chip area and cost increase.
By obtaining access requests, querying the consistency information directory, determining that the target storage format of the cached data is coarse-grained or fine-grained format, and updating the consistency information directory according to this format, reducing the storage capacity and design complexity of the listening filter.
Effectively maintain cache consistency, reduce the area of listening filters, reduce costs and design difficulties, and improve system efficiency.
Smart Images

Figure CN118964231A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present disclosure relate to a method and device for maintaining cache consistency, a filter, an electronic device, and a medium. Background Art
[0002] In a multi-core processor (such as a multi-core CPU), each processor core has its own set of caches. The processor core can read data from the main memory (such as Double Data Rate, DDR) and store it in the local cache for calculation. After the processor core performs the calculation operation, it can update the data in the cache and write the updated data to the main memory. If multiple processor cores use a piece of data at the same time, then the data will have multiple copies, which are stored in multiple sets of caches. Since multiple processor cores are parallel, the data in one set of caches may not be notified to other caches in time after being modified. Therefore, the data in multiple sets of caches may be inconsistent, resulting in errors. Therefore, it is necessary to maintain the cache consistency of multiple cores. Summary of the invention
[0003] At least one embodiment of the present disclosure provides a method for maintaining cache consistency, comprising: obtaining an access request; querying a consistency information directory for maintaining cache consistency according to the access request to obtain a query result; responding to the access request according to the query result; and updating the consistency information directory, wherein updating the consistency information directory comprises: determining a target storage format for directory information after cache consistency maintenance is performed on the cache data, the target storage format comprising a first storage format and a second storage format, the storage granularity of the first storage format being greater than the storage granularity of the second storage format; and storing the directory information after cache consistency maintenance is performed on the cache data in the consistency information directory according to the target storage format.
[0004] For example, in the method for maintaining cache consistency provided by some embodiments of the present disclosure, the consistency information directory used to maintain cache consistency is queried according to the access request, including: querying a directory temporary storage unit according to the access request; and in response to the access request missing the directory temporary storage unit, querying a first storage unit and a second storage unit, the first storage unit storing the first part of the consistency information directory according to the first storage format, and the second storage unit storing the second part of the consistency information directory according to the second storage format.
[0005] For example, in the method for maintaining cache consistency provided in some embodiments of the present disclosure, determining the target storage format of the directory information of the cache data after cache consistency maintenance includes: in response to the access request missing the first storage unit and the second storage unit, determining that the target storage format of the directory information of the cache data after cache consistency maintenance is the first storage format.
[0006] For example, in the method for maintaining cache consistency provided by some embodiments of the present disclosure, determining the target storage format of the directory information of the cache data after cache consistency maintenance includes: in response to the access request hitting the first storage unit or the second storage unit, and the state information of the cache data after the cache consistency maintenance is a private state, determining that the target storage format of the directory information of the cache data after cache consistency maintenance is the first storage format, wherein the private state is that the cache data is cached by only one processor cluster.
[0007] For example, in the method for maintaining cache consistency provided in some embodiments of the present disclosure, the directory information of the cache data after cache consistency maintenance is stored in the consistency information directory according to the target storage format, including: in the case where the access request hits the first storage unit, the directory information of the cache data after cache consistency maintenance is updated to the first storage unit; or in the case where the access request hits the second storage unit, the directory information of the cache data after cache consistency maintenance is transferred to the first storage unit.
[0008] For example, in the method for maintaining cache consistency provided by some embodiments of the present disclosure, determining the target storage format of the directory information of the cache data after cache consistency maintenance includes: in response to the access request hitting the first storage unit or the second storage unit, and the state of the cache data after the cache consistency maintenance is a shared state, determining that the target storage format of the directory information of the cache data after cache consistency maintenance is the second storage format, wherein the shared state is that the cache data is cached by multiple processor clusters.
[0009] For example, in the method for maintaining cache consistency provided in some embodiments of the present disclosure, the directory information of the cache data after cache consistency maintenance is stored in the consistency information directory according to the target storage format, including: in the case where the access request hits the first storage unit, the directory information of the cache data after cache consistency maintenance is transferred to the second part; or in the case where the access request hits the second storage unit, the directory information of the cache data after cache consistency maintenance is updated to the second part.
[0010] For example, in the method for maintaining cache consistency provided in some embodiments of the present disclosure, it also includes: in response to the access request missing the directory temporary storage unit, and the access request hitting the first storage unit or the second storage unit, obtaining the directory information from the first storage unit or the second storage unit; and storing the directory information in the directory temporary storage unit.
[0011] For example, in the method for maintaining cache consistency provided in some embodiments of the present disclosure, responding to the access request according to the query result includes: in response to the access request hitting the directory temporary storage unit, obtaining the directory information from the directory temporary storage unit, and performing cache consistency maintenance on the cache data.
[0012] For example, in the method for maintaining cache consistency provided by some embodiments of the present disclosure, the instruction sharing unit is configured to: in response to the instruction fetch request, query the instruction fetch information table to determine whether the multiple thread warps include current instruction data matching the instruction fetch information.
[0013] For example, in the method for maintaining cache consistency provided by some embodiments of the present disclosure, the consistency information directory used to maintain cache consistency is queried according to the access request, including: according to the access request, querying a first storage unit and a second storage unit, wherein the first storage unit stores the first part of the consistency information directory according to the first storage format, and the second storage unit stores the second part of the consistency information directory according to the second storage format.
[0014] For example, in the method for maintaining cache consistency provided in some embodiments of the present disclosure, the granularity of the first storage format is a plurality of consecutive cache lines, and the granularity of the second storage format is one cache line.
[0015] For example, in the method for maintaining cache consistency provided by some embodiments of the present disclosure, the first storage format includes a status item and a cache line valid item, the status item is used to indicate status information of at least part of the cache data in the multiple cache lines, the status information of at least part of the cache data is the same, and the cache line valid item is used to indicate the cache lines to which the at least part of the cache data respectively belongs.
[0016] At least some embodiments of the present disclosure also provide a device for maintaining cache consistency, including: an acquisition unit, configured to acquire an access request; a query unit, configured to query a consistency information directory used to maintain cache consistency according to the access request to obtain a query result; a response unit, configured to respond to the access request according to the query result; an update unit, configured to update the consistency information directory, wherein the update unit configuration includes: a format determination subunit, configured to determine a target storage format of directory information after cache consistency maintenance for the cache data, wherein the target storage format includes a first storage format and a second storage format, wherein the storage granularity of the first storage format is greater than the storage granularity of the second storage format; and a storage unit, configured to store the directory information after cache consistency maintenance for the cache data in the consistency information directory according to the target storage format.
[0017] At least some embodiments of the present disclosure also provide a snooping filter, including: a control unit, a first storage unit, and a second storage unit, wherein the control unit is configured to: obtain an access request; query a consistency information directory used to maintain cache consistency according to the access request to obtain a query result; and provide the query result to a consistency master node, so that the consistency master node performs cache consistency maintenance on cache data according to the query result; after the cache consistency maintenance is completed, determine a target storage format of directory information of the cache data after cache consistency maintenance, wherein the target storage format includes a first storage format and a second storage format, wherein the storage granularity of the first storage format is greater than the storage granularity of the second storage format; and provide the directory information of the cache data after cache consistency maintenance to the first storage unit or the second storage unit to update the consistency information directory, wherein the first storage unit is configured to store the directory information of the cache data after cache consistency maintenance to the cache consistency information directory according to the first storage format; and the second storage unit is configured to store the directory information of the cache data after cache consistency maintenance to the cache consistency information directory according to the second storage format.
[0018] At least one embodiment of the present disclosure further provides an electronic device, comprising: a processor; a memory, comprising one or more computer program instructions; the one or more computer program instructions, when executed by the processor, execute the cache consistency maintenance method provided by any embodiment of the present disclosure.
[0019] At least one embodiment of the present disclosure further provides a computer-readable storage medium that non-temporarily stores computer-readable instructions, wherein when the computer-readable instructions are executed by a processor, the method for maintaining cache consistency provided by any embodiment of the present disclosure is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings of the embodiments will be briefly introduced below. Obviously, the drawings in the following description only relate to some embodiments of the present disclosure, but are not intended to limit the present disclosure.
[0021] Figure 1 A schematic diagram of an electronic device is shown;
[0022] Figure 2A A flow chart of a method for maintaining cache consistency provided by at least one embodiment of the present disclosure is shown;
[0023] Figure 2B At least one embodiment of the present disclosure provides a Figure 2A The method flow chart of step S40 in FIG.
[0024] Figure 3 A schematic diagram of a listening filter provided by at least one embodiment of the present disclosure is shown;
[0025] Figure 4 A schematic diagram showing a storage format of a coarse-grained directory storage unit provided by at least one embodiment of the present disclosure is shown;
[0026] Figure 5 A flow chart of a method for maintaining cache consistency provided by at least one embodiment of the present disclosure is shown;
[0027] Fig. 6A A schematic diagram of a device for maintaining cache consistency provided by at least one embodiment of the present disclosure is shown;
[0028] Figure 6B A schematic diagram of a listening filter provided by at least one embodiment of the present disclosure is shown;
[0029] Figure 7 A schematic block diagram of an electronic device provided by an embodiment of the present disclosure;
[0030] Figure 8 A schematic block diagram of another electronic device provided by an embodiment of the present disclosure; and
[0031] Fig. 9 A schematic diagram of a non-transitory storage medium provided by an embodiment of the present disclosure. DETAILED DESCRIPTION
[0032] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution of the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings of the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the described embodiments of the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0033] Unless otherwise defined, the technical terms or scientific terms used in the present disclosure should be understood by people with ordinary skills in the field to which the present disclosure belongs. The "first", "second" and similar words used in the present disclosure do not indicate any order, quantity or importance, but are only used to distinguish different components. Similarly, similar words such as "one", "one" or "the" do not indicate quantity restrictions, but indicate that there is at least one. Similar words such as "include" or "comprise" mean that the elements or objects appearing before the word cover the elements or objects listed after the word and their equivalents, without excluding other elements or objects. Similar words such as "connect" or "connected" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0034] There are two main strategies for multi-core CPU cache consistency: bus monitoring-based consistency strategy and directory-based consistency strategy.
[0035] The consistency strategy based on bus monitoring is also called bus snooping. Its working principle is: when a CPU core modifies the value in the cache, this event can be broadcast to all other cores through the bus; and each CPU core can monitor the data broadcast in the bus and detect whether there is a copy of the same data in its own cache; if there is a copy, the corresponding operation is performed to ensure the cache consistency of multiple cores.
[0036] The directory-based consistency strategy can maintain a data structure called a directory, which stores information such as which caches different data copies in the cache are written to and their corresponding status; when the CPU performs a write operation, it will no longer broadcast to the caches of all cores, but will use this directory to track the status of data copies in all caches and send it only to the specified data copy; this saves a lot of bus traffic compared to bus sniffing and is more scalable. For example, when multiple caches have the same data copies, if a processor core needs to modify a cache data, the copies of the cache data in other caches will be marked invalid to avoid consistency errors. In order to improve the efficiency of consistency maintenance in multi-core processor systems, technologies such as snooping filtering have been developed. Snooping filtering can help track the cache status in multiple caches, such as whether there is only a single copy in the cache, multiple copies, or the data only exists in the main memory.
[0037] In a computer system with multi-core processors and multiple caches, some existing directory snooping filters track the status of the cache and store the tracked status information in the snooping filter. When the consistency agent snoops the bus and finds a consistency transaction, it queries the tracked information in the snooping filter and sends a corresponding probe to complete the consistency maintenance.
[0038] Figure 1 A schematic diagram of an electronic device 100 is shown.
[0039] like Figure 1 As shown, the electronic device 100 may include multiple caches (hereinafter referred to as "cache"), such as cache H1, cache H2, ..., cache Hn. The electronic device 100 also includes multiple processor clusters, each of which may include at least two processor cores. For example, the electronic device 100 includes processor cluster C1, processor cluster C2, ..., processor cluster Cn. For example, Figure 1 Each processor cluster may include multiple processor cores. For example, multiple processor clusters correspond to multiple caches one by one, and the cache corresponding to the processor cluster is used by the processor cluster. The electronic device 100 also includes a consistent interconnect bus, a consistent master node A1, a snoop filter A2, a consistent master node B1, a snoop filter B2, a system memory D1, and a system memory D2.
[0040] It should be noted that, although two consistency master nodes and two snoop filters are shown in this example, the embodiments of the present disclosure are not limited to this, and the electronic device may include more or fewer consistency master nodes and snoop filters. Typically, multiple consistency master nodes and multiple snoop filters correspond one to one. System memory D1 and system memory D2 are, for example, main memories. For example, consistency master node A1 and consistency master node B1 are respectively responsible for consistency transactions of different caches in multiple caches.
[0041] For example, each cache in cache H1 to cache Hn is configured to be able to store at least one cache data. For example, consistency master node A1 and consistency master node B1 are used to track the status of cache data in cache H1 to cache Hn, and the cache data status includes, for example: there is only a single copy of the cache data in cache H1 to cache Hn, there are multiple copies of the cache data, or the data only exists in the main memory. Consistency master node A1 and consistency master node B1 will track the status of cache H1 to cache Hn, and store the tracked status information (or directory information) in listening filter A2 and listening filter B2. For example, when consistency master node A1 finds a consistency transaction in the process of listening to the consistency interconnect bus, it will query the status information tracked in listening filter A2 and issue a corresponding probe to complete consistency maintenance; when consistency master node B1 finds a consistency transaction in the process of listening to the consistency interconnect bus, it will query the status information tracked in listening filter B2 and issue a corresponding probe to complete consistency maintenance.
[0042] For example, Figure 1 As shown, the consistent interconnect bus (e.g., network on chip (NOC)) in the system is directly coupled to caches H1-Hn, and is also directly coupled to consistent master node A1 and consistent master node B1. The consistent interconnect bus is a public communication trunk for information transmission, for example, the consistent interconnect bus can be a transmission line bundle composed of electronic components such as wires.
[0043] For example, Figure 1 As shown, the consistency master node A1 and the consistency master node B1 are configured to connect the snoop filter A2 and the snoop filter B2 to the consistency interconnect bus respectively, and the consistency master node A1 and the consistency master node B1 are configured to connect the snoop filter A2 and the snoop filter B2 to the consistency interconnect bus respectively, so as to maintain the consistency of all data stored in the cache H1 to the cache Hn.
[0044] With the evolution of processors, the capacity of cache has also increased significantly, and snoop filters need to record relevant information of cache. A processor is usually a complete chip, which includes not only a processor core, but also some other devices such as storage devices. The processor core is the core part of the processor. Since snoop filters usually use the same storage format with cache blocks (also called "cache lines") as the granularity as CPU caches, the capacity of snoop filters must also grow linearly with the capacity of cache. The increased capacity of snoop filters will lead to difficulties in chip area, and increase costs and design difficulty.
[0045] The present invention proposes a method for maintaining cache consistency, the method comprising: obtaining an access request; querying a consistency information directory for maintaining cache consistency according to the access request to obtain a query result; performing cache consistency maintenance on cache data according to the query result; and updating the consistency information directory. Updating the consistency information directory comprises: determining a target storage format for directory information after cache consistency maintenance of cache data, the target storage format comprising a first storage format and a second storage format, the storage granularity of the first storage format being greater than the storage granularity of the second storage format; and storing the directory information after cache consistency maintenance of cache data in the consistency information directory according to the target storage format. The method can reduce the area of the snooping filter, reduce the cost and design difficulty.
[0046] The present disclosure is described below through several specific embodiments. In order to keep the following description of the embodiments of the present disclosure clear and concise, the present disclosure omits the detailed description of known functions and known components. When any component of the embodiments of the present disclosure appears in more than one figure, the component is represented by the same or similar reference numeral in each figure.
[0047] Figure 2A A flow chart of a method for maintaining cache consistency provided by at least one embodiment of the present disclosure is shown; Figure 2B At least one embodiment of the present disclosure provides a Figure 2A Flow chart of the method of step S40 in FIG.
[0048] like Figure 2A and 2B As shown, the method includes steps S10 to S40.
[0049] Step S10: Obtain an access request.
[0050] Step S20: According to the access request, query the consistency information directory used to maintain cache consistency to obtain the query result.
[0051] Step S30: respond to the access request according to the query result.
[0052] Step S40: Update the consistency information directory.
[0053] Step S40 includes step S41 and step S42.
[0054] Step S41: determining a target storage format of directory information after cache consistency maintenance of cache data, the target storage format comprising a first storage format and a second storage format, the storage granularity of the first storage format being greater than the storage granularity of the second storage format.
[0055] Step S42: storing the cache data in the target storage format and performing cache consistency maintenance on the directory information into the consistency information directory.
[0056] The method for maintaining cache consistency divides the storage format of cache data into storage formats of different storage granularities, and selects a coarse-grained storage format or a fine-grained storage format for storage according to the status information of the cache data, thereby reducing the capacity of the directory, reducing the area of the listening filter, and reducing the cost and design difficulty.
[0057] For step S10, for example, Figure 1 In the example of FIG. 1 , the consistency master node A1 obtains an access request to the cache H1 through the consistency interconnect bus. The access request may include, for example, a request to read cache data or a request to write cache data, etc. For example, the cache H1 requests to read cache data DA in another cache.
[0058] For step S20, after the consistency master node A1 intercepts the access request of the cache H1, it queries the listening filter A2 corresponding to the consistency master node A1 to obtain the query result, and the listening filter A2 includes a consistency information directory for maintaining cache consistency. For example, the query result may include a hit on the listening filter A2 and a miss on the listening filter A2. If the listening filter A2 is hit, the query result further includes which cache stores the cache data DA and the status information of the cache data DA in the cache, etc.
[0059] For example, the snoop filter A2 is queried according to the address of the cache data DA in the access request. If the address of the cache data DA hits the snoop filter A2, the query result of the cache data DA is obtained from the snoop filter A2. The query result of the cache data DA includes, for example, which cache stores the cache data DA and the status information of the cache data DA in the cache. If the address of the cache data DA does not hit the snoop filter A2, the snoop filter A2 sends a request to read the cache data DA to the system memory D1 to obtain the cache data DA from the system memory D1.
[0060] In some embodiments of the present disclosure, step S20 includes: querying a first storage unit and a second storage unit according to an access request, the first storage unit storing a first part in the consistency information directory according to a first storage format, and the second storage unit storing a second part in the consistency information directory according to a second storage format. The first part and the second part are different, that is, a part of the consistency information directory is stored in the first storage unit according to the first storage format, and the other part is stored in the second storage unit according to the second storage format.
[0061] For example, the first storage unit and the second storage unit are accessed respectively according to the address in the access request to obtain directory information of cache data corresponding to the address from the first storage unit or the second storage unit.
[0062] For step S30, responding to the access request includes, for example, returning a read result to the cache that initiated the access request, or writing cache data.
[0063] For example, processor cluster C1 sends a read request for the address of data DA to cache H1. The address of data DA does not hit in cache H1. Cache H1 sends an access to read data DA to consistency master node A1. Consistency master node A1 queries snoop filter A2 and obtains that data DA is cached by cache H2. Therefore, it sends a probe to cache H2 to maintain consistency. After the consistency maintenance is completed, consistency master node A1 returns the data to cache H1 and updates the consistency maintenance result to snoop filter A2.
[0064] For another example, if the address of cache data DA does not hit snoop filter A2, step S30 responding to the access request may include: snoop filter A2 sends a request to read cache data DA to system memory D1, and after system memory D1 returns cache data DA, provides cache data DA to cache H1.
[0065] For step S40, the consistency information directory is, for example, a directory stored in a listening filter, which is used to maintain cache consistency information. For example, the directory in the listening filter A2 includes multiple entries, each entry is used to record the sharing information corresponding to a data block in the corresponding storage space, and the data block can be, for example, a cache line, that is, each entry can be used to record the consistency information of a cache line. For example, each entry may include identification information (TAG) of the corresponding cache line, status information, and the cache that caches the cache line data. Based on the MESI protocol, the status information may include four states: M, E, S, and I. M means exclusive use of this data and the data has been modified; E means exclusive use of this data and the data has not been modified; S means shared, the cache line also exists in other caches and is clean; I means invalid, the cache line is invalid.
[0066] For example, after the consistency master node A1 returns the cache data to the cache H1, the state information of the cache data in the listening filter A2 is updated. For example, in the example where the query result is that the cache 2 stores the cache data DA, and the state information is E, the state information of the cache data DA in the listening filter A2 is updated to S. For another example, in the example where the query result is that the listening filter A2 is not hit, an entry recording the cache data DA is added to the directory of the listening filter A2, and the state information of the cache data DA is E.
[0067] like Figure 2B As shown, for step S41, for example, the granularity of the first storage format is a plurality of consecutive cache lines, and the granularity of the second storage format is one cache line. That is, in some embodiments of the present disclosure, the directory in the snoop filter includes two storage formats. One is called a coarse-grained directory, in which directory information is stored in a first storage format, and each entry in the coarse-grained directory stores directory information in a granularity of multiple cache behaviors, and the other is called a fine-grained directory, in which directory information is stored in a second storage format, and each entry in the fine-grained directory stores directory information in a granularity of 1 cache behavior.
[0068] In some embodiments of the present disclosure, for step S41, for example, the first storage format or the second storage format may be determined as the target storage format according to state information of cache data after cache consistency maintenance is performed on the cache data.
[0069] For step S42, for example, the status information in the entry and the cache that has the cache line data are updated.
[0070] Figure 3 A schematic diagram of a listening filter provided by at least one embodiment of the present disclosure is shown.
[0071] like Figure 3 As shown, the interception filter includes two types of directory information storage units, namely a coarse-grained directory storage unit and a fine-grained directory storage unit. As described above, each entry in the coarse-grained directory storage unit stores directory information in a first storage format, and each entry in the fine-grained directory storage unit stores directory information in a second storage format.
[0072] For example, in a coarse-grained directory storage unit, each entry stores directory information at multiple cache behavior granularities, such as a system "page" granularity; in a fine-grained directory storage unit, each entry stores directory information at one cache behavior granularity.
[0073] like Figure 3As shown, the interception filter further comprises a directory temporary storage unit. The directory temporary storage unit is configured to store temporarily stored directory information from the coarse-grained directory storage unit and the fine-grained directory storage unit.
[0074] In an example including a directory temporary storage unit, step S20 includes: querying the directory temporary storage unit according to the access request; and querying the first storage unit and the second storage unit in response to the access request not hitting the directory temporary storage unit, the first storage unit storing the first part of the consistency information directory in a first storage format, and the second storage unit storing the second part of the consistency information directory in a second storage format. The first storage unit is, for example, Figure 3 The coarse-grained directory storage unit in the second storage unit is, for example, Figure 3 The method first accesses the directory temporary storage unit, and when the access request does not hit the directory temporary storage unit, the first storage unit and the second storage unit are queried, thereby skipping part of the query process, saving power consumption, and optimizing performance. In the embodiments of the present disclosure, the directory temporary storage unit is a non-essential structure. For example, in other embodiments, the first storage unit and the second storage unit can be directly accessed, but the directory temporary storage unit can be used to skip part of the query process, saving power consumption, and optimizing performance.
[0075] For example, the listening filter also includes a control unit, and the directory information of two granularities is managed by the control unit. When the consistency master node has a need to maintain a consistency request, the control unit is accessed. If the control unit finds that the access request does not hit the directory temporary storage unit, the control unit generates access requests for querying the coarse-grained directory storage unit and the fine-grained directory storage unit respectively, thereby obtaining the directory information of the cache data requested to be accessed by the access request from the coarse-grained directory storage unit or the fine-grained directory storage unit.
[0076] In some embodiments of the present disclosure, the method may further include: in response to an access request not hitting the directory temporary storage unit and the access request hitting the first storage unit or the second storage unit, obtaining directory information from the first storage unit or the second storage unit; and storing the directory information in the directory temporary storage unit.
[0077] For example, if the control unit finds that the access request does not hit the directory temporary storage unit, and hits the coarse-grained directory storage unit or the fine-grained directory storage unit, the access result returned by the coarse-grained directory storage unit or the fine-grained directory storage unit will be stored in the directory temporary storage unit. This makes it convenient for subsequent access requests to directly obtain the corresponding directory information from the directory temporary storage unit, saving the resources consumed by reading the coarse-grained directory storage unit and the fine-grained directory storage unit separately. In some embodiments of the present disclosure, for example, after the current consistency maintenance task is completed, the directory information of this consistency maintenance stored in the directory temporary storage unit can be written back to the coarse-grained directory storage unit or the fine-grained directory storage unit, thereby freeing up storage space for subsequent directory information to be written into the directory temporary storage unit.
[0078] The control unit processes the consistency behavior according to the returned access result, maintains the consistency master node to return the required consistency information, and writes the directory information to the coarse-grained directory storage unit or the fine-grained directory storage unit. If the control unit finds the directory temporary storage unit (that is, the directory information temporarily stored in the directory temporary storage unit is exactly the same as the consistency information currently required to be accessed), the process of querying the coarse-grained directory storage unit and the fine-grained directory storage unit is skipped, and the results in the directory temporary storage unit are directly used to complete the subsequent consistency maintenance process.
[0079] In some embodiments of the present disclosure, in response to an access request hitting a directory temporary storage unit, directory information is obtained from the directory temporary storage unit, and cache consistency maintenance is performed on cache data. For example, in response to an access request hitting a directory temporary storage unit, a control unit obtains directory information from the directory temporary storage unit, and returns the directory information to a consistency master node, so that the consistency master node performs cache consistency maintenance on cache data.
[0080] In some embodiments of the present disclosure, the first storage unit and the second storage unit may, for example, use a group-connected structure to store directory information, or other structures may be used to store directory information. The control unit determines whether the access request hits the directory temporary storage unit in a similar manner to the determination of whether the access request hits the cache, which is not described in detail in the embodiments of the present disclosure.
[0081] Figure 4 A schematic diagram showing a storage format of a coarse-grained directory storage unit provided by at least one embodiment of the present disclosure is shown. Figure 4 The storage format of the coarse-grained directory storage unit shown is only an example and does not limit the present disclosure. Those skilled in the art can design different coarse-grained directory storage units as needed.
[0082] The coarse-grained directory storage unit stores directory information according to a storage format of the coarse-grained directory. Figure 4 For example, this is an example of the first storage format. Figure 4 As shown, the first storage format includes state items (e.g., Figure 4 ) and cache line valid items (e.g., Figure 4 The state item is used to indicate the state information of at least part of the cached data in multiple cache lines, and the state information of at least part of the cached data is the same. The cache line valid item is used to indicate the cache lines to which at least part of the cached data belongs. The "item" here can be understood as a field in a table. That is, in the coarse-grained directory, the directory information of multiple cache lines with the same state information belonging to the same page is merged, thereby reducing the area occupied by the snoop filter.
[0083] like Figure 4 As shown, the content stored in each entry in the coarse-grained directory storage unit includes not only the status item and the cache line validity item, but also the processor cluster owner and identification information. The status represents the status information of the valid cache line corresponding to the entry. For example, the state is one of the four states: M, E, S, and I. The processor cluster owner indicates which processor cluster owns the coarse-grained (for example, page) recorded in the entry. The cache line validity item indicates which cache lines in the coarse-grained state are validly recorded in the entry, that is, it is used to indicate the cache lines to which at least part of the cache data belongs. For example, the cache line validity item indicates whether the cache line is valid in binary. For example, the cache line that is validly recorded in the entry is marked as 1, and the cache line that is not validly recorded in the entry is marked as 0. For example, Figure 4 As shown, the value of the cache line valid item of the first entry is 1100, which means that the high-speed cache of the processor cluster CPU0 includes 4 cache lines in total, of which the first cache line and the second cache line are effectively recorded in the entry, that is, the state of the first cache line and the second cache line is M, and the third cache line and the fourth cache line are not effectively recorded in the entry, that is, the state of the third cache line and the fourth cache line is not M. Figure 4 In , the value of the cache line valid item of the second entry is 0011, indicating that the states of the third cache line and the fourth cache line are E. The identification information (TAG) indicates the coarse-grained index information, such as a part of the page address as the identification information. For example, Figure 4 The identification information shown is Tag1.
[0084] Each entry in the fine-grained directory storage unit may include, for example, identification information of the corresponding cache line, state information, and the cache that caches the cache line data. The storage format of the fine-grained directory storage unit may be similar to the format of the directory in the current snooping filter, and will not be described in detail.
[0085] In some embodiments of the present disclosure, step S41 includes, in response to an access request not hitting the first storage unit and the second storage unit, determining that a target storage format of the directory information after cache consistency maintenance of the cache data is the first storage format.
[0086] For example, if the address of the cache data requested to be accessed in the access request misses the coarse-grained directory storage unit and misses the fine-grained directory storage unit, then the target storage format of the directory information after the cache data is subjected to cache consistency maintenance is the first storage format. For example, if the address of the cache data misses the coarse-grained directory storage unit and misses the fine-grained directory storage unit, then the cache data is obtained from the main memory, and the consistency master node performs consistency maintenance on the cache data, and after the consistency maintenance is performed, the directory information of the cache data is stored in the coarse-grained directory storage unit. For example, after the consistency maintenance is performed, the state of the cache data is M, then storing the directory information of the cache data in the coarse-grained directory storage unit may include modifying the valid value of the cache line corresponding to the entry with a state of M in the page where the cache data is located, so that the value of the binary bit corresponding to the cache line where the cache data is located is 1.
[0087] In some embodiments of the present disclosure, step S41 may also include, in response to an access request hitting the first storage unit or the second storage unit, and the state information of the cached data after cache consistency maintenance is a private state, determining that the target storage format of the directory information of the cached data after cache consistency maintenance is the first storage format, and the private state is that the cached data is cached by only one processor cluster.
[0088] For example, in the MESI protocol, M means exclusive use of the data and the data has been modified; E means exclusive use of the data and the data has not been modified, that is, both the M state and the E state indicate that the cache data is exclusively used by a processor cluster, so the private state may include the M state and the E state.
[0089] It should be noted that, although the private state and the shared state are described in the present disclosure as M, E, S, and I states, this does not limit the present disclosure. In other embodiments of the present disclosure, the consistency protocol may include more states.
[0090] For example, if an access request hits a coarse-grained directory storage unit or a fine-grained directory storage unit, and the state information of the cached data after cache consistency maintenance is in M state or E state, then the target storage format of the directory information of the cached data after cache consistency maintenance is a coarse-grained storage format, that is, the directory information of the cached data after cache consistency maintenance is stored in the coarse-grained directory storage unit.
[0091] In some embodiments of the present disclosure, in the above embodiments (i.e., the access request hits the first storage unit or the second storage unit, and the state information of the cached data after cache consistency maintenance is in a private state), step S42 may include: in the case where the access request hits the first storage unit, updating the directory information of the cached data after cache consistency maintenance to the first storage unit; or in the case where the access request hits the second storage unit, transferring the directory information of the cached data after cache consistency maintenance to the first storage unit.
[0092] For example, if the access request hits the coarse-grained directory storage unit, and the cached data is still in a private state after consistency maintenance, the cache line is continued to be tracked in the coarse-grained directory storage unit. If the access request hits the fine-grained directory storage unit, and the cached data is in a private state after consistency maintenance, the cache line is transferred to the coarse-grained directory storage unit to track. For example, the directory information for the cached data in the fine-grained directory storage unit is deleted, and the coarse-grained directory is updated in the coarse-grained directory storage unit according to the directory information of the cached data.
[0093] In some embodiments of the present disclosure, step S41 may also include, in response to an access request hitting the first storage unit or the second storage unit, and the state of the cached data after cache consistency maintenance is a shared state, determining that the target storage format of the directory information of the cached data after cache consistency maintenance is a second storage format, and the shared state is that the cached data is cached by multiple processor clusters.
[0094] For example, in the MESI protocol, S represents shared, and the shared state may include the S state. For example, if the access request hits the coarse-grained directory storage unit or the fine-grained directory storage unit, and the state information of the cached data after the cache consistency maintenance is in the S state, then the target storage format of the directory information of the cached data after the cache consistency maintenance is the fine-grained storage format, that is, the directory information of the cached data after the cache consistency maintenance is stored in the fine-grained directory storage unit.
[0095] For example, in this embodiment (i.e., the access request hits the first storage unit or the second storage unit, and the state of the cache data after cache consistency maintenance is a shared state), step S42 includes: in the case where the access request hits the first storage unit, the directory information of the cache data after cache consistency maintenance is transferred to the second part; or in the case where the access request hits the second storage unit, the directory information of the cache data after cache consistency maintenance is updated to the second part.
[0096] For example, if the access request hits the coarse-grained directory storage unit and the cache data after consistency maintenance is in a shared state, it is transferred to the fine-grained directory unit to track the cache line. If the access request hits the fine-grained directory storage unit and the cache data after consistency maintenance is in a shared state, the cache line continues to be tracked in the fine-grained directory.
[0097] In some other embodiments of the present disclosure, if the coarse-grained directory storage unit is full, the private state may also be placed in the fine-grained directory storage unit.
[0098] Figure 5 A flow chart of a method for maintaining cache consistency provided by at least one embodiment of the present disclosure is shown.
[0099] like Figure 5 As shown, the method includes steps S501 to S505.
[0100] Step S501: The consistency master node accesses the listening filter. This step is similar to Figure 2A Step S10 in .
[0101] Step S502: Determine whether the access hits the directory temporary storage unit. For example, the interception filter is Figure 3 For example, the control unit determines whether the access hits the directory temporary storage unit. If the access does not hit the directory temporary storage unit, step S503 is executed; if the access hits the directory temporary storage unit, step S504 is executed.
[0102] Step S503: Read the coarse-grained directory storage unit and the fine-grained directory storage unit.
[0103] Step S502 and step S503 are similar to those described above. Figure 2A That is, first access the directory temporary storage unit, if the directory temporary storage unit is not hit, then read the coarse-grained directory storage unit and the fine-grained directory storage unit; if the directory temporary storage unit is hit, then read the directory information from the directory temporary storage unit.
[0104] Step S504: Perform consistency maintenance. For example, the control unit processes the consistency behavior maintenance according to the result returned by the directory temporary storage unit, the coarse-grained directory storage unit, or the fine-grained directory storage unit, and returns the required consistency information to the consistency master node, so that the consistency master node performs consistency maintenance. The consistency master node performs consistency maintenance, for example, including writing the modified cache data to the main memory, writing the read cache data to the cache corresponding to the processor cluster, or discarding the cache data.
[0105] Step S505: Return the access result, and write the updated directory information back to the coarse-grained directory storage unit or the fine-grained directory storage unit. This step is similar to step S30 and step S40 described above.
[0106] Fig. 6A A schematic diagram of an apparatus 600 for maintaining cache consistency provided by at least one embodiment of the present disclosure is shown.
[0107] like Fig. 6A As shown, the device 600 includes an acquisition unit 601 , a query unit 602 , a response unit 603 and an update unit 604 .
[0108] The acquisition unit 601 is configured to acquire an access request. The acquisition unit 601 executes, for example, Figure 2A Step S10 in .
[0109] The query unit 602 is configured to query the consistency information directory for maintaining cache consistency according to the access request to obtain a query result. The query unit 602 executes, for example, Figure 2A Step S20 in .
[0110] The response unit 603 is configured to respond to the access request according to the query result. The response unit 603 performs, for example, Figure 2A Step S30 in .
[0111] The updating unit 604 is configured to update the consistency information directory. The updating unit 604 performs, for example, Figure 2A Step S40 in .
[0112] The device can reduce the area of the listening filter, and reduce the cost and design difficulty.
[0113] Figure 6B FIG. 4 is a schematic diagram of a snoop filter 60 provided by at least one embodiment of the present disclosure.
[0114] like Figure 6B As shown, the intercept filter 60 includes a control unit 61, a first storage unit 62 and a second storage unit 63. The control unit 61 is similar to the above Figure 3 The control unit described above, the first storage unit 62 is similar to Figure 3 The coarse-grained directory storage unit described above, the second storage unit 63 is similar to Figure 3 A fine-grained directory storage unit described.
[0115] The control unit 61 is configured to obtain an access request; query a consistency information directory used to maintain cache consistency according to the access request to obtain a query result; and provide the query result to the consistency master node, so that the consistency master node performs cache consistency maintenance on the cache data according to the query result; after the cache consistency maintenance is completed, determine the target storage format of the directory information of the cache data after the cache consistency maintenance, the target storage format includes a first storage format and a second storage format, and the storage granularity of the first storage format is greater than the storage granularity of the second storage format; and provide the directory information of the cache data after the cache consistency maintenance to the first storage unit or the second storage unit to update the consistency information directory, the first storage unit is configured to store the directory information of the cache data after the cache consistency maintenance according to the first storage format to the cache consistency information directory; the second storage unit is configured to store the directory information of the cache data after the cache consistency maintenance according to the second storage format to the cache consistency information directory.
[0116] For example, the control unit 61 obtains an access request provided by the consistency master node, and queries the consistency information directory according to the access request to obtain a query result, where the consistency information directory includes directory information in the first storage unit and directory information in the second storage unit.
[0117] Please refer to the above description for the control unit 61 , the first storage unit 62 and the second storage unit 63 .
[0118] In the embodiments of the present disclosure, the acquisition unit 601, the query unit 602, the response unit 603 and the update unit 604, the control unit 61, the first storage unit 62 and the second storage unit 63 can be hardware, software, firmware and any feasible combination thereof. For example, the acquisition unit 601, the query unit 602, the response unit 603 and the update unit 604, the control unit 61, the first storage unit 62 and the second storage unit 63 can be dedicated or general circuits, chips or devices, etc. Regarding the specific implementation form of each of the above-mentioned units, the embodiments of the present disclosure do not limit this. The device 600 for maintaining cache consistency and the listening filter 60 correspond to the various steps of the aforementioned method for maintaining cache consistency. For the specific functions of the device 600 for maintaining cache consistency and the listening filter 60, please refer to the relevant description of the method for maintaining cache consistency, which will not be repeated here.
[0119] Fig. 6A and Figure 6B The components and structures shown are merely exemplary and non-limiting, and other components and structures may be included as needed.
[0120] Figure 7 A schematic block diagram of an electronic device provided in some embodiments of the present disclosure. Figure 7As shown, the electronic device 700 includes a memory 710 and a processor 720. The memory 710 is used to store non-temporary computer-readable instructions (e.g., one or more computer program modules). The processor 720 is used to run the computer program instructions, and the computer program instructions are executed by the processor 720 to perform the method for maintaining cache consistency provided by any embodiment of the present disclosure. The memory 820 and the processor 810 can be interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0121] The processor 720 may be a device with data processing capability and / or program execution capability, such as a central processing unit (CPU), a tensor processing unit (TPU), a network processor (NP), or a graphics processing unit (GPU), and may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. For example, the central processing unit (CPU) may be an X86 or ARM architecture, etc. The processor 720 may be a general-purpose processor or a dedicated processor, and may control other components in the electronic device 700 to perform desired functions.
[0122] For example, the memory 710 may include any combination of one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory (cache), etc. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, erasable programmable read-only memory (EPROM), portable compact disk read-only memory (CD-ROM), USB memory, flash memory, etc. One or more computer program modules may be stored on the computer-readable storage medium, and the processor 720 may run one or more computer program modules to implement various functions of the electronic device 700. Various applications and various data, as well as various data used and / or generated by the application, etc. may also be stored in the computer-readable storage medium.
[0123] It should be noted that, in the embodiment of the present disclosure, the specific functions and technical effects of the electronic device 700 can refer to the above description of the method for maintaining cache consistency, which will not be repeated here.
[0124] Figure 8 This is a schematic block diagram of another electronic device provided in some embodiments of the present disclosure. The electronic device 800 is suitable for implementing the information processing method provided in the embodiments of the present disclosure. The electronic device 800 may be a terminal device, etc. It should be noted that: Figure 8The electronic device 800 shown is only an example and does not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0125] like Figure 8 As shown, the electronic device 800 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 810, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 820 or a program loaded from a storage device 880 into a random access memory (RAM) 830. In the RAM 830, various programs and data required for the operation of the electronic device 800 are also stored. The processing device 810, the ROM 820, and the RAM 830 are connected to each other via a bus 840. An input / output (I / O) interface 850 is also connected to the bus 840.
[0126] Typically, the following devices may be connected to the I / O interface 850: an input device 860 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 870 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 880 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 890. The communication device 890 may allow the electronic device 800 to communicate with other electronic devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 800 is shown to have various devices, but it should be understood that it is not required to implement or possess all of the devices shown, and the electronic device 800 may alternatively implement or possess more or fewer devices.
[0127] For example, according to an embodiment of the present disclosure, the above-mentioned information processing method can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program includes a program code for executing the above-mentioned information processing method. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 890, or installed from the storage device 880, or installed from the ROM 820. When the computer program is executed by the processing device 810, the functions defined in the information processing method provided in the embodiment of the present disclosure can be implemented.
[0128] At least some embodiments of the present disclosure also provide a non-transitory storage medium. Fig. 9 A schematic diagram of a non-transitory storage medium provided in some embodiments of the present disclosure. Fig. 9As shown, the storage medium 900 non-temporarily stores computer executable instructions 910. When the non-temporary computer executable instructions 910 are executed by a computer (including a processor), the method for maintaining cache consistency provided by any embodiment of the present disclosure can be executed. The method can reduce the area of the snoop filter, reduce the cost and design difficulty.
[0129] For example, one or more computer instructions may be stored on the storage medium 900. Some of the computer instructions stored on the storage medium 900 may be, for example, instructions for implementing one or more steps in the above-mentioned method for maintaining cache consistency.
[0130] For example, the storage medium may include a storage component of a tablet computer, a hard disk of a personal computer, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a compact disk read-only memory (CD-ROM), a flash memory, or any combination of the above storage media, or other applicable storage media. For example, the storage medium 900 may include the memory 710 in the aforementioned electronic device 700.
[0131] The technical effects of the storage medium provided by the embodiments of the present disclosure can be referred to the corresponding description of the method for maintaining cache consistency in the above embodiments, which will not be repeated here.
[0132] There are a few points to note about this disclosure:
[0133] (1) In the drawings of the embodiments of the present disclosure, only the structures related to the embodiments of the present disclosure are involved, and other structures can refer to the general design.
[0134] (2) In the absence of conflict, features in the same embodiment or in different embodiments of the present disclosure may be combined with each other.
[0135] The above are only specific embodiments of the present disclosure, but the protection scope of the present disclosure is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present disclosure, which should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.
Claims
1. A method for maintaining cache consistency, comprising: Get access request; According to the access request, query a consistency information directory for maintaining cache consistency to obtain a query result; responding to the access request according to the query result; as well as updating the consistency information directory, Wherein, updating the consistency information directory includes: Determining a target storage format of the directory information after cache consistency maintenance is performed on the cache data, wherein the target storage format includes a first storage format and a second storage format, wherein a storage granularity of the first storage format is greater than a storage granularity of the second storage format; and The directory information after cache consistency maintenance of the cache data is stored in the consistency information directory according to the target storage format.
2. The method according to claim 1, wherein: According to the access request, querying the consistency information directory for maintaining cache consistency includes: According to the access request, query the directory temporary storage unit; and In response to the access request not hitting the directory temporary storage unit, a first storage unit and a second storage unit are queried, wherein the first storage unit stores the first part of the consistency information directory according to the first storage format, and the second storage unit stores the second part of the consistency information directory according to the second storage format.
3. The method according to claim 2, wherein: Determining a target storage format of the directory information after cache consistency maintenance of the cache data includes: In response to the access request not hitting the first storage unit and the second storage unit, it is determined that the target storage format of the directory information after the cache data is subjected to cache consistency maintenance is the first storage format.
4. The method according to claim 2, wherein: Determining a target storage format of the directory information after cache consistency maintenance of the cache data includes: In response to the access request hitting the first storage unit or the second storage unit, and the state information of the cache data after the cache consistency maintenance is a private state, it is determined that the target storage format of the directory information of the cache data after the cache consistency maintenance is the first storage format, wherein the private state is that the cache data is cached by only one processor cluster.
5. The method according to claim 4, wherein: Storing the directory information of the cache data after cache consistency maintenance in the target storage format to the consistency information directory includes: In the case where the access request hits the first storage unit, updating the directory information of the cache data after cache consistency maintenance to the first storage unit; or In the case where the access request hits the second storage unit, the directory information of the cache data after cache consistency maintenance is performed is transferred to the first storage unit.
6. The method according to claim 2, wherein: Determining a target storage format of the directory information after cache consistency maintenance of the cache data includes: In response to the access request hitting the first storage unit or the second storage unit, and the state of the cache data after the cache consistency maintenance is a shared state, it is determined that the target storage format of the directory information of the cache data after the cache consistency maintenance is the second storage format, wherein the shared state is that the cache data is cached by multiple processor clusters.
7. The method according to claim 6, wherein: Storing the directory information of the cache data after cache consistency maintenance in the target storage format to the consistency information directory includes: In the case where the access request hits the first storage unit, transferring the directory information of the cache data after cache consistency maintenance to the second part; or In the case where the access request hits the second storage unit, the directory information of the cache data after cache consistency maintenance is performed is updated to the second part.
8. The method according to claim 2, further comprising: In response to the access request not hitting the directory temporary storage unit, and the access request hitting the first storage unit or the second storage unit, acquiring the directory information from the first storage unit or the second storage unit; as well as The directory information is stored in the directory temporary storage unit.
9. The method according to claim 2, wherein: Responding to the access request according to the query result includes: In response to the access request hitting the directory temporary storage unit, the directory information is acquired from the directory temporary storage unit, and cache consistency maintenance is performed on the cache data.
10. The method according to claim 1, wherein: According to the access request, querying the consistency information directory for maintaining cache consistency includes: According to the access request, a first storage unit and a second storage unit are queried, wherein the first storage unit stores the first part of the consistency information directory according to the first storage format, and the second storage unit stores the second part of the consistency information directory according to the second storage format.
11. The method according to claim 1, wherein: The granularity of the first storage format is a plurality of consecutive cache lines, and the granularity of the second storage format is one cache line.
12. The method according to claim 11, wherein: The first storage format includes a status item and a cache line valid item, The state item is used to indicate state information of at least part of the cache data in the plurality of cache lines, and the state information of at least part of the cache data is the same. The cache line valid items are used to indicate the cache lines to which the at least part of the cache data respectively belongs.
13. A device for maintaining cache consistency, comprising: an acquisition unit configured to acquire an access request; A query unit, configured to query a consistency information directory for maintaining cache consistency according to the access request to obtain a query result; a response unit, configured to respond to the access request according to the query result; an updating unit, configured to update the consistency information directory, Wherein, the update unit configuration includes: a format determination subunit, configured to determine a target storage format of the directory information after cache consistency maintenance is performed on the cache data, wherein the target storage format includes a first storage format and a second storage format, wherein a storage granularity of the first storage format is greater than a storage granularity of the second storage format; and The storage unit is configured to store the directory information of the cache data after cache consistency maintenance in the consistency information directory according to the target storage format.
14. A listening filter comprising: a control unit, a first storage unit, and a second storage unit, The control unit is configured as follows: Get access request; Querying a consistency information directory for maintaining cache consistency according to the access request to obtain a query result; as well as Providing the query result to the consistency master node, so that the consistency master node performs cache consistency maintenance on the cache data according to the query result; After the cache consistency maintenance is completed, determining a target storage format of the directory information of the cache data after the cache consistency maintenance is performed, wherein the target storage format includes a first storage format and a second storage format, wherein a storage granularity of the first storage format is greater than a storage granularity of the second storage format; and Providing directory information of the cache data after cache consistency maintenance to the first storage unit or the second storage unit to update the consistency information directory, The first storage unit is configured to store directory information after cache consistency maintenance of the cache data in the cache consistency information directory according to the first storage format; The second storage unit is configured to store the directory information after cache consistency maintenance of the cache data in the cache consistency information directory according to the second storage format.
15. An electronic device, comprising: processor; a memory including one or more computer program instructions; as well as The one or more computer program instructions, when executed by the processor, execute the method for maintaining cache consistency according to any one of claims 1-12.
16. A computer-readable storage medium non-transitorily storing computer-readable instructions, wherein: When the computer-readable instructions are executed by a processor, the method for maintaining cache consistency according to any one of claims 1 to 12 is implemented.
Citation Information
Cited By
Many-core cache consistency system and method, electronic equipment, storage medium and product
CN119669109A
Cache data reading method and device, computer equipment and storage medium
CN119759807A
Directory updating method and device for maintaining cache consistency, medium and program product
CN121455845A
A directory update method, device, medium and program product for maintaining cache consistency
CN121455845B
Processor verification system and method, electronic equipment and readable storage medium
CN121480403A
