WO2021008552A1 - Data reading method and apparatus, and computer-readable storage medium - Google Patents

Data reading method and apparatus, and computer-readable storage medium Download PDF

Info

Publication number
WO2021008552A1
WO2021008552A1 PCT/CN2020/102123 CN2020102123W WO2021008552A1 WO 2021008552 A1 WO2021008552 A1 WO 2021008552A1 CN 2020102123 W CN2020102123 W CN 2020102123W WO 2021008552 A1 WO2021008552 A1 WO 2021008552A1
Authority
WO
WIPO (PCT)
Prior art keywords
cache
data
address
read
keep
Prior art date
Application number
PCT/CN2020/102123
Other languages
French (fr)
Chinese (zh)
Inventor
董礼玲
Original Assignee
深圳市中兴微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市中兴微电子技术有限公司 filed Critical 深圳市中兴微电子技术有限公司
Publication of WO2021008552A1 publication Critical patent/WO2021008552A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0806Multiuser, multiprocessor or multiprocessing cache systems
    • G06F12/0811Multiuser, multiprocessor or multiprocessing cache systems with multilevel cache hierarchies
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/12Replacement control
    • G06F12/121Replacement control using replacement algorithms
    • G06F12/122Replacement control using replacement algorithms of the least frequently used [LFU] type, e.g. with individual count value

Definitions

  • the embodiments of the present application relate to, but are not limited to, the field of network communication technology, such as a data reading method and device, and a computer-readable storage medium.
  • DRAM Dynamic Random Access Memory
  • the central processing unit (CPU) or the packet processor (PP) initiates a table lookup operation. This operation will first go through the Cache management module. If the Cache If it hits, it will directly return the table lookup result. If the Cache misses, then send a table lookup request to the DRAM.
  • CPU central processing unit
  • PP packet processor
  • mapping methods include:
  • the embodiments of the present application provide a data reading method and device, and a computer-readable storage medium, which can save the total storage space of the cache and reduce the overhead of the cache.
  • the embodiment of the application provides a data reading method, including:
  • the entry width W1 of a cache is smaller than the entry width W2 of the second cache, the number of entries K1 of the first cache is greater than the number of entries K2 of the second cache, and K1*W1+K2*W2 ⁇ K1*W2, Among them, W1, W2, K1, K2 are all natural numbers greater than 1;
  • the second data is output; in response to the judgment result that the read data request misses the second data, the target memory is read according to the target storage address. Data and output the read data in the target memory.
  • the embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize The data reading method described in any of the above.
  • An embodiment of the present application also provides a data reading device, including a processor and a memory, wherein the processor is configured to execute a program stored in the memory to implement the data reading method described in any one of the above.
  • the embodiment of the present application also provides a data reading device, including an address conversion module, a first cache, a second cache, and a data search module, wherein:
  • An address conversion module configured to receive a read data request, where the read data request carries a target storage address in the target memory; convert the target storage address into a first cache address;
  • the first cache is set to cache the second cache address
  • the second cache is set to cache data in the target memory
  • a data search module configured to read first data corresponding to the first cache address from a first cache, the first data including a second cache address; read from the second cache corresponding to the second cache address Compare the second data with the read data request to determine whether the read data request hits the second data, wherein the entry width W1 of the first cache is smaller than the entry of the second cache Width W2, the number of entries K1 in the first cache is greater than the number K2 of entries in the second cache, and K1*W1+K2*W2 ⁇ K1*W2, where W1, W2, K1, and K2 are all greater than 1. Natural number; in response to the judgment result that the read data request hits the second data, output second data; in response to the judgment result that the read data request misses the second data, read the target memory according to the target storage address And output the read data in the target memory.
  • Figure 1 is a schematic diagram of the data flow of a network processor accessing DRAM in related technologies
  • Figure 2a is a schematic diagram of the principle of direct mapping between cache and DRAM in related technologies
  • Figure 2b is a schematic diagram of the principle of a fully associative mapping method between cache and DRAM in related technologies
  • Figure 2c is a schematic diagram of the principle of the group associative mapping method between the cache and the DRAM in the related technology
  • FIG. 3 is a first exemplary flowchart of a data reading method according to an embodiment of the present application.
  • FIG. 4 is a schematic diagram of a first exemplary structure of a data reading device according to an embodiment of the application.
  • FIG. 5 is a schematic diagram of a second exemplary structure of a data reading device according to an embodiment of the application.
  • FIG. 6 is a schematic diagram of a third exemplary structure of a data reading device according to an embodiment of the application.
  • FIG. 7 is a schematic diagram of a fourth exemplary structure of a data reading device according to an embodiment of the application.
  • FIG. 8 is a schematic diagram of a cache lookup and cache update process according to an embodiment of the application.
  • FIG. 9 is a schematic diagram of an aging and keep-alive process according to an embodiment of the application.
  • an embodiment of the present application provides a data reading method, including:
  • Step 310 Receive a read data request, where the read data request carries a target storage address in the target memory; convert the target storage address into a first cache address.
  • the method of converting the target storage address into the first cache address can use the address conversion method in the related art, which is not limited in this application.
  • Step 320 Read the first data corresponding to the first cache address from the first cache, where the first data includes the second cache address.
  • the mapping method between the first cache and the target memory is group associative mapping, and the address range of the target memory is divided into K groups, and each group can be indirectly mapped to all groups.
  • Step 330 Read the second data corresponding to the second cache address from the second cache, compare the second data with the read data request, and determine whether the read data request hits the second data, where the entry width of the first cache W1 is smaller than the entry width W2 of the second cache, the number of entries in the first cache K1 is greater than the number of entries in the second cache K2, and K1*W1+K2*W2 ⁇ K1*W2, W1, W2, K1, and K2 are all greater than 1.
  • the natural number, * is the multiplication sign.
  • the number of Cache entries required is K1, and the required Cache entry width is W2, that is, the total cache space required is K1*W2; when using the indirect mapping method of this application
  • the total buffer space required is K1*W1+K2*W2. Since the entry in the first cache of the present application stores the second cache address, and the entry in the second cache stores data in the target memory, the entry width W1 of the first cache is significantly smaller than the entry width W2 of the second cache Therefore, by using the indirect mapping method of this application, K1*W1+K2*W2 ⁇ K1*W2 can be easily satisfied, which saves the total storage space of the cache and reduces the overhead of the cache.
  • Step 340 If the read data request hits the second data, output the second data.
  • the method further includes: increasing the keep-alive weight of the second data by 1.
  • Step 350 If the read data request misses the second data, read and output the data in the target memory according to the target memory address.
  • the data reading method sets two caches: the first cache and the second cache, and indirectly maps and reads the data in the target memory. Because the entries in the first cache are stored Is the second cache address, the entry in the second cache stores the data in the target memory, the entry width of the first cache is obviously smaller than the entry width of the second cache, by setting: K1*W1+K2*W2 ⁇ K1* W2 effectively saves the total storage space of the cache, reduces the overhead of the cache, and compared with the direct mapping using a cache (the number of entries is K2, the entry width is W2), only a small amount of storage space is added (because W1 is far away). Less than W2, K1*W1 is also much smaller than K2*W2), but it effectively improves the hit rate of the Cache and meets the high bandwidth requirements of the network processor.
  • the method further includes: detecting whether there is a usable second cache address in the second cache; if there is a usable second cache address in the second cache, The second cache address stores the read data in the target memory to the available second cache address, and stores the available second cache address to the first cache address.
  • LRU Least Recently Used
  • LFU Least Frequently Used
  • the performance is often better when the Cache is not updated for small bandwidth traffic. Therefore, in the embodiment of the present application, the Cache update operation is performed only when the Cache has available space, which reduces the possibility of replacing a large-traffic entry with a small-traffic entry from the Cache.
  • the flow of network processors accessing DRAM does not have the feature of "locality", that is, accessing an item does not mean that the item will be frequently accessed in a short time.
  • the replacement strategies of LRU including pseudo Least Recently Used (pLRU), FIFO, Random, etc. may have the possibility of "squeezing out” the contents of high-traffic entries into the Cache after small-flow entries are written into the Cache. Therefore, only LFU is most suitable for the application scenario of the network processor, but in order to select the item with the lowest frequency of use, sorting is required in most implementations, and the logic implementation is more complicated.
  • the detecting whether there is an available second cache address in the second cache includes: when there is second data with a keep-alive weight of 0 in the second cache, then there is Available second cache address; when there is no second data with a keep-alive weight of 0 in the second cache, there is no available second cache address in the second cache.
  • the large-traffic entries are kept in the cache, which reduces the possibility of replacing the large-traffic entries out of the cache by small-traffic entries, and improves the cache hit rate.
  • the method further includes: if there is no available second cache address, determining the second cache address of the current aging location Whether the keep-alive weight of the data is 0; if the keep-alive weight of the second data at the current aging location is 0, record the current aging location as an available second cache address; if the keep-alive weight of the second data at the current aging location is not If the value is 0, the keep-alive weight of the second data at the current aging position is reduced by 1, and the current aging position is pointed to the next second cache address, and the cycle is executed to determine whether the keep-alive weight of the second data at the current aging position is 0 Until the keep-alive weight of the second data at the current aging position is 0.
  • the embodiment of the application realizes the selection of available cache space through simple aging and keep-alive operations, avoiding complicated sorting or comparison logic.
  • the cache access operation includes two parts: a table lookup operation and an update operation.
  • the steps of the table lookup operation include: after a read data request arrives, after address conversion processing, an address for accessing the first cache is generated; Read the address of the second cache in the corresponding position in the middle, read the data (second data) of the second cache in the second cache according to the address, and compare it with the read data request to determine whether the read data request hits the read According to whether the read data request hits the read second cache data, it is determined whether a read request needs to be sent to the DRAM.
  • the cache update operation is performed.
  • the steps are as follows: calculate the address of the entry in the first cache in the address conversion module; write the available address in the second cache to the first cache A corresponding position calculated in the cache; the data returned by the DRAM response is written into the position corresponding to the available address in the second cache.
  • the read data request hits the second data
  • the corresponding entry in the second cache is kept alive, that is, the keep-alive weight of the second data is incremented by 1;
  • the read data request does not hit the second data, the The process of aging and finding free space is as follows:
  • the embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize Any of the data reading methods described above.
  • An embodiment of the present application also provides a data reading device, including a processor and a memory, and the processor is configured to execute a program stored in the memory to implement the data reading method as described above.
  • an embodiment of the present application also provides a data reading device, including an address conversion module 401, a first cache 402, a second cache 403, and a data search module 404.
  • the address conversion module 401 is configured to receive reading A data request, the read data request carries the target storage address in the target memory; the target storage address is converted to a first cache address; the first cache 402 is set to cache the second cache address; the second cache 403 is set to cache Data in the target memory; the data search module 404 is configured to read the first data corresponding to the first cache address from the first cache 402, the first data includes the second cache address; read from the second cache 403 The second data corresponding to the second cache address is compared with the read data request to determine whether the read data request hits the second data.
  • the entry width W1 of the first cache 402 is smaller than the entry width of the second cache 403 W2, the number of entries K1 of the first cache 402 is greater than the number of entries K2 of the second cache 403, and K1*W1+K2*W2 ⁇ K1*W2, where W1, W2, K1, and K2 are all natural numbers greater than 1; if If it hits, output the second data; if it misses, read the data in the target memory according to the target storage address and output it.
  • the method for the address conversion module 401 to convert the target storage address into the first cache address can use an address conversion method in the related art, which is not limited in this application.
  • the number of Cache entries required is K1, and the required Cache entry width is W2, that is, the total cache space required is K1*W2; when using the indirect mapping method of this application
  • the total buffer space required is K1*W1+K2*W2. Since the entry in the first cache 402 of the present application stores the second cache address, and the entry in the second cache 403 stores data in the target memory, the entry width W1 of the first cache 402 is significantly smaller than the second cache 403 Therefore, by using the indirect mapping method of this application, K1*W1+K2*W2 ⁇ K1*W2 can be easily satisfied, which saves the total storage space of the cache and reduces the overhead of the cache.
  • the data reading device further includes a cache update module 405.
  • the data search module 404 notifies the cache after reading the data in the target memory according to the target storage address.
  • the cache update module 405 is configured to receive a notification from the data search module 404 to detect whether there is a second cache address available in the second cache 403; if there is a second cache address available, it will The read data in the target memory is stored in the available second cache address, and the available second cache address is stored in the first cache address.
  • the cache update module 405 detects whether there is a usable second cache address in the second cache 403, including: when there is a keep-alive weight of 0 in the second cache 403, For the second data, the second cache address is available in the second cache 403; when the second data with a keep-alive weight of 0 does not exist in the second cache 403, the second cache There is no second cache address available in 403.
  • the large-traffic entries are kept in the cache, which reduces the possibility of replacing the large-traffic entries out of the cache by small-traffic entries, and improves the cache hit rate.
  • the Cache update operation is performed only when the Cache has available space, which reduces the possibility of replacing a large-traffic entry with a small-traffic entry from the Cache.
  • the data reading device further includes an aging keep-alive module 406, and the cache update module 405 is further configured to notify if there is no available second cache address
  • the embodiment of the application realizes the selection of available cache space through simple aging and keep-
  • the data search module 404 after the data search module 404 outputs the second data, it is further configured to: notify the aging keep-alive module 406; the aging keep-alive module 406 is further configured to receive the The notification from the data search module 404 increases the keep-alive weight of the second data by 1.
  • a data reading device includes:
  • Address conversion module set to convert the request to the address of the access pointer Ram, and when the DRAM response returns, the same operation is also required to obtain the address of the write-back pointer Ram. For example, it can be implemented by using truncation or cyclic redundancy check (Cyclic Redundancy Check, CRC) calculation.
  • CRC Cyclic Redundancy Check
  • Pointer Ram (that is, the first cache): Set to store the address of the corresponding entry in the Cache ram to achieve indirect access to the Cache Ram.
  • the Ram depth of the pointer is usually an integer multiple of Cache Ram. Under the same Cache depth, the probability of collision can be effectively reduced.
  • Cache Ram that is, the second cache: set to store actual entry data and address information.
  • Data search module It is set to search the corresponding data in the cache (including the pointer Ram and Cache Ram) or DRAM according to the address of the pointer Ram.
  • Aging keep-alive module It is set to record the keep-alive weight corresponding to each entry in the Cache, and it is also set to determine whether keep-alive and aging operations are required according to whether there is an item hit at that time and the available Cache space.
  • Output arbitration module Arbitrate between Cache Ram return (Cache hit) and DRAM return (Cache miss), and select the final result returned to the CPU/PP.
  • the Cache access operation can be divided into two parts, the table lookup operation and the update operation, and the aging operation is performed independently of the table lookup process.
  • the steps of the table lookup operation are:
  • the aging keep-alive module when the Cache hits, the corresponding entry of the Cache is kept alive, that is, the keep-alive weight of the Cache ram address is incremented by 1; when the Cache does not hit, it performs aging and searches for available space. Operation. As shown in Figure 9, the process of the aging operation is as follows:
  • Adopting the data reading method and device and computer-readable storage medium provided by the embodiments of the present application has the following advantages: through indirect mapping, a group-associated cache is realized with lower overhead, and the probability of cache conflict is reduced; Simulates the LFU operation, keeps large traffic entries in the Cache, improves the Cache hit rate, and meets the high bandwidth requirements of the network processor; through simple aging and keep-alive operations, the choice of available Cache space is realized, avoiding complexity The sorting or comparison logic effectively reduces the logic complexity and saves the resource overhead of Cache.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

