Multi-chip consistency snooping filtering method based on cache group mapping

By utilizing the set-associative cache structure and directory index in a multi-CPU chip system, efficient filtering of remote caches is achieved, which solves the problem of unnecessary monitoring caused by directory capacity and granularity, and improves the system's monitoring efficiency and Accuracy.

CN114385439BActive Publication Date: 2024-10-18PEKING UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111514859.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-13
Publication Date
2024-10-18
Estimated Expiration
2041-12-13

AI Technical Summary

Technical Problem

In a non-consistent memory access system with multiple CPU chips, the problem of excessive capacity or excessive granularity of directory tables leads to unnecessary remote monitoring operations and increases access delays.

Method used

By building a directory table on each chip, using the structure of the set-associative cache, the cache group address and the directory table extension address are spliced ​​to form a directory table index, so as to achieve efficient filtering of remote caches and timely update the effectiveness of directory table entries. Avoid invalid monitoring.

Benefits of technology

It improves the usage efficiency of directory tables, reduces capacity requirements, reduces unnecessary remote monitoring operations, and improves the monitoring and filtering accuracy and efficiency of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114385439B_ABST
    Figure CN114385439B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-chip consistency monitoring filtering method based on cache group mapping, belonging to the field of multi-processor cache system. The present invention utilizes the characteristic that accessing a group-associative cache requires reading information within the group. By making the address mapping of a directory table correspond to the group mapping of the cache, remote monitoring can determine whether there is still data mapped to the same item or items of the directory table in the remote cache while comparing whether the addresses are equal, so that the directory table can actively detect the distribution of local data in the remote cache during each remote monitoring, thereby increasing the update frequency of the directory table and achieving higher filtering accuracy when using a small-capacity directory table.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention provides a multi-chip consistency monitoring filtering method, in particular to a method for processing monitoring operations, belonging to the field of multi-processor cache systems. Background Art

[0002] In a non-uniform memory access (NUMA) system composed of multiple CPU chips, each CPU chip has multiple processor cores and a local memory controller. The processor cores on all chips share each other's memory space and achieve cache consistency, that is, the data connected to the local memory on each chip can be allocated in the remote cache on other chips. When a chip wants to access its own local data, it needs to determine whether there is a copy of the data in the remote cache through a monitoring operation. However, due to the large transmission delay between chips, in order to reduce access delay, it is necessary to reduce unnecessary remote monitoring operations as much as possible. The commonly used method is that each chip uses a directory table to record the allocation of data belonging to the local memory space in the remote cache. When a local or remote processor core initiates access to the local memory, it will determine whether it is necessary to monitor the cache on the remote chip through the directory table. If the allocation record of this address in the remote cache cannot be found in the directory table, no remote monitoring is required.

[0003] Since each chip has a large local memory space, if the directory table records the allocation of all addresses in the local space in the remote cache according to the granularity of cache lines, the capacity of the directory table will be very large and difficult to implement on the chip, so there needs to be a way to compress the capacity of the directory table. There are two common methods: one is to increase the address range covered by the items in the directory table, that is, to increase the granularity of the directory table, so that the entire local address space can be covered with fewer entries; another method is to only save the allocation of part of the local address in the directory table, and when the directory table is full and there are new addresses to be saved, they will be replaced.

[0004] The above two methods have their own shortcomings: the first method has a large granularity of directory table entries, and there are many cache lines corresponding to the same directory table entry. As long as any of the lines has been allocated in the remote cache, other cache lines mapped to the same item in the directory table will also generate remote monitoring, which is obviously invalid; the second method has a limited capacity of the directory table and cannot save many cache line records at the same time. It can only cover a small part of the address. When the directory table is full, a replacement operation is required to accommodate new records, and the replacement operation itself also requires remote monitoring, which increases the delay. Summary of the invention

[0005] The present invention aims to provide a method for filtering remote monitoring operations in a multi-chip system, which provides a higher filtering effect at a smaller chip area cost.

[0006] In order to achieve the above object, the present invention provides a multi-chip consistency remote monitoring filtering method, comprising the following steps:

[0007] A is a NUMA system composed of multiple CPU chips. In this NUMA system, the data in the local memory is copied to the remote cache, and the local address read by the remote chip is identified by the directory table. The implementation method is as follows:

[0008] Each A1 chip contains multiple processor cores, on-chip cache, and memory controller;