Disclosed in the present application are a data reading method and apparatus, and a computer-readable storage medium. The method comprises: receiving a read data request carrying a target storage address in a target memory, and converting the target storage address into a first cache address; reading first data corresponding to the first cache address from a first cache, the first data comprising a second cache address; reading second data corresponding to the second cache address from a second cache, comparing the second data with the read data request, and determining whether the read data request hits the second data, wherein the entry width W1 of the first cache is less than the entry width W2 of the second cache, the number of entries K1 of the first cache is greater than the number of entries K2 of the second cache, and K1*W1+K2*W2<K1*W2; in response to a determination result that the read data request hits the second data, outputting the second data; and in response to a determination result that the read data request does not hit the second data, reading data in the target memory according to the target storage address and outputting the read data in the target memory.

Description

数据读取方法和装置、计算机可读存储介质Data reading method and device, computer readable storage medium
本申请要求在2019年07月15日提交中国专利局、申请号为201910637085.7的中国专利申请的优先权,该申请的全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office with an application number of 201910637085.7 on July 15, 2019. The entire content of this application is incorporated into this application by reference.
技术领域Technical field
本申请实施例涉及但不限于网络通信技术领域,例如一种数据读取方法和装置、计算机可读存储介质。The embodiments of the present application relate to, but are not limited to, the field of network communication technology, such as a data reading method and device, and a computer-readable storage medium.
背景技术Background technique
随着网络设备(路由器、交换机等)中表项容量的增加,网络处理器(Network Processor,NP)芯片内部的静态随机存取存储器(Static Random Access Memory,SRAM)无法满足表项的容量需求,大容量动态随机存取存储器(Dynamic Random Access Memory,DRAM),即DRAM等会被用来存储表项信息。但是,DRAM访问时间较长,又无法满足NP的查表带宽需求。因此,NP内部通常要设置小容量高速缓存(Cache)来吸收部分访问DRAM的流量。With the increase of table item capacity in network equipment (routers, switches, etc.), the static random access memory (SRAM) inside the network processor (Network Processor, NP) chip cannot meet the capacity requirements of table items. Large-capacity dynamic random access memory (Dynamic Random Access Memory, DRAM), that is, DRAM, etc. will be used to store table entry information. However, the DRAM access time is relatively long, and it cannot meet the bandwidth requirement of NP for table lookup. Therefore, a small-capacity cache (Cache) is usually set inside the NP to absorb part of the traffic for accessing DRAM.
如图1所示,在网络处理器应用场景中,中央处理器(Central Processing Unit,CPU)或包处理器(Packet Processor,PP)发起查表操作,该操作会先经过Cache管理模块,如果Cache命中,则直接返回查表结果,如果Cache未命中,再向DRAM发送查表请求。As shown in Figure 1, in the network processor application scenario, the central processing unit (CPU) or the packet processor (PP) initiates a table lookup operation. This operation will first go through the Cache management module. If the Cache If it hits, it will directly return the table lookup result. If the Cache misses, then send a table lookup request to the DRAM.
由于DRAM与Cache在容量上存在巨大差异,DRAM中的数据不可能全部写入Cache,因此必然存在DRAM中多个条目映射到Cache中同一地址的情况。映射方法包括:Due to the huge difference in capacity between DRAM and Cache, it is impossible for all data in DRAM to be written into Cache, so there must be a situation where multiple entries in DRAM are mapped to the same address in Cache. The mapping methods include:
(1)直接映射:如图2a所示,DRAM中的每个条目在Cache中的位置是唯一的;(1) Direct mapping: As shown in Figure 2a, the position of each entry in the DRAM in the Cache is unique;
(2)全相联映射:如图2b所示,DRAM中的每个条目可以映射到Cache中任意一个位置上;(2) Fully associative mapping: As shown in Figure 2b, each entry in the DRAM can be mapped to any location in the Cache;
(3)组相联映射:如图2c所示,介于全相联映射和直接映射之间,DRAM中的每个条目可以映射到Cache一部分位置。(3) Group associative mapping: As shown in Figure 2c, between full associative mapping and direct mapping, each entry in the DRAM can be mapped to a part of the Cache.
直接映射中,由于DRAM条目在Cache中位置是唯一确定的,一般不需要替换算法,但是存在多个常用DRAM数据映射到Cache同一地址的情况,当出现该情况时会有频繁的Cache替换操作,导致Cache性能下降。In direct mapping, because the location of the DRAM entry in the Cache is uniquely determined, there is generally no need to replace the algorithm, but there are situations where multiple commonly used DRAM data is mapped to the same address in the Cache. When this occurs, there will be frequent Cache replacement operations. Causes the Cache performance to degrade.
全相联和组相联映射中,由于DRAM中的每个条目可以映射到Cache中多个位置,降低了频繁替换的可能。全相联Cache往往能得到最好的性能,但是,它需要对Cache内所有条目都进行比对,实现复杂度过高。因此,普遍采用的是组相联Cache,通常实现中会将DRAM的地址范围分成K组,每组可映射到Cache中的n个条目,由于组之间的Cache空间不可共享,因此,需要的Cache的深度(即条目数量)为K*n。In full associative and group associative mapping, since each entry in the DRAM can be mapped to multiple locations in the Cache, the possibility of frequent replacement is reduced. Fully associative Cache can often get the best performance, but it needs to compare all items in the Cache, which is too complex to implement. Therefore, group-associated Cache is commonly used. Usually, the address range of DRAM is divided into K groups in implementation, and each group can be mapped to n entries in the Cache. Because the Cache space between groups cannot be shared, the required The depth of the Cache (that is, the number of entries) is K*n.
对于如何节约缓存的存储空间、降低缓存的开销的研究甚少。多数研究只关注了替换策略对Cache性能的影响,而且多数应用仍基于“局部性”原理(即如果一个存储单元正在被访问,那么在近期它很可能还会被再次访问),并不符合网络处理器的流量特征。另有一些方案中使用多级Cache以及混合替换策略等,无法满足网络处理器高带宽的需求。There is very little research on how to save the storage space of the cache and reduce the overhead of the cache. Most studies only focus on the impact of replacement strategies on Cache performance, and most applications are still based on the principle of "locality" (that is, if a storage unit is being accessed, it is likely to be accessed again in the near future), which does not conform to the network The flow characteristics of the processor. Other solutions use multi-level Cache and hybrid replacement strategies, which cannot meet the high bandwidth requirements of network processors.
发明内容Summary of the invention
本申请实施例提供了一种数据读取方法和装置、计算机可读存储介质,能够节约缓存的总存储空间,降低缓存的开销。The embodiments of the present application provide a data reading method and device, and a computer-readable storage medium, which can save the total storage space of the cache and reduce the overhead of the cache.
本申请实施例提供了一种数据读取方法,包括:The embodiment of the application provides a data reading method, including:
接收读数据请求,所述读数据请求携带目标存储器中的目标存储地址;将目标存储地址转换为第一缓存地址;Receiving a read data request, where the read data request carries a target storage address in the target memory; converting the target storage address into a first cache address;
从第一缓存中读取对应所述第一缓存地址的第一数据,所述第一数据包括第二缓存地址;Reading first data corresponding to the first cache address from the first cache, where the first data includes a second cache address;
从第二缓存中读取对应所述第二缓存地址的第二数据,将第二数据与读数据请求进行比对,判断所述读数据请求是否命中所述第二数据,其中,所述第一缓存的条目宽度W1小于所述第二缓存的条目宽度W2,所述第一缓存的条目数量K1大于所述第二缓存的条目数量K2,且K1*W1+K2*W2<K1*W2,其中,W1、W2、K1、K2均为大于1的自然数;Read the second data corresponding to the second cache address from the second cache, compare the second data with the read data request, and determine whether the read data request hits the second data, wherein the first The entry width W1 of a cache is smaller than the entry width W2 of the second cache, the number of entries K1 of the first cache is greater than the number of entries K2 of the second cache, and K1*W1+K2*W2<K1*W2, Among them, W1, W2, K1, K2 are all natural numbers greater than 1;
响应于所述读数据请求命中所述第二数据的判断结果,输出第二数据;响 应于所述读数据请求未命中所述第二数据的判断结果,根据目标存储地址读取目标存储器中的数据并输出读取的所述目标存储器中的数据。In response to the judgment result that the read data request hits the second data, the second data is output; in response to the judgment result that the read data request misses the second data, the target memory is read according to the target storage address. Data and output the read data in the target memory.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如以上任一项所述的数据读取方法。The embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize The data reading method described in any of the above.
本申请实施例还提供了一种数据读取装置,包括处理器及存储器,其中:所述处理器设置为执行存储器中存储的程序,以实现如以上任一项所述的数据读取方法。An embodiment of the present application also provides a data reading device, including a processor and a memory, wherein the processor is configured to execute a program stored in the memory to implement the data reading method described in any one of the above.
本申请实施例还提供了一种数据读取装置,包括地址转换模块、第一缓存、第二缓存和数据查找模块,其中:The embodiment of the present application also provides a data reading device, including an address conversion module, a first cache, a second cache, and a data search module, wherein:
地址转换模块,设置为接收读数据请求,所述读数据请求中携带目标存储器中的目标存储地址;将目标存储地址转换为第一缓存地址;An address conversion module, configured to receive a read data request, where the read data request carries a target storage address in the target memory; convert the target storage address into a first cache address;
第一缓存,设置为缓存第二缓存地址;The first cache is set to cache the second cache address;
第二缓存,设置为缓存目标存储器中的数据;The second cache is set to cache data in the target memory;
数据查找模块,设置为从第一缓存中读取对应所述第一缓存地址的第一数据,所述第一数据包括第二缓存地址;从第二缓存中读取对应所述第二缓存地址的第二数据,将第二数据与读数据请求进行比对,判断所述读数据请求是否命中所述第二数据,其中,所述第一缓存的条目宽度W1小于所述第二缓存的条目宽度W2,所述第一缓存的条目数量K1大于所述第二缓存的条目数量K2,且K1*W1+K2*W2<K1*W2,其中,W1、W2、K1、K2均为大于1的自然数;响应于所述读数据请求命中所述第二数据的判断结果,输出第二数据;响应于所述读数据请求未命中所述第二数据的判断结果,根据目标存储地址读取目标存储器中的数据并输出读取的所述目标存储器中的数据。A data search module, configured to read first data corresponding to the first cache address from a first cache, the first data including a second cache address; read from the second cache corresponding to the second cache address Compare the second data with the read data request to determine whether the read data request hits the second data, wherein the entry width W1 of the first cache is smaller than the entry of the second cache Width W2, the number of entries K1 in the first cache is greater than the number K2 of entries in the second cache, and K1*W1+K2*W2<K1*W2, where W1, W2, K1, and K2 are all greater than 1. Natural number; in response to the judgment result that the read data request hits the second data, output second data; in response to the judgment result that the read data request misses the second data, read the target memory according to the target storage address And output the read data in the target memory.
附图说明Description of the drawings
附图用来提供对本申请技术方案的理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本申请的技术方案,并不构成对本申请技术方案的限制。The accompanying drawings are used to provide an understanding of the technical solution of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the technical solution of the present application, and do not constitute a limitation to the technical solution of the present application.
图1为相关技术中网络处理器访问DRAM的数据流向示意图;Figure 1 is a schematic diagram of the data flow of a network processor accessing DRAM in related technologies;
图2a为相关技术中缓存与DRAM之间采用直接映射方式原理示意图;Figure 2a is a schematic diagram of the principle of direct mapping between cache and DRAM in related technologies;
图2b为相关技术中缓存与DRAM之间采用全相联映射方式原理示意图;Figure 2b is a schematic diagram of the principle of a fully associative mapping method between cache and DRAM in related technologies;
图2c为相关技术中缓存与DRAM之间采用组相联映射方式原理示意图;Figure 2c is a schematic diagram of the principle of the group associative mapping method between the cache and the DRAM in the related technology;
图3是本申请实施例的数据读取方法的第一种示例性流程示意图;FIG. 3 is a first exemplary flowchart of a data reading method according to an embodiment of the present application;
图4为本申请实施例的数据读取装置的第一种示例性结构示意图;4 is a schematic diagram of a first exemplary structure of a data reading device according to an embodiment of the application;
图5为本申请实施例的数据读取装置的第二种示例性结构示意图;5 is a schematic diagram of a second exemplary structure of a data reading device according to an embodiment of the application;
图6为本申请实施例的数据读取装置的第三种示例性结构示意图;6 is a schematic diagram of a third exemplary structure of a data reading device according to an embodiment of the application;
图7为本申请实施例的数据读取装置的第四种示例性结构示意图;7 is a schematic diagram of a fourth exemplary structure of a data reading device according to an embodiment of the application;
图8为本申请实施例的一种缓存查找及缓存更新过程示意图;FIG. 8 is a schematic diagram of a cache lookup and cache update process according to an embodiment of the application;
图9为本申请实施例的一种老化及保活过程示意图。FIG. 9 is a schematic diagram of an aging and keep-alive process according to an embodiment of the application.
具体实施方式Detailed ways
下文中将结合附图对本申请的实施例进行说明。Hereinafter, the embodiments of the present application will be described with reference to the drawings.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在一些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。The steps shown in the flowchart of the drawings may be executed in a computer system such as a set of computer-executable instructions. Also, although a logical sequence is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than here.
如图3所示,本申请实施例提供了一种数据读取方法,包括:As shown in FIG. 3, an embodiment of the present application provides a data reading method, including:
步骤310:接收读数据请求,所述读数据请求携带目标存储器中的目标存储地址;将目标存储地址转换为第一缓存地址。Step 310: Receive a read data request, where the read data request carries a target storage address in the target memory; convert the target storage address into a first cache address.
将目标存储地址转换为第一缓存地址的方法可以使用相关技术中的地址转换方法,本申请对此并不做限制。The method of converting the target storage address into the first cache address can use the address conversion method in the related art, which is not limited in this application.
步骤320:从第一缓存中读取对应第一缓存地址的第一数据,所述第一数据包括第二缓存地址。Step 320: Read the first data corresponding to the first cache address from the first cache, where the first data includes the second cache address.
在一种示例性实施例中,所述第一缓存与所述目标存储器之间的映射方式为组相联映射,将所述目标存储器的地址范围分为K组,每组可间接映射到所述第一缓存中的n个条目,即第一缓存的条目数量K1=K*n,K、n均为大于1 的自然数。In an exemplary embodiment, the mapping method between the first cache and the target memory is group associative mapping, and the address range of the target memory is divided into K groups, and each group can be indirectly mapped to all groups. There are n entries in the first cache, that is, the number of entries in the first cache K1=K*n, and both K and n are natural numbers greater than 1.
步骤330:从第二缓存中读取对应第二缓存地址的第二数据,将第二数据与读数据请求进行比对,判断读数据请求是否命中第二数据,其中,第一缓存的条目宽度W1小于第二缓存的条目宽度W2,第一缓存的条目数量K1大于第二缓存的条目数量K2,且K1*W1+K2*W2<K1*W2,W1、W2、K1、K2均为大于1的自然数,*为乘号。Step 330: Read the second data corresponding to the second cache address from the second cache, compare the second data with the read data request, and determine whether the read data request hits the second data, where the entry width of the first cache W1 is smaller than the entry width W2 of the second cache, the number of entries in the first cache K1 is greater than the number of entries in the second cache K2, and K1*W1+K2*W2<K1*W2, W1, W2, K1, and K2 are all greater than 1. The natural number, * is the multiplication sign.
当使用相关技术中的组相联映射方式时,需要的Cache的条目数量为K1,需要的Cache的条目宽度为W2,即需要的总缓存空间为K1*W2;当使用本申请的间接映射方式时,需要的总缓存空间为K1*W1+K2*W2。由于本申请的第一缓存中的条目存储的是第二缓存地址,第二缓存中的条目存储的是目标存储器中的数据,第一缓存的条目宽度W1明显地小于第二缓存的条目宽度W2,因此,通过使用本申请的间接映射方式,可以轻松满足K1*W1+K2*W2<K1*W2,节约了缓存的总存储空间,降低了缓存的开销。When using the group associative mapping method in the related technology, the number of Cache entries required is K1, and the required Cache entry width is W2, that is, the total cache space required is K1*W2; when using the indirect mapping method of this application When, the total buffer space required is K1*W1+K2*W2. Since the entry in the first cache of the present application stores the second cache address, and the entry in the second cache stores data in the target memory, the entry width W1 of the first cache is significantly smaller than the entry width W2 of the second cache Therefore, by using the indirect mapping method of this application, K1*W1+K2*W2<K1*W2 can be easily satisfied, which saves the total storage space of the cache and reduces the overhead of the cache.
在一种示例性实施例中,所述第二缓存的条目数量K2=K。In an exemplary embodiment, the number of entries in the second cache is K2=K.
步骤340:如果读数据请求命中第二数据,输出第二数据。Step 340: If the read data request hits the second data, output the second data.
在一种示例性实施例中,在所述输出第二数据之后,所述方法还包括:将所述第二数据的保活权重增1。In an exemplary embodiment, after the output of the second data, the method further includes: increasing the keep-alive weight of the second data by 1.
步骤350:如果读数据请求未命中第二数据,根据目标存储地址读取目标存储器中的数据并输出。Step 350: If the read data request misses the second data, read and output the data in the target memory according to the target memory address.
与相关技术相比,本申请实施例提供的数据读取方法,通过设置两个缓存:第一缓存和第二缓存,间接映射读取目标存储器中的数据,由于第一缓存中的条目存储的是第二缓存地址,第二缓存中的条目存储的是目标存储器中的数据,第一缓存的条目宽度明显地小于第二缓存的条目宽度,通过设置:K1*W1+K2*W2<K1*W2,有效地节约了缓存的总存储空间,降低了缓存的开销,且与使用一个缓存(条目数量为K2,条目宽度为W2)直接映射相比,只增加了少量的存储空间(由于W1远小于W2,K1*W1也远小于K2*W2),但是有效地提高了Cache的命中率,满足了网络处理器高带宽的需求。Compared with the related technology, the data reading method provided by the embodiment of the present application sets two caches: the first cache and the second cache, and indirectly maps and reads the data in the target memory. Because the entries in the first cache are stored Is the second cache address, the entry in the second cache stores the data in the target memory, the entry width of the first cache is obviously smaller than the entry width of the second cache, by setting: K1*W1+K2*W2<K1* W2 effectively saves the total storage space of the cache, reduces the overhead of the cache, and compared with the direct mapping using a cache (the number of entries is K2, the entry width is W2), only a small amount of storage space is added (because W1 is far away). Less than W2, K1*W1 is also much smaller than K2*W2), but it effectively improves the hit rate of the Cache and meets the high bandwidth requirements of the network processor.
在一种示例性实施例中,在所述根据目标存储地址读取目标存储器中的数据之后,还包括:检测第二缓存中是否有可用的第二缓存地址;如果第二缓存 中有可用的第二缓存地址,将读取到的目标存储器中的数据存储至所述可用的第二缓存地址,并将所述可用的第二缓存地址存储至所述第一缓存地址。In an exemplary embodiment, after the reading of the data in the target memory according to the target storage address, the method further includes: detecting whether there is a usable second cache address in the second cache; if there is a usable second cache address in the second cache, The second cache address stores the read data in the target memory to the available second cache address, and stores the available second cache address to the first cache address.
相关技术中的Cache方案中,只要DRAM有数据返回时,就会更新Cache,并发生替换操作。常见的替换策略包括:In the Cache solution in the related technology, as long as the DRAM has data returned, the Cache is updated and a replacement operation occurs. Common replacement strategies include:
(1)最近最少使用(Least Recently Used,LRU):替换最不常用的条目。该方法通常需要通过复杂的双向链表实现,每次访问后,将访问的条目从链表中取出,并插入链表头部,逻辑实现较为复杂。(1) Least Recently Used (LRU): Replace the least frequently used items. This method usually needs to be implemented through a complex doubly linked list. After each visit, the accessed entry is taken out of the linked list and inserted into the head of the linked list, and the logic implementation is more complicated.
(2)先进先出(First Input First Output,FIFO):替换最早进入Cache的条目,该方法逻辑实现简单,但是并不一定适合实际的业务模型。(2) First Input First Output (FIFO): Replace the earliest entry into the Cache. The logic of this method is simple to implement, but it is not necessarily suitable for the actual business model.
(3)随机(Random):随机选择一个进行替换,即完全不考虑Cache中条目的历史使用情况。(3) Random: randomly select one for replacement, that is, completely ignore the historical usage of items in the Cache.
(4)最不经常使用(Least Frequently Used,LFU):记录每个条目最近的使用频率,发生替换时,选择使用频率最低的。(4) Least Frequently Used (LFU): Record the most recently used frequency of each item, and select the least frequently used item when replacement occurs.
但是,在网络处理器,小带宽流量不更新Cache时性能往往更好。因此本申请实施例中,只有在Cache有可用空间的情况下,才会进行Cache更新操作,降低了小流量条目将大流量条目替换出Cache的可能。However, in the network processor, the performance is often better when the Cache is not updated for small bandwidth traffic. Therefore, in the embodiment of the present application, the Cache update operation is performed only when the Cache has available space, which reduces the possibility of replacing a large-traffic entry with a small-traffic entry from the Cache.
与普通处理器不同,网络处理器访问DRAM的流量不具备“局部性”的特征,即访问一条目并不代表着该条目会在短时间内被频繁访问。而LRU包括伪最近最少使用(Pseudo Least Recently Used,pLRU)、FIFO、Random等替换策略会存在小流量表项写入Cache后,将大流量表项内容“挤出”Cache的可能。因此只有LFU最适合网络处理器的应用场景,但是为了选择使用频率最低的条目,大部分实现中都需要排序,逻辑实现较为复杂。Unlike ordinary processors, the flow of network processors accessing DRAM does not have the feature of "locality", that is, accessing an item does not mean that the item will be frequently accessed in a short time. The replacement strategies of LRU including pseudo Least Recently Used (pLRU), FIFO, Random, etc. may have the possibility of "squeezing out" the contents of high-traffic entries into the Cache after small-flow entries are written into the Cache. Therefore, only LFU is most suitable for the application scenario of the network processor, but in order to select the item with the lowest frequency of use, sorting is required in most implementations, and the logic implementation is more complicated.
在一种示例性实施例中,所述检测第二缓存中是否有可用的第二缓存地址,包括:当第二缓存中存在保活权重为0的第二数据时,则第二缓存中有可用的第二缓存地址;当第二缓存中不存在保活权重为0的第二数据时,第二缓存中没有可用的第二缓存地址。In an exemplary embodiment, the detecting whether there is an available second cache address in the second cache includes: when there is second data with a keep-alive weight of 0 in the second cache, then there is Available second cache address; when there is no second data with a keep-alive weight of 0 in the second cache, there is no available second cache address in the second cache.
本申请实施例通过设置保活权重,模拟LFU操作,将大流量条目保留在了缓存中,降低了小流量条目将大流量条目替换出缓存的可能,提高了缓存命中率。In the embodiment of the present application, by setting the keep-alive weight and simulating the LFU operation, the large-traffic entries are kept in the cache, which reduces the possibility of replacing the large-traffic entries out of the cache by small-traffic entries, and improves the cache hit rate.
在一种示例性实施例中,在所述检测第二缓存中是否有可用的第二缓存地址之后,所述方法还包括:如果没有可用的第二缓存地址,则判断当前老化位置的第二数据的保活权重是否为0;如果当前老化位置的第二数据的保活权重为0,则记录当前老化位置为可用的第二缓存地址;如果当前老化位置的第二数据的保活权重不为0,则将当前老化位置的第二数据的保活权重减1,并将当前老化位置指向下一个第二缓存地址,并循环执行判断当前老化位置的第二数据的保活权重是否为0的步骤,直至出现当前老化位置的第二数据的保活权重为0为止。In an exemplary embodiment, after detecting whether there is a second cache address available in the second cache, the method further includes: if there is no available second cache address, determining the second cache address of the current aging location Whether the keep-alive weight of the data is 0; if the keep-alive weight of the second data at the current aging location is 0, record the current aging location as an available second cache address; if the keep-alive weight of the second data at the current aging location is not If the value is 0, the keep-alive weight of the second data at the current aging position is reduced by 1, and the current aging position is pointed to the next second cache address, and the cycle is executed to determine whether the keep-alive weight of the second data at the current aging position is 0 Until the keep-alive weight of the second data at the current aging position is 0.
本申请实施例通过简单的老化和保活操作,实现可用缓存空间的选择,避免了复杂的排序或比较逻辑。The embodiment of the application realizes the selection of available cache space through simple aging and keep-alive operations, avoiding complicated sorting or comparison logic.
本申请实施例中,缓存访问操作包括查表操作和更新操作两部分,查表操作的步骤包括:读数据请求到达后,经地址转换处理后,生成访问第一缓存的地址;从第一缓存中对应位置读取访问第二缓存的地址,根据该地址在第二缓存中读取第二缓存的数据(第二数据),并与读数据请求进行比对,判断读数据请求是否命中读取的第二缓存的数据;根据读数据请求是否命中读取的第二缓存的数据,判断是否需要向DRAM发送读请求。当读数据请求命中读取的第二缓存的数据时,不需要向DRAM发送读请求,直接向CPU/PP返回读取的第二缓存中的数据即可,并对第二缓存中相应条目进行保活操作(即将读取的第二缓存的数据的保活权重自增1);当读数据请求不命中读取的第二缓存的数据时,需要向DRAM发送读请求,并将DRAM响应的结果返回给CPU/PP,DRAM响应返回后,如果第二缓存有可用地址,则进行缓存更新操作,如果第二缓存中没有可用地址,则仅返回查表结果不进行缓存更新。In the embodiment of the present application, the cache access operation includes two parts: a table lookup operation and an update operation. The steps of the table lookup operation include: after a read data request arrives, after address conversion processing, an address for accessing the first cache is generated; Read the address of the second cache in the corresponding position in the middle, read the data (second data) of the second cache in the second cache according to the address, and compare it with the read data request to determine whether the read data request hits the read According to whether the read data request hits the read second cache data, it is determined whether a read request needs to be sent to the DRAM. When the read data request hits the read data in the second cache, there is no need to send a read request to the DRAM, just return the read data in the second cache directly to the CPU/PP, and perform the corresponding entry in the second cache. Keep-alive operation (the keep-alive weight of the data in the second cache that is about to be read increases by 1); when the read data request does not hit the read second cache data, a read request needs to be sent to the DRAM, and the DRAM responds The result is returned to the CPU/PP. After the DRAM response is returned, if the second cache has an available address, the cache update operation is performed, and if there is no available address in the second cache, only the table lookup result is returned without cache update.
当DRAM响应返回时,如果第二缓存有可用地址,则进行缓存更新操作,步骤如下:在地址转换模块中计算该条目在第一缓存中的地址;将第二缓存中的可用地址写入第一缓存中计算出的相应位置;将DRAM响应返回的数据写入第二缓存中的可用地址对应的位置。When the DRAM response returns, if the second cache has an available address, the cache update operation is performed. The steps are as follows: calculate the address of the entry in the first cache in the address conversion module; write the available address in the second cache to the first cache A corresponding position calculated in the cache; the data returned by the DRAM response is written into the position corresponding to the available address in the second cache.
为了简化实现,当读数据请求命中第二数据时,对第二缓存中相应条目进行保活操作,即将第二数据的保活权重自增1;当读数据请求不命中第二数据时,进行老化和查找可用空间的操作,过程如下:In order to simplify the implementation, when the read data request hits the second data, the corresponding entry in the second cache is kept alive, that is, the keep-alive weight of the second data is incremented by 1; when the read data request does not hit the second data, the The process of aging and finding free space is as follows:
判断当前第二缓存是否有可用地址,如果有可用地址,则老化过程结束;如果当前第二缓存没有可用地址,则判断当前老化位置指向的第二数据的保活权重是否为0,如果当前老化位置指向的第二数据的保活权重为0,则设置当前老化位置的第二缓存地址为可用地址,老化过程结束,该地址可用于后续的缓存更新;如果当前老化位置指向的第二数据的保活权重不为0,将当前老化位置的第二数据的保活权重自减1,并将当前老化位置指向第二缓存中的下一地址,并循环执行判断当前老化位置指向的第二数据的保活权重是否为0的操作,直到出现当前老化位置指向的第二数据的保活权重为0为止。Determine whether the current second cache has an available address. If there is an available address, the aging process ends; if the current second cache does not have an available address, then determine whether the keep-alive weight of the second data pointed to by the current aging location is 0, if the current aging The keep-alive weight of the second data pointed to by the location is 0, then the second cache address of the current aging location is set as an available address, and the aging process ends, and the address can be used for subsequent cache updates; if the current aging location points to the second data If the keep-alive weight is not 0, the keep-alive weight of the second data at the current aging position is decremented by 1, and the current aging position is pointed to the next address in the second cache, and the second data pointed to by the current aging position is determined circularly The operation of whether the keep-alive weight of is 0 until the keep-alive weight of the second data pointed to by the current aging position is 0 occurs.
本申请实施例还提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或者多个程序,所述一个或者多个程序可被一个或者多个处理器执行,以实现如以上任一所述的数据读取方法。The embodiments of the present application also provide a computer-readable storage medium, the computer-readable storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize Any of the data reading methods described above.
本申请实施例还提供了一种数据读取装置,包括处理器及存储器,所述处理器设置为执行存储器中存储的程序,以实现如以上任一所述的数据读取方法。An embodiment of the present application also provides a data reading device, including a processor and a memory, and the processor is configured to execute a program stored in the memory to implement the data reading method as described above.
如图4所示,本申请实施例还提供了一种数据读取装置,包括地址转换模块401、第一缓存402、第二缓存403和数据查找模块404,地址转换模块401,设置为接收读数据请求,所述读数据请求中携带目标存储器中的目标存储地址;将目标存储地址转换为第一缓存地址;第一缓存402,设置为缓存第二缓存地址;第二缓存403,设置为缓存目标存储器中的数据;数据查找模块404,设置为从第一缓存402中读取对应第一缓存地址的第一数据,所述第一数据包括第二缓存地址;从第二缓存403中读取对应第二缓存地址的第二数据,将第二数据与读数据请求进行比对,判断读数据请求是否命中第二数据,其中,第一缓存402的条目宽度W1小于第二缓存403的条目宽度W2,第一缓存402的条目数量K1大于第二缓存403的条目数量K2,且K1*W1+K2*W2<K1*W2,其中,W1、W2、K1、K2均为大于1的自然数;如果命中,输出第二数据;如果未命中,根据目标存储地址读取目标存储器中的数据并输出。As shown in FIG. 4, an embodiment of the present application also provides a data reading device, including an address conversion module 401, a first cache 402, a second cache 403, and a data search module 404. The address conversion module 401 is configured to receive reading A data request, the read data request carries the target storage address in the target memory; the target storage address is converted to a first cache address; the first cache 402 is set to cache the second cache address; the second cache 403 is set to cache Data in the target memory; the data search module 404 is configured to read the first data corresponding to the first cache address from the first cache 402, the first data includes the second cache address; read from the second cache 403 The second data corresponding to the second cache address is compared with the read data request to determine whether the read data request hits the second data. The entry width W1 of the first cache 402 is smaller than the entry width of the second cache 403 W2, the number of entries K1 of the first cache 402 is greater than the number of entries K2 of the second cache 403, and K1*W1+K2*W2<K1*W2, where W1, W2, K1, and K2 are all natural numbers greater than 1; if If it hits, output the second data; if it misses, read the data in the target memory according to the target storage address and output it.
地址转换模块401将目标存储地址转换为第一缓存地址的方法可以使用相关技术中的地址转换方法,本申请对此并不做限制。The method for the address conversion module 401 to convert the target storage address into the first cache address can use an address conversion method in the related art, which is not limited in this application.
在一种示例性实施例中,所述第一缓存402与所述目标存储器之间的映射方式为组相联映射,将所述目标存储器的地址范围分为K组,每组可间接映射 到所述第一缓存402中的n个条目,第一缓存402的条目数量K1=K*n,其中,K、n均为大于1的自然数。In an exemplary embodiment, the mapping method between the first cache 402 and the target memory is group associative mapping, and the address range of the target memory is divided into K groups, and each group can be indirectly mapped to For the n entries in the first cache 402, the number of entries in the first cache 402 is K1=K*n, where K and n are both natural numbers greater than 1.
当使用相关技术中的组相联映射方式时,需要的Cache的条目数量为K1,需要的Cache的条目宽度为W2,即需要的总缓存空间为K1*W2;当使用本申请的间接映射方式时,需要的总缓存空间为K1*W1+K2*W2。由于本申请的第一缓存402中的条目存储的是第二缓存地址,第二缓存403中的条目存储的是目标存储器中的数据,第一缓存402的条目宽度W1明显地小于第二缓存403的条目宽度W2,因此,通过使用本申请的间接映射方式,可以轻松满足K1*W1+K2*W2<K1*W2,节约了缓存的总存储空间,降低了缓存的开销。When using the group associative mapping method in the related technology, the number of Cache entries required is K1, and the required Cache entry width is W2, that is, the total cache space required is K1*W2; when using the indirect mapping method of this application When, the total buffer space required is K1*W1+K2*W2. Since the entry in the first cache 402 of the present application stores the second cache address, and the entry in the second cache 403 stores data in the target memory, the entry width W1 of the first cache 402 is significantly smaller than the second cache 403 Therefore, by using the indirect mapping method of this application, K1*W1+K2*W2<K1*W2 can be easily satisfied, which saves the total storage space of the cache and reduces the overhead of the cache.
在一种示例性实施例中,所述第二缓存403的条目数量K2=K。In an exemplary embodiment, the number of entries in the second cache 403 is K2=K.
在一种示例性实施例中,如图5所示,所述数据读取装置还包括缓存更新模块405,所述数据查找模块404在根据目标存储地址读取目标存储器中的数据之后,通知缓存更新模块405;所述缓存更新模块405,设置为接收到所述数据查找模块404的通知,检测第二缓存403中是否有可用的第二缓存地址;如果有可用的第二缓存地址,则将读取到的目标存储器中的数据存储至所述可用的第二缓存地址,并将所述可用的第二缓存地址存储至所述第一缓存地址。In an exemplary embodiment, as shown in FIG. 5, the data reading device further includes a cache update module 405. The data search module 404 notifies the cache after reading the data in the target memory according to the target storage address. Update module 405; The cache update module 405 is configured to receive a notification from the data search module 404 to detect whether there is a second cache address available in the second cache 403; if there is a second cache address available, it will The read data in the target memory is stored in the available second cache address, and the available second cache address is stored in the first cache address.
在一种示例性实施例中,所述缓存更新模块405检测所述第二缓存403中是否有可用的第二缓存地址,包括:当所述第二缓存403中存在保活权重为0的所述第二数据时,则所述第二缓存403中有可用的第二缓存地址;当所述第二缓存403中不存在保活权重为0的所述第二数据时,所述第二缓存403中没有可用的第二缓存地址。In an exemplary embodiment, the cache update module 405 detects whether there is a usable second cache address in the second cache 403, including: when there is a keep-alive weight of 0 in the second cache 403, For the second data, the second cache address is available in the second cache 403; when the second data with a keep-alive weight of 0 does not exist in the second cache 403, the second cache There is no second cache address available in 403.
本申请实施例通过设置保活权重,模拟LFU操作,将大流量条目保留在了缓存中,降低了小流量条目将大流量条目替换出缓存的可能,提高了缓存命中率。In the embodiment of the present application, by setting the keep-alive weight and simulating the LFU operation, the large-traffic entries are kept in the cache, which reduces the possibility of replacing the large-traffic entries out of the cache by small-traffic entries, and improves the cache hit rate.
相关技术中的Cache方案中,只要DRAM有数据返回时,就会更新Cache,并发生替换操作。但是在网络处理器,小带宽流量不更新Cache时性能往往更好。因此本申请实施例中,只有在Cache有可用空间的情况下,才会进行Cache更新操作,降低了小流量条目将大流量条目替换出Cache的可能。In the Cache solution in the related technology, as long as the DRAM has data returned, the Cache is updated and a replacement operation occurs. But in the network processor, the performance is often better when the Cache is not updated for small bandwidth traffic. Therefore, in the embodiment of the present application, the Cache update operation is performed only when the Cache has available space, which reduces the possibility of replacing a large-traffic entry with a small-traffic entry from the Cache.
在一种示例性实施例中,如图6所示,所述数据读取装置还包括老化保活 模块406,所述缓存更新模块405还设置为:如果没有可用的第二缓存地址,则通知老化保活模块406;所述老化保活模块406,设置为接收到所述缓存更新模块405的通知,判断当前老化位置的第二数据的保活权重是否为0;如果为0,则记录当前老化位置为可用的第二缓存地址;如果当前老化位置的第二数据的保活权重不为0,将当前老化位置的第二数据的保活权重减1,并将当前老化位置指向下一个第二缓存地址,并循环执行判断当前老化位置的第二数据的保活权重是否为0的步骤,直至出现当前老化位置的第二数据的保活权重为0。本申请实施例通过简单的老化和保活操作,实现可用缓存空间的选择,避免了复杂的排序或比较逻辑。In an exemplary embodiment, as shown in FIG. 6, the data reading device further includes an aging keep-alive module 406, and the cache update module 405 is further configured to notify if there is no available second cache address The aging keep-alive module 406; the aging keep-alive module 406 is configured to receive the notification from the cache update module 405 to determine whether the keep-alive weight of the second data at the current aging position is 0; if it is 0, record the current The aging position is the available second cache address; if the keep-alive weight of the second data at the current aging position is not 0, the keep-alive weight of the second data at the current aging position is reduced by 1, and the current aging position is pointed to the next first Second, cache the address, and cyclically execute the step of judging whether the keep-alive weight of the second data at the current aging position is 0, until the keep-alive weight of the second data at the current aging position is 0 appears. The embodiment of the application realizes the selection of available cache space through simple aging and keep-alive operations, avoiding complicated sorting or comparison logic.
在一种示例性实施例中,所述数据查找模块404在输出第二数据之后,还设置为:通知所述老化保活模块406;所述老化保活模块406还设置为,接收到所述数据查找模块404的通知,将所述第二数据的保活权重增1。In an exemplary embodiment, after the data search module 404 outputs the second data, it is further configured to: notify the aging keep-alive module 406; the aging keep-alive module 406 is further configured to receive the The notification from the data search module 404 increases the keep-alive weight of the second data by 1.
在另一种示例性实施例中,如图7所示,根据本申请实施例的一种数据读取装置,包括:In another exemplary embodiment, as shown in FIG. 7, a data reading device according to an embodiment of the present application includes:
(1)地址转换模块:设置为将请求转换为访问指针Ram的地址,同时当DRAM响应返回时,也需要相同的操作获得回写指针Ram的地址。例如,可以通过使用截位或循环冗余校验(Cyclic Redundancy Check,CRC)计算实现。(1) Address conversion module: set to convert the request to the address of the access pointer Ram, and when the DRAM response returns, the same operation is also required to obtain the address of the write-back pointer Ram. For example, it can be implemented by using truncation or cyclic redundancy check (Cyclic Redundancy Check, CRC) calculation.
(2)指针Ram(即第一缓存):设置为存储对应条目在Cache ram中的地址,实现对Cache Ram的间接访问。该指针Ram深度通常为Cache Ram的整数倍,在相同Cache深度下,可以有效降低冲突的概率。(2) Pointer Ram (that is, the first cache): Set to store the address of the corresponding entry in the Cache ram to achieve indirect access to the Cache Ram. The Ram depth of the pointer is usually an integer multiple of Cache Ram. Under the same Cache depth, the probability of collision can be effectively reduced.
(3)Cache Ram(即第二缓存):设置为存储实际的条目数据和地址信息。(3) Cache Ram (that is, the second cache): set to store actual entry data and address information.
(4)数据查找模块:设置为根据指针Ram的地址在缓存(包括指针Ram和Cache Ram)或DRAM中查找相应的数据。(4) Data search module: It is set to search the corresponding data in the cache (including the pointer Ram and Cache Ram) or DRAM according to the address of the pointer Ram.
(5)老化保活模块:设置为记录Cache中每个条目对应的保活权重,还设置为根据当时是否有条目命中和可用Cache空间判断是否需要进行保活和老化操作。(5) Aging keep-alive module: It is set to record the keep-alive weight corresponding to each entry in the Cache, and it is also set to determine whether keep-alive and aging operations are required according to whether there is an item hit at that time and the available Cache space.
(6)Cache更新模块:当DRAM响应返回时,如果老化保活模块返回有可用Cache空间,则进行Cache更新操作。(6) Cache update module: When the DRAM response is returned, if the aging keep-alive module returns available Cache space, the Cache update operation is performed.
(7)输出仲裁模块:在Cache Ram返回(Cache命中)和DRAM返回(Cache 不命中)之间仲裁,选择最终返回给CPU/PP的结果。(7) Output arbitration module: Arbitrate between Cache Ram return (Cache hit) and DRAM return (Cache miss), and select the final result returned to the CPU/PP.
本方案中Cache访问操作可分为查表操作与更新操作两部分,同时老化操作独立于查表过程进行。如图8所示,查表操作的步骤为:In this solution, the Cache access operation can be divided into two parts, the table lookup operation and the update operation, and the aging operation is performed independently of the table lookup process. As shown in Figure 8, the steps of the table lookup operation are:
(1)请求地址到达后,经地址转换模块处理后,生成访问指针Ram的地址。(1) After the request address arrives, it is processed by the address conversion module to generate the address of the access pointer Ram.
(2)从指针Ram中对应位置读取访问Cache Ram的地址,根据该地址在Cache Ram中读取Cache数据,并与请求进行比对,判断是否命中。(2) Read the address to access the Cache Ram from the corresponding position in the pointer Ram, read the Cache data in the Cache Ram according to the address, and compare it with the request to determine whether it is a hit.
(3)根据Cache是否命中,判断是否需要向DRAM发送读请求。当Cache命中时,不需要向DRAM发送读请求,直接通过输出仲裁模块向CPU/PP返回Cache中的数据即可,并在老化保活模块对Cache中相应条目进行保活操作(即将Cache ram的地址的保活权重自增1);当Cache不命中时,需要向DRAM发送读请求,并将DRAM响应的结果通过输出仲裁模块返回给CPU/PP,DRAM响应返回后,当老化保活模块返回有可用地址时,则进行Cache更新操作,当老化保活模块未返回有可用地址时,则仅返回查表结果不进行Cache更新。(3) Determine whether a read request needs to be sent to the DRAM according to whether the Cache is hit. When the Cache hits, there is no need to send a read request to the DRAM, just return the data in the Cache to the CPU/PP directly through the output arbitration module, and the aging keep-alive module will keep alive the corresponding entries in the Cache (that is, the Cache ram The keep-alive weight of the address increases 1); when the Cache misses, it needs to send a read request to the DRAM, and the DRAM response result is returned to the CPU/PP through the output arbitration module. After the DRAM response is returned, the aging keep-alive module returns When there is an available address, the Cache update operation is performed. When the aging keep-alive module does not return an available address, only the table lookup result is returned without Cache update.
在Cache更新模块中,当DRAM响应返回时,如果老化保活模块返回有可用Cache空间,则进行Cache更新操作,如图8所示,更新操作的步骤如下:In the Cache update module, when the DRAM response is returned, if the aging keep-alive module returns available Cache space, the Cache update operation is performed, as shown in Figure 8. The update operation steps are as follows:
(1)通过地址计算模块,计算该条目在指针Ram中的地址。(1) Calculate the address of the entry in the pointer Ram through the address calculation module.
(2)将Cache Ram可用地址写入计算出的指针Ram中的地址的相应位置。(2) Write the available address of the Cache Ram into the corresponding position of the address in the calculated pointer Ram.
(3)将读取的DRAM的数据写入Cache Ram可用地址的相应位置。(3) Write the read DRAM data into the corresponding location of the Cache Ram available address.
为了简化实现,在老化保活模块中,当Cache命中时,对Cache相应条目进行保活操作,即将Cache ram的地址的保活权重自增1;当Cache不命中时,进行老化和查找可用空间的操作。如图9所示,老化操作的过程如下:In order to simplify the implementation, in the aging keep-alive module, when the Cache hits, the corresponding entry of the Cache is kept alive, that is, the keep-alive weight of the Cache ram address is incremented by 1; when the Cache does not hit, it performs aging and searches for available space. Operation. As shown in Figure 9, the process of the aging operation is as follows:
(1)判断当时是否有可用Cache空间,如果有可用地址,则老化过程结束,该地址可用于后续的Cache更新。(1) Determine whether there is available Cache space at that time. If there is an available address, the aging process ends, and the address can be used for subsequent Cache updates.
(2)当不存在可用Cache空间时,首先判断当前位置的保活权重是否为0,若保活权重为0,则老化过程结束,并将该位置作为可用地址保存下来,若保活权重不为0,将当前位置的保活权重减1,并将当前老化位置指向下一地址,循环执行上述判断过程,直至出现保活权重为0为止。(2) When there is no available Cache space, first determine whether the keep-alive weight of the current location is 0. If the keep-alive weight is 0, the aging process ends, and the location is saved as a usable address. If the keep-alive weight is not If it is 0, the keep-alive weight of the current position is reduced by 1, and the current aging position is pointed to the next address, and the above judgment process is executed in a loop until the keep-alive weight is 0.
采用本申请实施例提供的数据读取方法和装置、计算机可读存储介质,具 有以下优点:通过间接映射的方式,以较低的开销实现了组相联Cache,降低了Cache冲突的概率;通过模拟了LFU操作,将大流量条目保留在了Cache中,提高了Cache命中率,满足了网络处理器高带宽的需求;通过简单的老化和保活操作,实现可用Cache空间的选择,避免了复杂的排序或比较逻辑,有效降低了逻辑复杂度,节约了Cache的资源开销。Adopting the data reading method and device and computer-readable storage medium provided by the embodiments of the present application has the following advantages: through indirect mapping, a group-associated cache is realized with lower overhead, and the probability of cache conflict is reduced; Simulates the LFU operation, keeps large traffic entries in the Cache, improves the Cache hit rate, and meets the high bandwidth requirements of the network processor; through simple aging and keep-alive operations, the choice of available Cache space is realized, avoiding complexity The sorting or comparison logic effectively reduces the logic complexity and saves the resource overhead of Cache.