[0009] The chips in the A2 system are connected through inter-chip interconnects, and all processor cores in the system share the same memory space, including local memory space managed by a local memory controller and remote memory space managed by a memory controller of a remote chip;

[0010] A3 remote chips can access local memory through inter-chip interconnects and allocate local data in remote caches;

[0011] All caches in the A4 system are set-associative caches and use the same group address mapping method;

[0012] A5 Each chip has a local directory table that records whether the data in the local memory may have a copy in the remote cache. If it is determined that there is no copy, the access to the local memory address does not need to monitor the remote cache;

[0013] The directory table entries in the B directory table are directly mapped to the groups in the group-associative cache. Any directory table entry is uniquely mapped to a fixed group in the cache. The specific implementation method is as follows:

[0014] B1, on the basis of performing set-associative cache mapping, uses part of the high-order address other than the cache group address as the directory table extension address, and combines the cache group address with the directory table extension address to obtain the directory table index;

[0015] B2 When the remote chip reads local data through the monitoring operation, it finds the entry corresponding to the access address in the directory table according to the directory table index and sets it to valid, indicating that there may be a copy in the remote cache;

[0016] C performs inter-chip monitoring filtering based on the information in the directory table. The specific implementation method is:

[0017] When C1 accesses a local address, it queries the directory table. If the result shows that the address to be accessed does not exist in the remote cache, it does not perform remote monitoring;

[0018] If C2 needs to perform remote monitoring, when accessing the remote cache, it reads out all the address information of the group corresponding to the monitoring address and compares it with the monitoring address, and compares the directory table extension bit in the address information with the directory table extension bit of the monitoring address;

[0019] C3 If the directory table extension bits of all addresses in the group are different from the directory table extension bits of the listening address, it means that there is no copy of the cache line mapped in the same directory table entry in the remote cache, and the corresponding directory table entry is set to invalid.

[0020] The present invention can further improve performance by the following means:

[0021] 1) When comparing the directory table extension addresses of remote cache lines, if one of the bits has the same value in all cache lines, it means that the cache line corresponding to the directory table extension address with the opposite value does not exist in the remote cache, and the directory table entries corresponding to these cache lines can all be set to invalid.

[0022] 2) When building the directory table, the directory table entries mapped to the same cache group can be saved in the same row of RAM, so that they can be updated simultaneously based on the results returned by the monitoring.

[0023] The principle of the invention is that in a NUMA system, data in a local memory can be stored in a remote cache. By identifying the local address that has been read by the remote chip through the directory table, it is possible to know which data may have a copy in the remote cache, thereby avoiding unnecessary remote monitoring. The use of a coarse-grained directory table can reduce the capacity requirement of the directory table, but it cannot accurately record the allocation of each cache line in the local cache in the remote cache. Since the capacity of the remote cache cannot be compared with the memory space of the chip, and the remote cache also needs to save the data of the remote chip itself or other chips, although the data in the local memory space can be continuously allocated in the remote cache, the local data stored in the remote cache at the same time is actually very small. It is just that the directory table cannot detect in time whether the allocated local data still exists in the remote cache, so the directory table cannot fully filter all unnecessary remote monitoring. If there is a method to enable the directory table to be updated in time, its effective utilization rate will be improved. The cache of modern processors generally adopts a group-associative structure, that is, the cache is divided into several groups according to the address, and each group contains several cache lines. For any memory address, it corresponds to a unique cache group, but can be stored in any row within the group. When monitoring the cache, the address information (TAG) of all rows in the group will be read at the same time, and compared with the monitoring address to confirm whether it hits. The present invention utilizes the characteristic that accessing the group-associated cache requires reading the information within the group. By making the address mapping of the directory table correspond to the group mapping of the cache, remote monitoring can determine whether there is still data mapped to the same item or items of the directory table in the remote cache while comparing whether the addresses are equal, so that the directory table can actively detect the distribution of local data in the remote cache every time it monitors remotely, thereby increasing the update frequency of the directory table and achieving higher filtering accuracy when using a small-capacity directory table.

[0024] Beneficial effects of the present invention:

[0025] By constructing and maintaining a directory table in the manner provided by the present invention, the validity of directory table items can be verified during daily monitoring, and directory table items that no longer need to be monitored can be discovered and invalidated in a timely manner, thereby improving the use efficiency of the directory table and reducing the requirements for directory table capacity. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a mapping relationship diagram of the target table of the present invention, describing the parsing process of the physical address;

[0027] Figure 2 is a schematic diagram of inter-chip monitoring according to the present invention;