Claims (10)

  1. 一种数据读取方法,包括:A data reading method includes:
    接收读数据请求,所述读数据请求携带目标存储器中的目标存储地址;Receiving a read data request, where the read data request carries a target storage address in the target memory;
    将目标存储地址转换为第一缓存地址;Converting the target storage address into the first cache address;
    从第一缓存中读取对应所述第一缓存地址的第一数据,所述第一数据包括第二缓存地址;Reading first data corresponding to the first cache address from the first cache, where the first data includes a second cache address;
    从第二缓存中读取对应所述第二缓存地址的第二数据,将第二数据与读数据请求进行比对,判断所述读数据请求是否命中所述第二数据,其中,所述第一缓存的条目宽度W1小于所述第二缓存的条目宽度W2,所述第一缓存的条目数量K1大于所述第二缓存的条目数量K2,且K1*W1+K2*W2<K1*W2,其中,W1、W2、K1、K2均为大于1的自然数;Read the second data corresponding to the second cache address from the second cache, compare the second data with the read data request, and determine whether the read data request hits the second data, wherein the first The entry width W1 of a cache is smaller than the entry width W2 of the second cache, the number of entries K1 of the first cache is greater than the number of entries K2 of the second cache, and K1*W1+K2*W2<K1*W2, Among them, W1, W2, K1, K2 are all natural numbers greater than 1;
    响应于所述读数据请求命中所述第二数据的判断结果,输出第二数据;响应于所述读数据请求未命中所述第二数据的判断结果,根据目标存储地址读取目标存储器中的数据并输出读取的所述目标存储器中的数据。In response to the judgment result that the read data request hits the second data, the second data is output; in response to the judgment result that the read data request misses the second data, the target memory is read according to the target storage address. Data and output the read data in the target memory.
  2. 根据权利要求1所述的方法,在所述根据目标存储地址读取目标存储器中的数据之后,还包括:The method according to claim 1, after the reading data in the target memory according to the target storage address, further comprising:
    检测所述第二缓存中是否有可用的第二缓存地址;Detecting whether there is a usable second cache address in the second cache;
    响应于所述第二缓存中有可用的第二缓存地址的检测结果,将读取到的所述目标存储器中的数据存储至所述可用的第二缓存地址,并将所述可用的第二缓存地址存储至所述第一缓存地址。In response to the detection result that there is an available second cache address in the second cache, store the read data in the target memory to the available second cache address, and store the available second cache address The cache address is stored in the first cache address.
  3. 根据权利要求2所述的方法,其中,所述检测所述第二缓存中是否有可用的第二缓存地址,包括:The method according to claim 2, wherein the detecting whether there is a second cache address available in the second cache comprises:
    在所述第二缓存中存在保活权重为0的所述第二数据的情况下,所述第二缓存中有可用的第二缓存地址;在所述第二缓存中不存在保活权重为0的所述第二数据的情况下,所述第二缓存中没有可用的第二缓存地址。In the case where the second data with a keep-alive weight of 0 exists in the second cache, the second cache address is available in the second cache; there is no keep-alive weight in the second cache In the case of the second data of 0, there is no available second cache address in the second cache.
  4. 根据权利要求3所述的方法,在所述输出第二数据之后,还包括:将所述第二数据的保活权重增1。The method according to claim 3, after the output of the second data, further comprising: increasing the keep-alive weight of the second data by 1.
  5. 根据权利要求3所述的方法,在所述检测第二缓存中是否有可用的第二缓存地址之后,还包括:The method according to claim 3, after said detecting whether there is an available second cache address in the second cache, further comprising:
    响应于所述第二缓存中没有所述可用的第二缓存地址的检测结果,判断当前老化第二缓存地址的所述第二数据的保活权重是否为0;In response to the detection result that the second cache address is not available in the second cache, determining whether the keep-alive weight of the second data currently aging the second cache address is 0;
    响应于所述当前老化第二缓存地址的所述第二数据的保活权重为0的判断结果,记录当前老化第二缓存地址为所述可用的第二缓存地址;In response to the judgment result that the keep-alive weight of the second data of the currently aged second cache address is 0, recording the currently aged second cache address as the available second cache address;
    响应于所述当前老化第二缓存地址的所述第二数据的保活权重不为0的判断结果,将当前老化第二缓存地址的所述第二数据的保活权重减1,并将当前老化第二缓存地址指向下一个所述老化第二缓存地址,并循环执行判断当前老化第二缓存地址的所述第二数据的保活权重是否为0的步骤,直至出现当前老化第二缓存地址的所述第二数据的保活权重为0为止。In response to the judgment result that the keep-alive weight of the second data of the currently aging second cache address is not 0, the keep-alive weight of the second data of the currently aging second cache address is reduced by 1, and the current The aging second cache address points to the next aging second cache address, and the step of determining whether the keep-alive weight of the second data of the currently aging second cache address is 0 is performed cyclically until the current aging second cache address appears The keep-alive weight of the second data is 0.
  6. 根据权利要求1至5中任一项所述的方法,其中,所述第一缓存与所述目标存储器之间的映射方式为组相联映射,将所述目标存储器的地址范围分为K组,每组可间接映射到所述第一缓存中的n个条目,第一缓存的条目数量K1=K*n,其中,K、n均为大于1的自然数。The method according to any one of claims 1 to 5, wherein the mapping mode between the first cache and the target memory is group associative mapping, and the address range of the target memory is divided into K groups , Each group can be indirectly mapped to n entries in the first cache, and the number of entries in the first cache is K1=K*n, where K and n are both natural numbers greater than 1.
  7. 根据权利要求6所述的方法,其中,所述第二缓存的条目数量K2=K。The method according to claim 6, wherein the number of entries in the second cache is K2=K.
  8. 一种计算机可读存储介质,存储有至少一个程序,所述至少一个程序可被至少一个处理器执行,以实现如权利要求1至权利要求7中任一项所述的数据读取方法。A computer-readable storage medium stores at least one program, and the at least one program can be executed by at least one processor to implement the data reading method according to any one of claims 1 to 7.
  9. 一种数据读取装置,包括处理器及存储器,其中:所述处理器设置为执行存储器中存储的程序,以实现如权利要求1至权利要求7中任一项所述的数据读取方法。A data reading device includes a processor and a memory, wherein the processor is configured to execute a program stored in the memory to implement the data reading method according to any one of claims 1 to 7.
  10. 一种数据读取装置,其包括地址转换模块、第一缓存、第二缓存和数据查找模块,其中:A data reading device includes an address conversion module, a first cache, a second cache, and a data search module, wherein:
    地址转换模块,设置为接收读数据请求,所述读数据请求中携带目标存储器中的目标存储地址;将目标存储地址转换为第一缓存地址;An address conversion module, configured to receive a read data request, where the read data request carries a target storage address in the target memory; convert the target storage address into a first cache address;
    第一缓存,设置为缓存第二缓存地址;The first cache is set to cache the second cache address;
    第二缓存,设置为缓存目标存储器中的数据;The second cache is set to cache data in the target memory;
    数据查找模块,设置为从第一缓存中读取对应所述第一缓存地址的第一数据,所述第一数据包括第二缓存地址;从第二缓存中读取对应所述第二缓存地 址的第二数据,将第二数据与读数据请求进行比对,判断所述读数据请求是否命中所述第二数据,其中,所述第一缓存的条目宽度W1小于所述第二缓存的条目宽度W2,所述第一缓存的条目数量K1大于所述第二缓存的条目数量K2,且K1*W1+K2*W2<K1*W2,其中,W1、W2、K1、K2均为大于1的自然数;响应于所述读数据请求命中所述第二数据的判断结果,输出第二数据;响应于所述读数据请求未命中所述第二数据的判断结果,根据目标存储地址读取目标存储器中的数据并输出读取的所述目标存储器中的数据。The data search module is configured to read the first data corresponding to the first cache address from the first cache, the first data including the second cache address; read the second cache address from the second cache Compare the second data with the read data request to determine whether the read data request hits the second data, wherein the entry width W1 of the first cache is smaller than the entry of the second cache Width W2, the number of entries K1 in the first cache is greater than the number K2 of entries in the second cache, and K1*W1+K2*W2<K1*W2, where W1, W2, K1, and K2 are all greater than 1. Natural number; in response to the judgment result that the read data request hits the second data, output second data; in response to the judgment result that the read data request misses the second data, read the target memory according to the target storage address And output the read data in the target memory.