[0028] Figure 3 The present invention generates a final mask schematic diagram according to the comparison result of the directory table extension address. DETAILED DESCRIPTION

[0029] In this embodiment, a NUMA system is formed by two CPU chips, each chip contains 4 processor cores and 128GB of local memory space. Each processor core contains 512KB of secondary cache, which is structured as 2048 groups of 4-way group associative, and the cache line width is 64 bytes. The secondary cache of each processor core achieves data consistency. The directory table has 256K items, each 1 bit, when 1, it means that the address mapped to the item may have a copy in the remote cache, when 0, it means that it is impossible, and the total capacity of the directory table is 32KB.

[0030] In this embodiment, there are 38 bits of effective physical address, which are used to index the memory space of two chips with a total of 256GB, of which bits 5 to 0 are the offset address within the group; bits 16 to 6 are the group address, which are used to index the cache; bits 23 to 17 are the directory table extension address, which together with the group address constitute the index of the directory table; bits 36 to 24 are the high-order address; and bit 37 is used to distinguish the memory space of the chip to which the address belongs. Since there are overlapping parts in the indexes of the directory table and the cache, 128 items in the directory table with the same cache group address but different directory table extension addresses are mapped to the same group of the cache. The directory table is implemented using a 128-bit wide RAM array, and the directory table items mapped to the same cache group can be read / written simultaneously in the same cycle.

[0031] refer to Figure 1 ,exist Figure 1 The physical address is divided into five parts: the chip ID is used to indicate which chip this address belongs to; the cache group address is the index of the group to which the address is mapped; the offset within the group is the location of the data to be accessed within the cache line; the directory table extension address is the extra bit of the directory table index over the cache group address, and it can also represent the index of the directory table entry mapped to the same cache group; the high-order address is the remaining address not used to index the cache and directory table. Physical addresses with the same cache group address and directory table extension address but different high-order addresses are mapped to the same entry in the directory table. It can also represent the granularity of the directory table. The longer the high-order address, the larger the granularity. The physical address is mapped to the directory table entry according to its cache group address and directory table extension address, and is mapped to the cache according to the cache group address. The directory table entry and cache group are in a many-to-one relationship. Directory table entries with the same cache group address are mapped to the same cache group.

[0032] When accessing a local address, the directory table is indexed to determine whether remote monitoring is required: if the value of the corresponding item in the directory table is 1, monitoring is required. Figure 2 , the process of inter-chip monitoring, first indexes to the directory table based on the directory table extension address in the physical address plus the cache group address, then confirms the need for remote monitoring based on the information in the directory table, indexes the remote cache through the cache group address, reads out the tags of all rows in the group, and compares the directory table extension addresses. The tags contain bits 37 to 17 of the physical address, which are divided into three parts: (1) Bit 37 of the physical address, which is used to determine which chip's address space the cache line belongs to. If the cache line belongs to the address space of the chip where the directory table is located, it is called a candidate cache line; (2) Bits 36 to 24 of the physical address, the high-order address; (3) Bits 23 to 17 of the physical address, the directory table extension address. Only when (1) to (3) are equal to the corresponding parts of the monitoring address is it considered a monitoring hit. While judging the monitoring hit, the directory table extension address must also be compared to obtain the updated value of the directory table. There are two ways to obtain the updated value:

[0033] 1) Directly compare the entire directory table extension address in the listening address to determine whether there is a candidate cache line mapped to the same directory table item in the remote cache. If there is no candidate cache line mapped to this directory table item in all remote caches, the directory table item corresponding to the listening address is cleared.

[0034] 2) Compare each bit of the directory table extension address to obtain two vectors of the same length as the directory table extension address: the first vector is the equal-valued valid bit, and a bit of it is 1, indicating that the values ​​of the corresponding bits of the directory table extension addresses of all candidate cache lines are equal; the second vector is the equal-valued bit, and when the equal-valued valid bit of the corresponding bit is 1, it indicates that this bit of the address of all candidate cache lines has this value. The directory table generates its own directory table entry mask according to each bit in the two vectors: if a bit in the equal-valued valid bit is 1, and the corresponding bit in the equal-valued bit is 1, then the mask of the directory table entry with this bit in the corresponding directory table extension address encoded as 0 is 0; if a bit in the equal-valued valid bit is 1, and the corresponding bit in the equal-valued bit is 0, then the mask of the directory table entry with this bit in the corresponding directory table extension address encoded as 1 is 0; if the equal-valued valid bit of the corresponding bit is 0, the mask of all encoded bits of the corresponding directory table extension address is all 1. After obtaining the seven 128-bit address table entry masks, they are first logically ANDed together, and then logically ANDed together with the old values ​​in the directory table. Figure 3In the directory table extension address of all candidate cache lines, two bits have the same value, resulting in two directory table entry masks that are not all 1. They are combined to obtain the final directory table entry mask, in which only 32 bits are 1, that is, the directory table entries corresponding to the remaining 96 bits must be cleared. Since the values ​​of the 128-entry directory table mapped to the same cache group are stored on the same row of RAM, they can be updated at the same time.

[0035] Through the above design, the group granularity directory table can be maintained during each remote monitoring, so that the directory table can maintain the validity of information without active detection and improve filtering efficiency.

Claims

1. A multi-chip consistency remote monitoring filtering method, characterized in that: The following steps are included: A is a NUMA system composed of multiple CPU chips. In this NUMA system, data in the local memory is copied to the remote cache, and the local address read by the remote chip is identified by the directory table. The following steps are included: Each A1 chip contains multiple processor cores, on-chip cache, and memory controller; The chips in the A2 system are connected through inter-chip interconnects, and all processor cores in the system share the same memory space, including local memory space managed by a local memory controller and remote memory space managed by a memory controller of a remote chip; A3 remote chips access local memory through inter-chip interconnects and allocate local data in remote caches; All caches in the A4 system are set-associative caches and use the same group address mapping method; A5 Each chip has a local directory table that records whether the data in the local memory may have a copy in the remote cache. If it is determined that there is no copy, the access to the local memory address does not need to monitor the remote cache; The directory table entries in the B directory table are directly mapped to the groups in the group-associative cache. Any directory table entry is uniquely mapped to a fixed group in the cache. The specific steps include: B1, on the basis of performing set-associative cache mapping, uses part of the high-order address other than the cache group address as the directory table extension address, and combines the cache group address with the directory table extension address to obtain the directory table index; B2 When the remote chip reads local data through the monitoring operation, it finds the entry corresponding to the access address in the directory table according to the directory table index and sets it to valid, indicating that there may be a copy in the remote cache; C performs inter-chip monitoring filtering based on the information in the directory table. The specific steps include: When C1 accesses a local address, it queries the directory table. If the result shows that the address to be accessed does not exist in the remote cache, it does not perform remote monitoring; If C2 needs to perform remote monitoring, when accessing the remote cache, it reads out all the address information of the group corresponding to the monitoring address and compares it with the monitoring address, and compares the directory table extension bit in the address information with the directory table extension bit of the monitoring address; C3 If the directory table extension bits of all addresses in the group are different from the directory table extension bits of the listening address, it means that there is no copy of the cache line mapped in the same directory table entry in the remote cache, and the corresponding directory table entry is set to invalid.

2. The multi-chip consistency remote monitoring filtering method according to claim 1, characterized in that: When comparing the directory table extension addresses of remote cache lines, if one of the bits has the same value in all cache lines, it means that the cache line corresponding to the directory table extension address with the opposite value does not exist in the remote cache, and the directory table entries corresponding to these cache lines are all set to invalid.

3. The multi-chip consistency remote monitoring filtering method according to claim 1, characterized in that: When building the directory table, directory table entries that map to the same cache group are saved in the same row of RAM.

4. The multi-chip consistency remote monitoring filtering method according to claim 1, characterized in that: The directory table extension address is compared to obtain the updated value of the directory table. The updated value is obtained by directly comparing the entire directory table extension address in the listening address to determine whether there is a candidate cache row mapped to the same directory table item in the remote cache. If there is no candidate cache row mapped to this directory table item in all remote caches, the directory table item corresponding to the listening address is cleared.

5. The multi-chip consistency remote monitoring filtering method according to claim 1, characterized in that: The directory table extension address is compared to obtain the updated value of the directory table. The updated value is obtained by comparing each bit of the directory table extension address to obtain two vectors of the same length as the directory table extension address. The directory table generates its own directory table entry mask according to each bit in the two vectors. After obtaining the directory table entry mask, they are first logically ANDed and then logically ANDed with the old value in the directory table.

Citation Information

Patent Citations

  • Multi-path set-connection cache memory and processing method thereof

    CN104536911A

  • Method for realizing inter-chip consistency by using adaptive granularity directory table

    CN113553274A