PCT/CN2020/102123 2019-07-15 2020-07-15 Data reading method and apparatus, and computer-readable storage medium WO2021008552A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910637085.7A CN112231241B (en) 2019-07-15 2019-07-15 Data reading method and device and computer readable storage medium
CN201910637085.7 2019-07-15

Publications (1)

Publication Number Publication Date
WO2021008552A1 true WO2021008552A1 (en) 2021-01-21

Family

ID=74111706

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/102123 WO2021008552A1 (en) 2019-07-15 2020-07-15 Data reading method and apparatus, and computer-readable storage medium

Country Status (2)

Country Link
CN (1) CN112231241B (en)
WO (1) WO2021008552A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113515474A (en) * 2021-07-30 2021-10-19 上海阵量智能科技有限公司 Data processing apparatus, method, computer device, and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160103767A1 (en) * 2014-10-09 2016-04-14 Netapp, Inc. Methods and systems for dynamic hashing in caching sub-systems
US20170329720A1 (en) * 2016-05-13 2017-11-16 Verizon Digital Media Services Inc. Deterministic multifactor cache replacement
CN107783916A (en) * 2016-08-26 2018-03-09 大心电子股份有限公司 Data transmission method, storage control and inventory management circuit
CN108459826A (en) * 2018-02-01 2018-08-28 杭州宏杉科技股份有限公司 A kind of method and device of processing I/O Request
CN108664213A (en) * 2017-03-31 2018-10-16 北京忆恒创源科技有限公司 Atom write command processing method based on distributed caching and solid storage device
CN108958700A (en) * 2017-05-22 2018-12-07 深圳市中兴微电子技术有限公司 A kind of first in first out data buffer and data cached method

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7032076B2 (en) * 2002-09-16 2006-04-18 Intel Corporation Prefetching data in a computer system
JP5300407B2 (en) * 2008-10-20 2013-09-25 株式会社東芝 Virtual address cache memory and virtual address cache method
CN103176752A (en) * 2012-07-02 2013-06-26 晶天电子(深圳)有限公司 Super-endurance solid-state drive with Endurance Translation Layer (ETL) and diversion of temp files for reduced Flash wear
WO2014061064A1 (en) * 2012-10-18 2014-04-24 Hitachi, Ltd. Cache control apparatus and cache control method
CN104166634A (en) * 2014-08-12 2014-11-26 华中科技大学 Management method of mapping table caches in solid-state disk system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160103767A1 (en) * 2014-10-09 2016-04-14 Netapp, Inc. Methods and systems for dynamic hashing in caching sub-systems
US20170329720A1 (en) * 2016-05-13 2017-11-16 Verizon Digital Media Services Inc. Deterministic multifactor cache replacement
CN107783916A (en) * 2016-08-26 2018-03-09 大心电子股份有限公司 Data transmission method, storage control and inventory management circuit
CN108664213A (en) * 2017-03-31 2018-10-16 北京忆恒创源科技有限公司 Atom write command processing method based on distributed caching and solid storage device
CN108958700A (en) * 2017-05-22 2018-12-07 深圳市中兴微电子技术有限公司 A kind of first in first out data buffer and data cached method
CN108459826A (en) * 2018-02-01 2018-08-28 杭州宏杉科技股份有限公司 A kind of method and device of processing I/O Request

Also Published As

Publication number Publication date
CN112231241A (en) 2021-01-15
CN112231241B (en) 2023-02-17

Similar Documents

Publication Publication Date Title
US10241919B2 (en) Data caching method and computer system
JP7340326B2 (en) Perform maintenance operations
US20210089470A1 (en) Address translation methods and systems
JP2015528603A (en) Aggregation / grouping operation: Hardware implementation of hash table method
IE20170188A1 (en) Memory management supporting huge pages
WO2019127104A1 (en) Method for resource adjustment in cache, data access method and device
US8335908B2 (en) Data processing apparatus for storing address translations
US11836079B2 (en) Storage management apparatus, storage management method, processor, and computer system
US20110320720A1 (en) Cache Line Replacement In A Symmetric Multiprocessing Computer
US20170132148A1 (en) Memory Management Method and Device and Memory Controller
CN108694133A (en) Device, method and system for instant cache relevance
US10831673B2 (en) Memory address translation
WO2021008552A1 (en) Data reading method and apparatus, and computer-readable storage medium
CN109983538B (en) Memory address translation
CN104731720A (en) Set associative second-level memory management device
KR102355374B1 (en) Memory management unit capable of managing address translation table using heterogeneous memory, and address management method thereof
US20140013054A1 (en) Storing data structures in cache
US11003591B2 (en) Arithmetic processor, information processing device and control method of arithmetic processor
US9286237B2 (en) Memory imbalance prediction based cache management
US20160103766A1 (en) Lookup of a data structure containing a mapping between a virtual address space and a physical address space
JP7311959B2 (en) Data storage for multiple data types
US10419571B2 (en) Packet processor forwarding database cache
CN116069719A (en) Processor, memory controller, system-on-chip and data prefetching method
CN117880222A (en) TOE acceleration system and method
CN115934587A (en) Memory management unit and memory management method

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20841333

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20841333

Country of ref document: EP

Kind code of ref document: A1